diff --git a/.gitignore b/.gitignore index ba367b249c1..8c1601a0ac3 100644 --- a/.gitignore +++ b/.gitignore @@ -188,3 +188,4 @@ src/Orchard.Azure/Orchard.Azure.CloudService/Staging/ #enable all /lib artifacts !lib/**/*.* */.vs/* +src/Rebracer.xml diff --git a/CREDITS.txt b/CREDITS.txt index e223fdf1c7e..51194d0d68b 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -2,12 +2,6 @@ Orchard Project - Copyright .NET Foundation Orchard includes works distributed under the licenses listed below. The full text for most of the licenses listed below can be found in the LICENSE.txt file accompanying each work. The original copyright notices have been preserved within the respective files and or packages. Please refer to the specific files and/or packages for more detailed information about the authors, copyright notices, and licenses. -Antlr ------ -Website: http://www.antlr.org/ -Copyright: Copyright (c) 2003-2008 Terence Parr -License: New BSD - ASP.NET MVC ----- Website: http://aspnet.codeplex.com/wikipage?title=MVC&referringTitle=Home @@ -28,18 +22,18 @@ Website: http://code.google.com/p/autofac/ Copyright: Copyright (c) 2007-2008 Autofac Contributors License: http://code.google.com/p/autofac/source/browse/trunk/contrib/AutofacContrib%20License.txt +CamanJS +----- +Website: http://camanjs.com/ +Copyright: Copyright (c) 2010-2015, Ryan LeFevre +License: https://raw.githubusercontent.com/meltingice/CamanJS/3dd24d1bba3aed91d7072d1039e488a3af4c394b/LICENSE + Castle ----- Website: http://www.castleproject.org/container/index.html Copyright: Copyright (c) 2004-2009 Castle Project License: Apache Software Foundation License 2.0 -Clay ----- -Website: http://clay.codeplex.com/ -Copyright: Copyright (c) 2010 Louis Dejardin -License: MS-PL - CodeMirror ---------- Website: http://codemirror.net/2/ @@ -167,6 +161,12 @@ Website: http://flesler.blogspot.com Copyright: Copyright (c) 2007-2009 Ariel Flesler License: MIT +Json.NET +----- +Website: http://www.newtonsoft.com/json +Copyright: Copyright (c) 2007 James Newton-King +License: MIT - https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md + jsPlumb ----- Website: http://jsplumb.org @@ -191,6 +191,12 @@ Website: http://incubator.apache.org/projects/lucene.net.html Copyright: Copyright (c) 2009 Apache Software Foundation License: Apache Software Foundation License 2.0 +MarkdownSharp +----- +Website: http://code.google.com/p/markdownsharp/ +Copyright: Copyright (c) 2009-2011 Jeff Atwood +License: MIT + Mono Class Library ----- Website: http://www.mono-project.com/The_Class_Library @@ -206,9 +212,9 @@ License: New BSD MySQL Connectors ----- Copyright: Copyright (c) 2004, 2011, Oracle and/or its affiliates -License: GNU GENERAL PUBLIC LICENSE Version 2; Oracles Free and Open Source Software ("FOSS") License Exception +License: GNU GENERAL PUBLIC LICENSE Version 2; Oracle�s Free and Open Source Software ("FOSS") License Exception -In order to comply with Section 2(a) of the FOSS License Exception, .NET Foundation hereby offers any recipient of this package a machine-readable copy of the corresponding source code for Oracle's MySQL Client Libraries upon written demand. This offer is good for three years. +In order to comply with Section 2(a) of the FOSS License Exception, .NET Foundation hereby offers any recipient of this package a machine-readable copy of the corresponding source code for Oracle's MySQL Client Libraries upon written demand.� This offer is good for three years. NHibernate, NHibernate Linq ----- diff --git a/CleanSolution.ps1 b/CleanSolution.ps1 new file mode 100644 index 00000000000..784b609d6a5 --- /dev/null +++ b/CleanSolution.ps1 @@ -0,0 +1,43 @@ +<# +.Synopsis + Cleans the solution: removes all bin and obj folders under src, deletes Dependencies, cache.dat and all mappings.bin files from App_Data. + Just run the script where it is, don't move or run elsewhere. + +.EXAMPLE + PS> .\CleanSolution.ps1 + +#> + +# Deleting bin and obj folders. +$currentPath = (Get-Item -Path ".\").FullName +# Add relative file paths here what you want to keep. +$whiteList = @("\src\Orchard.Azure\Orchard.Azure.CloudService\Orchard.Azure.WebContent\Bin\Startup\SetIdleTimeout.cmd") +# Also add the bin/obj folder's path of the paths in the whiteList here. This is needed for performance reasons, the script will run faster this way. +$whiteListFolders = @("\src\Orchard.Azure\Orchard.Azure.CloudService\Orchard.Azure.WebContent\Bin") + +Get-ChildItem -Path ($currentPath + "\src\") -Recurse | +Where-Object { $PSItem.PSIsContainer -and ( $PSItem.Name -eq "bin" -or $PSItem.Name -eq "obj") } | +ForEach-Object { + if($whiteListFolders.Contains($PSItem.FullName.Substring($currentPath.Length))) + { + Get-ChildItem -Path $PSItem.FullName -Recurse -File | + ForEach-Object { + if(!$whiteList.Contains($PSItem.FullName.Substring($currentPath.Length))) + { + Remove-Item $PSItem.FullName -Force + } + } + } + else + { + Remove-Item $PSItem.FullName -Recurse -Force + } +} + +# Deleting Dependencies and cache.dat from App_Data. +Remove-Item -Path ($currentPath + "\src\Orchard.Web\App_Data\Dependencies\") -Recurse -Force +Remove-Item -Path ($currentPath + "\src\Orchard.Web\App_Data\cache.dat") -Force + +# Deleting all mappings.bin files from App_Data. +Get-ChildItem -Path ($currentPath + "\src\Orchard.Web\App_Data\Sites") -Recurse -Include "mappings.bin" | +Remove-Item -Force \ No newline at end of file diff --git a/ClickToBuild.cmd b/ClickToBuild.cmd index ee56b4376c8..23cd2267d0a 100644 --- a/ClickToBuild.cmd +++ b/ClickToBuild.cmd @@ -1,4 +1,8 @@ -FOR %%b in ( +FOR %%b in ( + "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" + "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" + "%ProgramFiles%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" + "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" @@ -23,6 +27,8 @@ SET project=%2 IF "%target%" == "" SET target=Build IF "%project%" =="" SET project=Orchard.proj +lib\nuget\nuget.exe restore .\src\Orchard.sln + msbuild /t:%target% %project% pause diff --git a/Orchard.proj b/Orchard.proj index b1561cb20c5..1c221bb3669 100644 --- a/Orchard.proj +++ b/Orchard.proj @@ -33,7 +33,8 @@ $(BUILD_NUMBER) - + + @@ -52,7 +53,6 @@ - @@ -110,8 +110,8 @@ - - + + - - - - - - - - - @@ -174,13 +162,10 @@ - - - @@ -302,9 +287,12 @@ @@ -335,9 +323,11 @@ - + - - - Microsoft.Web.Infrastructure - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/aspnetmvc/System.Web.Helpers.dll b/lib/aspnetmvc/System.Web.Helpers.dll deleted file mode 100644 index b13e613601c..00000000000 Binary files a/lib/aspnetmvc/System.Web.Helpers.dll and /dev/null differ diff --git a/lib/aspnetmvc/System.Web.Helpers.xml b/lib/aspnetmvc/System.Web.Helpers.xml deleted file mode 100644 index d5cfa6debc4..00000000000 --- a/lib/aspnetmvc/System.Web.Helpers.xml +++ /dev/null @@ -1,839 +0,0 @@ - - - - System.Web.Helpers - - - - Displays data in the form of a graphical chart. - - - Initializes a new instance of the class. - The width, in pixels, of the complete chart image. - The height, in pixels, of the complete chart image. - (Optional) The template (theme) to apply to the chart. - (Optional) The template (theme) path and file name to apply to the chart. - - - Adds a legend to the chart. - The chart. - The text of the legend title. - The unique name of the legend. - - - Provides data points and series attributes for the chart. - The chart. - The unique name of the series. - The chart type of a series. - The name of the chart area that is used to plot the data series. - The axis label text for the series. - The name of the series that is associated with the legend. - The granularity of data point markers. - The values to plot along the x-axis. - The name of the field for x-values. - The values to plot along the y-axis. - A comma-separated list of name or names of the field or fields for y-values. - - - Adds a title to the chart. - The chart. - The title text. - The unique name of the title. - - - Binds a chart to a data table, where one series is created for each unique value in a column. - The chart. - The chart data source. - The name of the column that is used to group data into the series. - The name of the column for x-values. - A comma-separated list of names of the columns for y-values. - Other data point properties that can be bound. - The order in which the series will be sorted. The default is "Ascending". - - - Creates and binds series data to the specified data table, and optionally populates multiple x-values. - The chart. - The chart data source. This can be can be any object. - The name of the table column used for the series x-values. - - - Gets or sets the name of the file that contains the chart image. - The name of the file. - - - Returns a chart image as a byte array. - The chart. - The image format. The default is "jpeg". - - - Retrieves the specified chart from the cache. - The chart. - The ID of the cache item that contains the chart to retrieve. The key is set when you call the method. - - - Gets or sets the height, in pixels, of the chart image. - The chart height. - - - Saves a chart image to the specified file. - The chart. - The location and name of the image file. - The image file format, such as "png" or "jpeg". - - - Saves a chart in the system cache. - The ID of the cache item that contains the chart. - The ID of the chart in the cache. - The number of minutes to keep the chart image in the cache. The default is 20. - true to indicate that the chart cache item's expiration is reset each time the item is accessed, or false to indicate that the expiration is based on an absolute interval since the time that the item was added to the cache. The default is true. - - - Saves a chart as an XML file. - The chart. - The path and name of the XML file. - - - Sets values for the horizontal axis. - The chart. - The title of the x-axis. - The minimum value for the x-axis. - The maximum value for the x-axis. - - - Sets values for the vertical axis. - The chart. - The title of the y-axis. - The minimum value for the y-axis. - The maximum value for the y-axis. - - - Creates a object based on the current object. - The chart. - The format of the image to save the object as. The default is "jpeg". The parameter is not case sensitive. - - - Gets or set the width, in pixels, of the chart image. - The chart width. - - - Renders the output of the object as an image. - The chart. - The format of the image. The default is "jpeg". - - - Renders the output of a object that has been cached as an image. - The chart. - The ID of the chart in the cache. - The format of the image. The default is "jpeg". - - - Specifies visual themes for a object. - - - A theme for 2D charting that features a visual container with a blue gradient, rounded edges, drop-shadowing, and high-contrast gridlines. - - - A theme for 2D charting that features a visual container with a green gradient, rounded edges, drop-shadowing, and low-contrast gridlines. - - - A theme for 2D charting that features no visual container and no gridlines. - - - A theme for 3D charting that features no visual container, limited labeling and, sparse, high-contrast gridlines. - - - A theme for 2D charting that features a visual container that has a yellow gradient, rounded edges, drop-shadowing, and high-contrast gridlines. - - - Provides methods to generate hash values and encrypt passwords or other sensitive data. - - - Generates a cryptographically strong sequence of random byte values. - The generated salt value as a base-64-encoded string. - The number of cryptographically random bytes to generate. - - - Returns a hash value for the specified byte array. - The hash value for as a string of hexadecimal characters. - The data to provide a hash value for. - The algorithm that is used to generate the hash value. The default is "sha256". - - is null. - - - Returns a hash value for the specified string. - The hash value for as a string of hexadecimal characters. - The data to provide a hash value for. - The algorithm that is used to generate the hash value. The default is "sha256". - - is null. - - - Returns an RFC 2898 hash value for the specified password. - The hash value for as a base-64-encoded string. - The password to generate a hash value for. - - is null. - - - Returns a SHA-1 hash value for the specified string. - The SHA-1 hash value for as a string of hexadecimal characters. - The data to provide a hash value for. - - is null. - - - Returns a SHA-256 hash value for the specified string. - The SHA-256 hash value for as a string of hexadecimal characters. - The data to provide a hash value for. - - is null. - - - Determines whether the specified RFC 2898 hash and password are a cryptographic match. - true if the hash value is a cryptographic match for the password; otherwise, false. - The previously-computed RFC 2898 hash value as a base-64-encoded string. - The plaintext password to cryptographically compare with . - - or is null. - - - Represents a series of values as a JavaScript-like array by using the dynamic capabilities of the Dynamic Language Runtime (DLR). - - - Initializes a new instance of the class using the specified array element values. - An array of objects that contains the values to add to the instance. - - - Returns an enumerator that can be used to iterate through the elements of the instance. - An enumerator that can be used to iterate through the elements of the JSON array. - - - Returns the value at the specified index in the instance. - The value at the specified index. - - - Returns the number of elements in the instance. - The number of elements in the JSON array. - - - Converts a instance to an array of objects. - The array of objects that represents the JSON array. - The JSON array to convert. - - - Converts a instance to an array of objects. - The array of objects that represents the JSON array. - The JSON array to convert. - - - Returns an enumerator that can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - Converts the instance to a compatible type. - true if the conversion was successful; otherwise, false. - Provides information about the conversion operation. - When this method returns, contains the result of the type conversion operation. This parameter is passed uninitialized. - - - Tests the instance for dynamic members (which are not supported) in a way that does not cause an exception to be thrown. - true in all cases. - Provides information about the get operation. - When this method returns, contains null. This parameter is passed uninitialized. - - - Represents a collection of values as a JavaScript-like object by using the capabilities of the Dynamic Language Runtime. - - - Initializes a new instance of the class using the specified field values. - A dictionary of property names and values to add to the instance as dynamic members. - - - Returns a list that contains the name of all dynamic members (JSON fields) of the instance. - A list that contains the name of every dynamic member (JSON field). - - - Converts the instance to a compatible type. - true in all cases. - Provides information about the conversion operation. - When this method returns, contains the result of the type conversion operation. This parameter is passed uninitialized. - The instance could not be converted to the specified type. - - - Gets the value of a field using the specified index. - true in all cases. - Provides information about the indexed get operation. - An array that contains a single object that indexes the field by name. The object must be convertible to a string that specifies the name of the JSON field to return. If multiple indexes are specified, contains null when this method returns. - When this method returns, contains the value of the indexed field, or null if the get operation was unsuccessful. This parameter is passed uninitialized. - - - Gets the value of a field using the specified name. - true in all cases. - Provides information about the get operation. - When this method returns, contains the value of the field, or null if the get operation was unsuccessful. This parameter is passed uninitialized. - - - Sets the value of a field using the specified index. - true in all cases. - Provides information about the indexed set operation. - An array that contains a single object that indexes the field by name. The object must be convertible to a string that specifies the name of the JSON field to return. If multiple indexes are specified, no field is changed or added. - The value to set the field to. - - - Sets the value of a field using the specified name. - true in all cases. - Provides information about the set operation. - The value to set the field to. - - - Provides methods for working with data in JavaScript Object Notation (JSON) format. - - - Converts data in JavaScript Object Notation (JSON) format into the specified strongly typed data list. - The JSON-encoded data converted to a strongly typed list. - The JSON-encoded string to convert. - The type of the strongly typed list to convert JSON data into. - - - Converts data in JavaScript Object Notation (JSON) format into a data object. - The JSON-encoded data converted to a data object. - The JSON-encoded string to convert. - - - Converts data in JavaScript Object Notation (JSON) format into a data object of a specified type. - The JSON-encoded data converted to the specified type. - The JSON-encoded string to convert. - The type that the data should be converted to. - - - Converts a data object to a string that is in the JavaScript Object Notation (JSON) format. - Returns a string of data converted to the JSON format. - The data object to convert. - - - Converts a data object to a string in JavaScript Object Notation (JSON) format and adds the string to the specified object. - The data object to convert. - The object that contains the converted JSON data. - - - Renders the property names and values of the specified object and of any subobjects that it references. - - - Renders the property names and values of the specified object and of any subobjects. - For a simple variable, returns the type and the value. For an object that contains multiple items, returns the property name or key and the value for each property. - The object to render information for. - Optional. Specifies the depth of nested subobjects to render information for. The default is 10. - Optional. Specifies the maximum number of characters that the method displays for object values. The default is 1000. - - is less than zero. - - is less than or equal to zero. - - - Displays information about the web server environment that hosts the current web page. - - - Displays information about the web server environment. - A string of name-value pairs that contains information about the web server. - - - Specifies the direction in which to sort a list of items. - - - Sort from smallest to largest —for example, from 1 to 10. - - - Sort from largest to smallest — for example, from 10 to 1. - - - Provides a cache to store frequently accessed data. - - - Retrieves the specified item from the object. - The item retrieved from the cache, or null if the item is not found. - The identifier for the cache item to retrieve. - - - Removes the specified item from the object. - The item removed from the object. If the item is not found, returns null. - The identifier for the cache item to remove. - - - Inserts an item into the object. - The identifier for the cache item. - The data to insert into the cache. - Optional. The number of minutes to keep an item in the cache. The default is 20. - Optional. true to indicate that the cache item expiration is reset each time the item is accessed, or false to indicate that the expiration is based the absolute time since the item was added to the cache. The default is true. In that case, if you also use the default value for the parameter, a cached item expires 20 minutes after it was last accessed. - The value of is less than or equal to zero. - Sliding expiration is enabled and the value of is greater than a year. - - - Displays data on a web page using an HTML table element. - - - Initializes a new instance of the class. - The data to display. - A collection that contains the names of the data columns to display. By default, this value is auto-populated according to the values in the parameter. - The name of the data column that is used to sort the grid by default. - The number of rows that are displayed on each page of the grid when paging is enabled. The default is 10. - true to specify that paging is enabled for the instance; otherwise false. The default is true. - true to specify that sorting is enabled for the instance; otherwise, false. The default is true. - The value of the HTML id attribute that is used to mark the HTML element that gets dynamic Ajax updates that are associated with the instance. - The name of the JavaScript function that is called after the HTML element specified by the property has been updated. If the name of a function is not provided, no function will be called. If the specified function does not exist, a JavaScript error will occur if it is invoked. - The prefix that is applied to all query-string fields that are associated with the instance. This value is used in order to support multiple instances on the same web page. - The name of the query-string field that is used to specify the current page of the instance. - The name of the query-string field that is used to specify the currently selected row of the instance. - The name of the query-string field that is used to specify the name of the data column that the instance is sorted by. - The name of the query-string field that is used to specify the direction in which the instance is sorted. - - - Adds a specific sort function for a given column. - The current grid, with the new custom sorter applied. - The column name (as used for sorting) - The function used to select a key to sort by, for each element in the grid's source. - The type of elements in the grid's source. - The column type, usually inferred from the keySelector function's return type. - - - Gets the name of the JavaScript function to call after the HTML element that is associated with the instance has been updated in response to an Ajax update request. - The name of the function. - - - Gets the value of the HTML id attribute that marks an HTML element on the web page that gets dynamic Ajax updates that are associated with the instance. - The value of the id attribute. - - - Binds the specified data to the instance. - The bound and populated instance. - The data to display. - A collection that contains the names of the data columns to bind. - true to enable sorting and paging of the instance; otherwise, false. - The number of rows to display on each page of the grid. - - - Gets a value that indicates whether the instance supports sorting. - true if the instance supports sorting; otherwise, false. - - - Creates a new instance. - The new column. - The name of the data column to associate with the instance. - The text that is rendered in the header of the HTML table column that is associated with the instance. - The function that is used to format the data values that are associated with the instance. - A string that specifies the name of the CSS class that is used to style the HTML table cells that are associated with the instance. - true to enable sorting in the instance by the data values that are associated with the instance; otherwise, false. The default is true. - - - Gets a collection that contains the name of each data column that is bound to the instance. - The collection of data column names. - - - Returns an array that contains the specified instances. - An array of columns. - A variable number of column instances. - - - Gets the prefix that is applied to all query-string fields that are associated with the instance. - The query-string field prefix of the instance. - - - Returns a JavaScript statement that can be used to update the HTML element that is associated with the instance on the specified web page. - A JavaScript statement that can be used to update the HTML element in a web page that is associated with the instance. - The URL of the web page that contains the instance that is being updated. The URL can include query-string arguments. - - - Returns the HTML markup that is used to render the instance and using the specified paging options. - The HTML markup that represents the fully-populated instance. - The name of the CSS class that is used to style the whole table. - The name of the CSS class that is used to style the table header. - The name of the CSS class that is used to style the table footer. - The name of the CSS class that is used to style each table row. - The name of the CSS class that is used to style even-numbered table rows. - The name of the CSS class that is used to style the selected table row. (Only one row can be selected at a time.) - The table caption. - true to display the table header; otherwise, false. The default is true. - true to insert additional rows in the last page when there are insufficient data items to fill the last page; otherwise, false. The default is false. Additional rows are populated using the text specified by the parameter. - The text that is used to populate additional rows in a page when there are insufficient data items to fill the last page. The parameter must be set to true to display these additional rows. - A collection of instances that specify how each column is displayed. This includes which data column is associated with each grid column, and how to format the data values that each grid column contains. - A collection that contains the names of the data columns to exclude when the grid auto-populates columns. - A bitwise combination of the enumeration values that specify methods that are provided for moving between pages of the instance. - The text for the HTML link element that is used to link to the first page of the instance. The flag of the parameter must be set to display this page navigation element. - The text for the HTML link element that is used to link to previous page of the instance. The flag of the parameter must be set to display this page navigation element. - The text for the HTML link element that is used to link to the next page of the instance. The flag of the parameter must be set to display this page navigation element. - The text for the HTML link element that is used to link to the last page of the instance. The flag of the parameter must be set to display this page navigation element. - The number of numeric page links that are provided to nearby pages. The text of each numeric page link contains the page number. The flag of the parameter must be set to display these page navigation elements. - An object that represents a collection of attributes (names and values) to set for the HTML table element that represents the instance. - - - Returns a URL that can be used to display the specified data page of the instance. - A URL that can be used to display the specified data page of the grid. - The index of the page to display. - - - Returns a URL that can be used to sort the instance by the specified column. - A URL that can be used to sort the grid. - The name of the data column to sort by. - - - Gets a value that indicates whether a row in the instance is selected. - true if a row is currently selected; otherwise, false. - - - Returns a value that indicates whether the instance can use Ajax calls to refresh the display. - true if the instance supports Ajax calls; otherwise, false.. - - - Gets the number of pages that the instance contains. - The page count. - - - Gets the full name of the query-string field that is used to specify the current page of the instance. - The full name of the query string field that is used to specify the current page of the grid. - - - Gets or sets the index of the current page of the instance. - The index of the current page. - - - Returns the HTML markup that is used to provide the specified paging support for the instance. - The HTML markup that provides paging support for the grid. - A bitwise combination of the enumeration values that specify the methods that are provided for moving between the pages of the grid. The default is the bitwise OR of the and flags. - The text for the HTML link element that navigates to the first page of the grid. - The text for the HTML link element that navigates to the previous page of the grid. - The text for the HTML link element that navigates to the next page of the grid. - The text for the HTML link element that navigates to the last page of the grid. - The number of numeric page links to display. The default is 5. - - - Gets a list that contains the rows that are on the current page of the instance after the grid has been sorted. - The list of rows. - - - Gets the number of rows that are displayed on each page of the instance. - The number of rows that are displayed on each page of the grid. - - - Gets or sets the index of the selected row relative to the current page of the instance. - The index of the selected row relative to the current page. - - - Gets the currently selected row of the instance. - The currently selected row. - - - Gets the full name of the query-string field that is used to specify the selected row of the instance. - The full name of the query string field that is used to specify the selected row of the grid. - - - Gets or sets the name of the data column that the instance is sorted by. - The name of the data column that is used to sort the grid. - - - Gets or sets the direction in which the instance is sorted. - The sort direction. - - - Gets the full name of the query-string field that is used to specify the sort direction of the instance. - The full name of the query string field that is used to specify the sort direction of the grid. - - - Gets the full name of the query-string field that is used to specify the name of the data column that the instance is sorted by. - The full name of the query-string field that is used to specify the name of the data column that the grid is sorted by. - - - Returns the HTML markup that is used to render the instance. - The HTML markup that represents the fully-populated instance. - The name of the CSS class that is used to style the whole table. - The name of the CSS class that is used to style the table header. - The name of the CSS class that is used to style the table footer. - The name of the CSS class that is used to style each table row. - The name of the CSS class that is used to style even-numbered table rows. - The name of the CSS class that is used use to style the selected table row. - The table caption. - true to display the table header; otherwise, false. The default is true. - true to insert additional rows in the last page when there are insufficient data items to fill the last page; otherwise, false. The default is false. Additional rows are populated using the text specified by the parameter. - The text that is used to populate additional rows in the last page when there are insufficient data items to fill the last page. The parameter must be set to true to display these additional rows. - A collection of instances that specify how each column is displayed. This includes which data column is associated with each grid column, and how to format the data values that each grid column contains. - A collection that contains the names of the data columns to exclude when the grid auto-populates columns. - A function that returns the HTML markup that is used to render the table footer. - An object that represents a collection of attributes (names and values) to set for the HTML table element that represents the instance. - - - Gets the total number of rows that the instance contains. - The total number of rows in the grid. This value includes all rows from every page, but does not include the additional rows inserted in the last page when there are insufficient data items to fill the last page. - - - Represents a column in a instance. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether the column can be sorted. - true to indicate that the column can be sorted; otherwise, false. - - - Gets or sets the name of the data item that is associated with the column. - The name of the data item. - - - Gets or sets a function that is used to format the data item that is associated with the column. - The function that is used to format that data item that is associated with the column. - - - Gets or sets the text that is rendered in the header of the column. - The text that is rendered to the column header. - - - Gets or sets the CSS class attribute that is rendered as part of the HTML table cells that are associated with the column. - The CSS class attribute that is applied to cells that are associated with the column. - - - Specifies flags that describe the methods that are provided for moving between the pages of a instance.This enumeration has a attribute that allows a bitwise combination of its member values. - - - Indicates that all methods for moving between pages are provided. - - - Indicates that methods for moving directly to the first or last page are provided. - - - Indicates that methods for moving to the next or previous page are provided. - - - Indicates that methods for moving to a nearby page by using a page number are provided. - - - Represents a row in a instance. - - - Initializes a new instance of the class using the specified instance, row value, and index. - The instance that contains the row. - An object that contains a property member for each value in the row. - The index of the row. - - - Returns an enumerator that can be used to iterate through the values of the instance. - An enumerator that can be used to iterate through the values of the row. - - - Returns an HTML element (a link) that users can use to select the row. - The link that users can click to select the row. - The inner text of the link element. If is empty or null, "Select" is used. - - - Returns the URL that can be used to select the row. - The URL that is used to select a row. - - - Returns the value at the specified index in the instance. - The value at the specified index. - The zero-based index of the value in the row to return. - - is less than 0 or greater than or equal to the number of values in the row. - - - Returns the value that has the specified name in the instance. - The specified value. - The name of the value in the row to return. - - is Nothing or empty. - - specifies a value that does not exist. - - - Returns an enumerator that can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - Returns a string that represents all of the values of the instance. - A string that represents the row's values. - - - Returns the value of a member that is described by the specified binder. - true if the value of the item was successfully retrieved; otherwise, false. - The getter of the bound property member. - When this method returns, contains an object that holds the value of the item described by . This parameter is passed uninitialized. - - - Gets an object that contains a property member for each value in the row. - An object that contains each value in the row as a property. - - - Gets the instance that the row belongs to. - The instance that contains the row. - - - Represents an object that lets you display and manage images in a web page. - - - Initializes a new instance of the class using a byte array to represent the image. - The image. - - - Initializes a new instance of the class using a stream to represent the image. - The image. - - - Initializes a new instance of the class using a path to represent the image location. - The path of the file that contains the image. - - - Adds a watermark image using a path to the watermark image. - The watermarked image. - The path of a file that contains the watermark image. - The width, in pixels, of the watermark image. - The height, in pixels, of the watermark image. - The horizontal alignment for watermark image. Values can be "Left", "Right", or "Center". - The vertical alignment for the watermark image. Values can be "Top", "Middle", or "Bottom". - The opacity for the watermark image, specified as a value between 0 and 100. - The size, in pixels, of the padding around the watermark image. - - - Adds a watermark image using the specified image object. - The watermarked image. - A object. - The width, in pixels, of the watermark image. - The height, in pixels, of the watermark image. - The horizontal alignment for watermark image. Values can be "Left", "Right", or "Center". - The vertical alignment for the watermark image. Values can be "Top", "Middle", or "Bottom". - The opacity for the watermark image, specified as a value between 0 and 100. - The size, in pixels, of the padding around the watermark image. - - - Adds watermark text to the image. - The watermarked image. - The text to use as a watermark. - The color of the watermark text. - The font size of the watermark text. - The font style of the watermark text. - The font type of the watermark text. - The horizontal alignment for watermark text. Values can be "Left", "Right", or "Center". - The vertical alignment for the watermark text. Values can be "Top", "Middle", or "Bottom". - The opacity for the watermark image, specified as a value between 0 and 100. - The size, in pixels, of the padding around the watermark text. - - - Copies the object. - The image. - - - Crops an image. - The cropped image. - The number of pixels to remove from the top. - The number of pixels to remove from the left. - The number of pixels to remove from the bottom. - The number of pixels to remove from the right. - - - Gets or sets the file name of the object. - The file name. - - - Flips an image horizontally. - The flipped image. - - - Flips an image vertically. - The flipped image. - - - Returns the image as a byte array. - The image. - The value of the object. - - - Returns an image that has been uploaded using the browser. - The image. - (Optional) The name of the file that has been posted. If no file name is specified, the first file that was uploaded is returned. - - - Gets the height, in pixels, of the image. - The height. - - - Gets the format of the image (for example, "jpeg" or "png"). - The file format of the image. - - - Resizes an image. - The resized image. - The width, in pixels, of the object. - The height, in pixels, of the object. - true to preserve the aspect ratio of the image; otherwise, false. - true to prevent the enlargement of the image; otherwise, false. - - - Rotates an image to the left. - The rotated image. - - - Rotates an image to the right. - The rotated image. - - - Saves the image using the specified file name. - The image. - The path to save the image to. - The format to use when the image file is saved, such as "gif", or "png". - true to force the correct file-name extension to be used for the format that is specified in ; otherwise, false. If there is a mismatch between the file type and the specified file-name extension, and if is true, the correct extension will be appended to the file name. For example, a PNG file named Photograph.txt is saved using the name Photograph.txt.png. - - - Gets the width, in pixels, of the image. - The width. - - - Renders an image to the browser. - The image. - (Optional) The file format to use when the image is written. - - - Provides a way to construct and send an email message using Simple Mail Transfer Protocol (SMTP). - - - Gets or sets a value that indicates whether Secure Sockets Layer (SSL) is used to encrypt the connection when an email message is sent. - true if SSL is used to encrypt the connection; otherwise, false. - - - Gets or sets the email address of the sender. - The email address of the sender. - - - Gets or sets the password of the sender's email account. - The sender's password. - - - Sends the specified message to an SMTP server for delivery. - The email address of the recipient or recipients. Separate multiple recipients using a semicolon (;). - The subject line for the email message. - The body of the email message. If is true, HTML in the body is interpreted as markup. - (Optional) The email address of the message sender, or null to not specify a sender. The default value is null. - (Optional) The email addresses of additional recipients to send a copy of the message to, or null if there are no additional recipients. Separate multiple recipients using a semicolon (;). The default value is null. - (Optional) A collection of file names that specifies the files to attach to the email message, or null if there are no files to attach. The default value is null. - (Optional) true to specify that the email message body is in HTML format; false to indicate that the body is in plain-text format. The default value is true. - (Optional) A collection of headers to add to the normal SMTP headers included in this email message, or null to send no additional headers. The default value is null. - (Optional) The email addresses of additional recipients to send a "blind" copy of the message to, or null if there are no additional recipients. Separate multiple recipients using a semicolon (;). The default value is null. - (Optional) The encoding to use for the body of the message. Possible values are property values for the class, such as . The default value is null. - (Optional) The encoding to use for the header of the message. Possible values are property values for the class, such as . The default value is null. - (Optional) A value ("Normal", "Low", "High") that specifies the priority of the message. The default is "Normal". - (Optional) The email address that will be used when the recipient replies to the message. The default value is null, which indicates that the reply address is the value of the From property. - - - Gets or sets the port that is used for SMTP transactions. - The port that is used for SMTP transactions. - - - Gets or sets the name of the SMTP server that is used to transmit the email message. - The SMTP server. - - - Gets or sets a value that indicates whether the default credentials are sent with the requests. - true if credentials are sent with the email message; otherwise, false. - - - Gets or sets the name of email account that is used to send email. - The name of the user account. - - - \ No newline at end of file diff --git a/lib/aspnetmvc/System.Web.Mvc.dll b/lib/aspnetmvc/System.Web.Mvc.dll deleted file mode 100644 index eb088f289b0..00000000000 Binary files a/lib/aspnetmvc/System.Web.Mvc.dll and /dev/null differ diff --git a/lib/aspnetmvc/System.Web.Mvc.xml b/lib/aspnetmvc/System.Web.Mvc.xml deleted file mode 100644 index b4b6df8a5e8..00000000000 --- a/lib/aspnetmvc/System.Web.Mvc.xml +++ /dev/null @@ -1,11485 +0,0 @@ - - - - System.Web.Mvc - - - - Represents an attribute that specifies which HTTP verbs an action method will respond to. - - - Initializes a new instance of the class by using a list of HTTP verbs that the action method will respond to. - The HTTP verbs that the action method will respond to. - The parameter is null or zero length. - - - Initializes a new instance of the class using the HTTP verbs that the action method will respond to. - The HTTP verbs that the action method will respond to. - - - Determines whether the specified method information is valid for the specified controller context. - true if the method information is valid; otherwise, false. - The controller context. - The method information. - The parameter is null. - - - Gets or sets the list of HTTP verbs that the action method will respond to. - The list of HTTP verbs that the action method will respond to. - - - Provides information about an action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - - - Gets the name of the action method. - The name of the action method. - - - Gets the controller descriptor. - The controller descriptor. - - - Executes the action method by using the specified parameters and controller context. - The result of executing the action method. - The controller context. - The parameters of the action method. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes of the specified type exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - The parameter is null. - - - Gets the filter attributes. - The filter attributes. - true to use the cache, otherwise false. - - - Returns the filters that are associated with this action method. - The filters that are associated with this action method. - - - Returns the parameters of the action method. - The parameters of the action method. - - - Returns the action-method selectors. - The action-method selectors. - - - Determines whether one or more instances of the specified attribute type are defined for this member. - true if is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The parameter is null. - - - Gets the unique ID for the action descriptor using lazy initialization. - The unique ID. - - - Provides the context for the ActionExecuted method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The controller context. - The action method descriptor. - true if the action is canceled. - The exception object. - The parameter is null. - - - Gets or sets the action descriptor. - The action descriptor. - - - Gets or sets a value that indicates that this object is canceled. - true if the context canceled; otherwise, false. - - - Gets or sets the exception that occurred during the execution of the action method, if any. - The exception that occurred during the execution of the action method. - - - Gets or sets a value that indicates whether the exception is handled. - true if the exception is handled; otherwise, false. - - - Gets or sets the result returned by the action method. - The result returned by the action method. - - - Provides the context for the ActionExecuting method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified controller context, action descriptor, and action-method parameters. - The controller context. - The action descriptor. - The action-method parameters. - The or parameter is null. - - - Gets or sets the action descriptor. - The action descriptor. - - - Gets or sets the action-method parameters. - The action-method parameters. - - - Gets or sets the result that is returned by the action method. - The result that is returned by the action method. - - - Represents the base class for filter attributes. - - - Initializes a new instance of the class. - - - Called by the ASP.NET MVC framework after the action method executes. - The filter context. - - - Called by the ASP.NET MVC framework before the action method executes. - The filter context. - - - Called by the ASP.NET MVC framework after the action result executes. - The filter context. - - - Called by the ASP.NET MVC framework before the action result executes. - The filter context. - - - Represents an attribute that is used to influence the selection of an action method. - - - Initializes a new instance of the class. - - - Determines whether the action method selection is valid for the specified controller context. - true if the action method selection is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Represents an attribute that is used for the name of an action. - - - Initializes a new instance of the class. - Name of the action. - The parameter is null or empty. - - - Determines whether the action name is valid within the specified controller context. - true if the action name is valid within the specified controller context; otherwise, false. - The controller context. - The name of the action. - Information about the action method. - - - Gets or sets the name of the action. - The name of the action. - - - Represents an attribute that affects the selection of an action method. - - - Initializes a new instance of the class. - - - Determines whether the action name is valid in the specified controller context. - true if the action name is valid in the specified controller context; otherwise, false. - The controller context. - The name of the action. - Information about the action method. - - - Represents the result of an action method. - - - Initializes a new instance of the class. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - - - Represents a delegate that contains the logic for selecting an action method. - - - Provides a class that implements the interface in order to support additional metadata. - - - Initializes a new instance of the class. - The name of the model metadata. - The value of the model metadata. - - - Gets the name of the additional metadata attribute. - The name of the of the additional metadata attribute. - - - Provides metadata to the model metadata creation process. - The meta data. - - - Gets the type of the of the additional metadata attribute. - The type of the of the additional metadata attribute. - - - Gets the value of the of the additional metadata attribute. - The value of the of the additional metadata attribute. - - - Represents support for rendering HTML in AJAX scenarios within a view. - - - Initializes a new instance of the class using the specified view context and view data container. - The view context. - The view data container. - One or both of the parameters is null. - - - Initializes a new instance of the class by using the specified view context, view data container, and route collection. - The view context. - The view data container. - The URL route collection. - One or more of the parameters is null. - - - Gets or sets the root path for the location to use for globalization script files. - The location of the folder where globalization script files are stored. The default location is "~/Scripts/Globalization". - - - Serializes the specified message and returns the resulting JSON-formatted string. - The serialized message as a JSON-formatted string. - The message to serialize. - - - Gets the collection of URL routes for the application. - The collection of routes for the application. - - - Gets the ViewBag. - The ViewBag. - - - Gets the context information about the view. - The context of the view. - - - Gets the current view data dictionary. - The view data dictionary. - - - Gets the view data container. - The view data container. - - - Represents support for rendering HTML in AJAX scenarios within a strongly typed view. - The type of the model. - - - Initializes a new instance of the class by using the specified view context and view data container. - The view context. - The view data container. - - - Initializes a new instance of the class by using the specified view context, view data container, and URL route collection. - The view context. - The view data container. - The URL route collection. - - - Gets the ViewBag. - The ViewBag. - - - Gets the strongly typed version of the view data dictionary. - The strongly typed data dictionary of the view. - - - Represents a class that extends the class by adding the ability to determine whether an HTTP request is an AJAX request. - - - Determines whether the specified HTTP request is an AJAX request. - true if the specified HTTP request is an AJAX request; otherwise, false. - The HTTP request. - The parameter is null (Nothing in Visual Basic). - - - Represents an attribute that marks controllers and actions to skip the during authorization. - - - Initializes a new instance of the class. - - - Allows a request to include HTML markup during model binding by skipping request validation for the property. (It is strongly recommended that your application explicitly check all models where you disable request validation in order to prevent script exploits.) - - - Initializes a new instance of the class. - - - This method supports the ASP.NET MVC validation infrastructure and is not intended to be used directly from your code. - The model metadata. - - - Controls interpretation of a controller name when constructing a . - - - Find the controller in the current area. - - - Find the controller in the root area. - - - Provides a way to register one or more areas in an ASP.NET MVC application. - - - Initializes a new instance of the class. - - - Gets the name of the area to register. - The name of the area to register. - - - Registers all areas in an ASP.NET MVC application. - - - Registers all areas in an ASP.NET MVC application by using the specified user-defined information. - An object that contains user-defined information to pass to the area. - - - Registers an area in an ASP.NET MVC application using the specified area's context information. - Encapsulates the information that is required in order to register the area. - - - Encapsulates the information that is required in order to register an area within an ASP.NET MVC application. - - - Initializes a new instance of the class using the specified area name and routes collection. - The name of the area to register. - The collection of routes for the application. - - - Initializes a new instance of the class using the specified area name, routes collection, and user-defined data. - The name of the area to register. - The collection of routes for the application. - An object that contains user-defined information to pass to the area. - - - Gets the name of the area to register. - The name of the area to register. - - - Maps the specified URL route and associates it with the area that is specified by the property. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values and constraint. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify valid values for a URL parameter. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values, constraints, and namespaces. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify valid values for a URL parameter. - An enumerable set of namespaces for the application. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values and namespaces. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - An enumerable set of namespaces for the application. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified namespaces. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An enumerable set of namespaces for the application. - The parameter is null. - - - Gets the namespaces for the application. - An enumerable set of namespaces for the application. - - - Gets a collection of defined routes for the application. - A collection of defined routes for the application. - - - Gets an object that contains user-defined information to pass to the area. - An object that contains user-defined information to pass to the area. - - - Provides an abstract class to implement a metadata provider. - - - Called from constructors in a derived class to initialize the class. - - - When overridden in a derived class, creates the model metadata for the property. - The model metadata for the property. - The set of attributes. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - - - Gets a list of attributes. - A list of attributes. - The type of the container. - The property descriptor. - The attribute container. - - - Returns a list of properties for the model. - A list of properties for the model. - The model container. - The type of the container. - - - Returns the metadata for the specified property using the container type and property descriptor. - The metadata for the specified property using the container type and property descriptor. - The model accessor. - The type of the container. - The property descriptor - - - Returns the metadata for the specified property using the container type and property name. - The metadata for the specified property using the container type and property name. - The model accessor. - The type of the container. - The name of the property. - - - Returns the metadata for the specified property using the type of the model. - The metadata for the specified property using the type of the model. - The model accessor. - The type of the model. - - - Returns the type descriptor from the specified type. - The type descriptor. - The type. - - - Provides an abstract class for classes that implement a validation provider. - - - Called from constructors in derived classes to initialize the class. - - - Gets a type descriptor for the specified type. - A type descriptor for the specified type. - The type of the validation provider. - - - Gets the validators for the model using the metadata and controller context. - The validators for the model. - The metadata. - The controller context. - - - Gets the validators for the model using the metadata, the controller context, and a list of attributes. - The validators for the model. - The metadata. - The controller context. - The list of attributes. - - - Provided for backward compatibility with ASP.NET MVC 3. - - - Initializes a new instance of the class. - - - Represents an attribute that is used to set the timeout value, in milliseconds, for an asynchronous method. - - - Initializes a new instance of the class. - The timeout value, in milliseconds. - - - Gets the timeout duration, in milliseconds. - The timeout duration, in milliseconds. - - - Called by ASP.NET before the asynchronous action method executes. - The filter context. - - - Encapsulates the information that is required for using an attribute. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified controller context. - The context within which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - - - Initializes a new instance of the class using the specified controller context and action descriptor. - The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - An object that provides information about an action method, such as its name, controller, parameters, attributes, and filters. - - - Provides information about the action method that is marked by the attribute, such as its name, controller, parameters, attributes, and filters. - The action descriptor for the action method that is marked by the attribute. - - - Gets or sets the result that is returned by an action method. - The result that is returned by an action method. - - - Specifies that access to a controller or action method is restricted to users who meet the authorization requirement. - - - Initializes a new instance of the class. - - - When overridden, provides an entry point for custom authorization checks. - true if the user is authorized; otherwise, false. - The HTTP context, which encapsulates all HTTP-specific information about an individual HTTP request. - The parameter is null. - - - Processes HTTP requests that fail authorization. - Encapsulates the information for using . The object contains the controller, HTTP context, request context, action result, and route data. - - - Called when a process requests authorization. - The filter context, which encapsulates information for using . - The parameter is null. - - - Called when the caching module requests authorization. - A reference to the validation status. - The HTTP context, which encapsulates all HTTP-specific information about an individual HTTP request. - The parameter is null. - - - Gets or sets the user roles that are authorized to access the controller or action method. - The user roles that are authorized to access the controller or action method. - - - Gets the unique identifier for this attribute. - The unique identifier for this attribute. - - - Gets or sets the users that are authorized to access the controller or action method. - The users that are authorized to access the controller or action method. - - - Represents an attribute that is used to provide details about how model binding to a parameter should occur. - - - Initializes a new instance of the class. - - - Gets or sets a comma-delimited list of property names for which binding is not allowed. - The exclude list. - - - Gets or sets a comma-delimited list of property names for which binding is allowed. - The include list. - - - Determines whether the specified property is allowed. - true if the specified property is allowed; otherwise, false. - The name of the property. - - - Gets or sets the prefix to use when markup is rendered for binding to an action argument or to a model property. - The prefix to use. - - - Represents the base class for views that are compiled by the BuildManager class before being rendered by a view engine. - - - Initializes a new instance of the class using the specified controller context and view path. - The controller context. - The view path. - - - Initializes a new instance of the class using the specified controller context, view path, and view page activator. - Context information for the current controller. This information includes the HTTP context, request context, route data, parent action view context, and more. - The path to the view that will be rendered. - The object responsible for dynamically constructing the view page at run time. - The parameter is null. - The parameter is null or empty. - - - Renders the specified view context by using the specified the writer object. - Information related to rendering a view, such as view data, temporary data, and form context. - The writer object. - The parameter is null. - An instance of the view type could not be created. - - - When overridden in a derived class, renders the specified view context by using the specified writer object and object instance. - Information related to rendering a view, such as view data, temporary data, and form context. - The writer object. - An object that contains additional information that can be used in the view. - - - Gets or sets the view path. - The view path. - - - Provides a base class for view engines. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified view page activator. - The view page activator. - - - Gets a value that indicates whether a file exists in the specified virtual file system (path). - true if the file exists in the virtual file system; otherwise, false. - The controller context. - The virtual path. - - - - Gets the view page activator. - The view page activator. - - - Maps a browser request to a byte array. - - - Initializes a new instance of the class. - - - Binds the model by using the specified controller context and binding context. - The bound data object.Implements - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The parameter is null. - - - Provides an abstract class to implement a cached metadata provider. - - - - Initializes a new instance of the class. - - - Gets the cache item policy. - The cache item policy. - - - Gets the cache key prefix. - The cache key prefix. - - - When overridden in a derived class, creates the cached model metadata for the property. - The cached model metadata for the property. - The attributes. - The container type. - The model accessor. - The model type. - The property name. - - - Creates prototype metadata by applying the prototype and model access to yield the final metadata. - The prototype metadata. - The prototype. - The model accessor. - - - Creates a metadata prototype. - A metadata prototype. - The attributes. - The container type. - The model type. - The property name. - - - Gets the metadata for the properties. - The metadata for the properties. - The container. - The container type. - - - Returns the metadata for the specified property. - The metadata for the specified property. - The model accessor. - The container type. - The property descriptor. - - - Returns the metadata for the specified property. - The metadata for the specified property. - The model accessor. - The container type. - The property name. - - - Returns the cached metadata for the specified property using the type of the model. - The cached metadata for the specified property using the type of the model. - The model accessor. - The type of the container. - - - Gets the prototype cache. - The prototype cache. - - - Provides a container to cache attributes. - - - Initializes a new instance of the class. - The attributes. - - - Gets the data type. - The data type. - - - Gets the display. - The display. - - - Gets the display column. - The display column. - - - Gets the display format. - The display format. - - - Gets the display name. - The display name. - - - Indicates whether a data field is editable. - true if the field is editable; otherwise, false. - - - Gets the hidden input. - The hidden input. - - - Indicates whether a data field is read only. - true if the field is read only; otherwise, false. - - - Indicates whether a data field is required. - true if the field is required; otherwise, false. - - - Indicates whether a data field is scaffold. - true if the field is scaffold; otherwise, false. - - - Gets the UI hint. - The UI hint. - - - Provides a container to cache . - - - Initializes a new instance of the class using the prototype and model accessor. - The prototype. - The model accessor. - - - Initializes a new instance of the class using the provider, container type, model type, property name and attributes. - The provider. - The container type. - The model type. - The property name. - The attributes. - - - Gets a value that indicates whether empty strings that are posted back in forms should be converted to Nothing.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that indicates whether empty strings that are posted back in forms should be converted to Nothing. - - - Gets meta information about the data type.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - Meta information about the data type. - - - Gets the description of the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - The description of the model. - - - Gets the display format string for the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - The display format string for the model. - - - Gets the display name of the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - The display name of the model. - - - Gets the edit format string of the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - The edit format string of the model. - - - Gets a value that indicates whether the model uses a non-default edit format. - A value that indicates whether non-default edit format is used. - - - Gets a value that indicates whether the model object should be rendered using associated HTML elements.Gets a value that indicates whether the model object should be rendered using associated HTML elements.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that indicates whether the model object should be rendered using associated HTML elements. - - - Gets a value that indicates whether the model is read-only.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that indicates whether the model is read-only. - - - Gets a value that indicates whether the model is required.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that indicates whether the model is required. - - - Gets the string to display for null values.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - The string to display for null values. - - - Gets a value that represents order of the current metadata.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that represents order of the current metadata. - - - Gets a short display name.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A short display name. - - - Gets a value that indicates whether the property should be displayed in read-only views such as list and detail views.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that indicates whether the property should be displayed in read-only views such as list and detail views. - - - Gets or sets a value that indicates whether the model should be displayed in editable views.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - Returns . - - - Gets the simple display string for the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - The simple display string for the model. - - - Gets a hint that suggests what template to use for this model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A hint that suggests what template to use for this model. - - - Gets a value that can be used as a watermark.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that can be used as a watermark. - - - Implements the default cached model metadata provider for ASP.NET MVC. - - - Initializes a new instance of the class. - - - Returns a container of real instances of the cached metadata class based on prototype and model accessor. - A container of real instances of the cached metadata class. - The prototype. - The model accessor. - - - Returns a container prototype instances of the metadata class. - a container prototype instances of the metadata class. - The attributes type. - The container type. - The model type. - The property name. - - - Provides a container for cached metadata. - he type of the container. - - - Constructor for creating real instances of the metadata class based on a prototype. - The provider. - The container type. - The model type. - The property name. - The prototype. - - - Constructor for creating the prototype instances of the metadata class. - The prototype. - The model accessor. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether empty strings that are posted back in forms should be converted to null. - A cached value that indicates whether empty strings that are posted back in forms should be converted to null. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets meta information about the data type. - Meta information about the data type. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the description of the model. - The description of the model. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the display format string for the model. - The display format string for the model. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the display name of the model. - The display name of the model. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the edit format string of the model. - The edit format string of the model. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as . - A value that indicates whether a non-default edit format is used. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the model object should be rendered using associated HTML elements. - A cached value that indicates whether the model object should be rendered using associated HTML elements. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the model is read-only. - A cached value that indicates whether the model is read-only. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the model is required. - A cached value that indicates whether the model is required. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the cached string to display for null values. - The cached string to display for null values. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that represents order of the current metadata. - A cached value that represents order of the current metadata. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a short display name. - A short display name. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the property should be displayed in read-only views such as list and detail views. - A cached value that indicates whether the property should be displayed in read-only views such as list and detail views. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the model should be displayed in editable views. - A cached value that indicates whether the model should be displayed in editable views. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the cached simple display string for the model. - The cached simple display string for the model. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached hint that suggests what template to use for this model. - A cached hint that suggests what template to use for this model. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that can be used as a watermark. - A cached value that can be used as a watermark. - - - Gets or sets a cached value that indicates whether empty strings that are posted back in forms should be converted to null. - A cached value that indicates whether empty strings that are posted back in forms should be converted to null. - - - Gets or sets meta information about the data type. - The meta information about the data type. - - - Gets or sets the description of the model. - The description of the model. - - - Gets or sets the display format string for the model. - The display format string for the model. - - - Gets or sets the display name of the model. - The display name of the model. - - - Gets or sets the edit format string of the model. - The edit format string of the model. - - - Gets or sets the simple display string for the model. - The simple display string for the model. - - - Gets or sets a value that indicates whether the model object should be rendered using associated HTML elements. - A value that indicates whether the model object should be rendered using associated HTML elements. - - - Gets or sets a value that indicates whether the model is read-only. - A value that indicates whether the model is read-only. - - - Gets or sets a value that indicates whether the model is required. - A value that indicates whether the model is required. - - - Gets or sets the string to display for null values. - The string to display for null values. - - - Gets or sets a value that represents order of the current metadata. - The order value of the current metadata. - - - Gets or sets the prototype cache. - The prototype cache. - - - Gets or sets a short display name. - The short display name. - - - Gets or sets a value that indicates whether the property should be displayed in read-only views such as list and detail views. - true if the model should be displayed in read-only views; otherwise, false. - - - Gets or sets a value that indicates whether the model should be displayed in editable views. - true if the model should be displayed in editable views; otherwise, false. - - - Gets or sets the simple display string for the model. - The simple display string for the model. - - - Gets or sets a hint that suggests what template to use for this model. - A hint that suggests what template to use for this model. - - - Gets or sets a value that can be used as a watermark. - A value that can be used as a watermark. - - - Provides a mechanism to propagates notification that model binder operations should be canceled. - - - Initializes a new instance of the class. - - - Returns the default cancellation token. - The default cancellation token.Implements - The controller context. - The binding context. - - - Represents an attribute that is used to indicate that an action method should be called only as a child action. - - - Initializes a new instance of the class. - - - Called when authorization is required. - An object that encapsulates the information that is required in order to authorize access to the child action. - - - Represents a value provider for values from child actions. - - - Initializes a new instance of the class. - The controller context. - - - Retrieves a value object using the specified key. - The value object for the specified key. - The key. - - - Represents a factory for creating value provider objects for child actions. - - - Initializes a new instance of the class. - - - Returns a object for the specified controller context. - A object. - The controller context. - - - Returns the client data-type model validators. - - - Initializes a new instance of the class. - - - Returns the client data-type model validators. - The client data-type model validators. - The metadata. - The context. - - - Gets the resource class key. - The resource class key. - - - Provides an attribute that compares two properties of a model. - - - Initializes a new instance of the class. - The property to compare with the current property. - - - Applies formatting to an error message based on the data field where the compare error occurred. - The formatted error message. - The name of the field that caused the validation failure. - - - Formats the property for client validation by prepending an asterisk (*) and a dot. - The string "*." is prepended to the property. - The property. - - - Gets a list of compare-value client validation rules for the property using the specified model metadata and controller context. - A list of compare-value client validation rules. - The model metadata. - The controller context. - - - Determines whether the specified object is equal to the compared object. - null if the value of the compared property is equal to the value parameter; otherwise, a validation result that contains the error message that indicates that the comparison failed. - The value of the object to compare. - The validation context. - - - Gets the property to compare with the current property. - The property to compare with the current property. - - - Gets the other properties display name. - The other properties display name. - - - Represents a user-defined content type that is the result of an action method. - - - Initializes a new instance of the class. - - - Gets or sets the content. - The content. - - - Gets or sets the content encoding. - The content encoding. - - - Gets or sets the type of the content. - The type of the content. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Provides methods that respond to HTTP requests that are made to an ASP.NET MVC Web site. - - - Initializes a new instance of the class. - - - Gets the action invoker for the controller. - The action invoker. - - - Provides asynchronous operations. - Returns . - - - Begins execution of the specified request context - Returns an IAsyncController instance. - The request context. - The asynchronous callback. - The state. - - - Begins to invoke the action in the current controller context. - Returns an IAsyncController instance. - The callback. - The state. - - - Gets or sets the binder. - The binder. - - - Creates a content result object by using a string. - The content result instance. - The content to write to the response. - - - Creates a content result object by using a string and the content type. - The content result instance. - The content to write to the response. - The content type (MIME type). - - - Creates a content result object by using a string, the content type, and content encoding. - The content result instance. - The content to write to the response. - The content type (MIME type). - The content encoding. - - - Creates an action invoker. - An action invoker. - - - Creates a temporary data provider. - A temporary data provider. - - - Gets whether to disable the asynchronous support for the controller. - true to disable the asynchronous support for the controller; otherwise, false. - - - Releases all resources that are used by the current instance of the class. - - - Releases unmanaged resources and optionally releases managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Ends the invocation of the action in the current controller context. - The asynchronous result. - - - Ends the execute core. - The asynchronous result. - - - Invokes the action in the current controller context. - - - Creates a FileContentResult object by using the file contents and file type. - The file-content result object. - The binary content to send to the response. - The content type (MIME type). - - - Creates a FileContentResult object by using the file contents, content type, and the destination file name. - The file-content result object. - The binary content to send to the response. - The content type (MIME type). - The file name to use in the file-download dialog box that is displayed in the browser. - - - Creates a FileStreamResult object by using the Stream object and content type. - The file-content result object. - The stream to send to the response. - The content type (MIME type). - - - Creates a FileStreamResult object using the Stream object, the content type, and the target file name. - The file-stream result object. - The stream to send to the response. - The content type (MIME type) - The file name to use in the file-download dialog box that is displayed in the browser. - - - Creates a FilePathResult object by using the file name and the content type. - The file-stream result object. - The path of the file to send to the response. - The content type (MIME type). - - - Creates a FilePathResult object by using the file name, the content type, and the file download name. - The file-stream result object. - The path of the file to send to the response. - The content type (MIME type). - The file name to use in the file-download dialog box that is displayed in the browser. - - - Called when a request matches this controller, but no method with the specified action name is found in the controller. - The name of the attempted action. - - - Gets HTTP-specific information about an individual HTTP request. - The HTTP context. - - - Returns an instance of the class. - An instance of the class. - - - Returns an instance of the class. - An instance of the class. - The status description. - - - Initializes data that might not be available when the constructor is called. - The HTTP context and route data. - - - Creates a object. - The object that writes the script to the response. - The JavaScript code to run on the client - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON). - The JSON result object that serializes the specified object to JSON format. The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed. - The JavaScript object graph to serialize. - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format. - The JSON result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format. - The JSON result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - The content encoding. - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the content type, content encoding, and the JSON request behavior. - The result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - The content encoding. - The JSON request behavior - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified content type and JSON request behavior. - The result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - The JSON request behavior - - - Creates a JsonResult object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified JSON request behavior. - The result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The JSON request behavior. - - - Gets the model state dictionary object that contains the state of the model and of model-binding validation. - The model state dictionary. - - - Called after the action method is invoked. - Information about the current request and action. - - - Called before the action method is invoked. - Information about the current request and action. - - - Called when authorization occurs. - Information about the current request and action. - - - Called when authorization challenge occurs. - Information about the current request and action. - - - Called when authorization occurs. - Information about the current request and action. - - - Called when an unhandled exception occurs in the action. - Information about the current request and action. - - - Called after the action result that is returned by an action method is executed. - Information about the current request and action result. - - - Called before the action result that is returned by an action method is executed. - Information about the current request and action result. - - - Creates a object that renders a partial view. - A partial-view result object. - - - Creates a object that renders a partial view, by using the specified model. - A partial-view result object. - The model that is rendered by the partial view - - - Creates a object that renders a partial view, by using the specified view name. - A partial-view result object. - The name of the view that is rendered to the response. - - - Creates a object that renders a partial view, by using the specified view name and model. - A partial-view result object. - The name of the view that is rendered to the response. - The model that is rendered by the partial view - - - Gets the HTTP context profile. - The HTTP context profile. - - - Creates a object that redirects to the specified URL. - The redirect result object. - The URL to redirect to. - - - Returns an instance of the class with the Permanent property set to true. - An instance of the class with the Permanent property set to true. - The URL to redirect to. - - - Redirects to the specified action using the action name. - The redirect result object. - The name of the action. - - - Redirects to the specified action using the action name and route values. - The redirect result object. - The name of the action. - The parameters for a route. - - - Redirects to the specified action using the action name and controller name. - The redirect result object. - The name of the action. - The name of the controller. - - - Redirects to the specified action using the action name, controller name, and route dictionary. - The redirect result object. - The name of the action. - The name of the controller. - The parameters for a route. - - - Redirects to the specified action using the action name, controller name, and route values. - The redirect result object. - The name of the action. - The name of the controller. - The parameters for a route. - - - Redirects to the specified action using the action name and route dictionary. - The redirect result object. - The name of the action. - The parameters for a route. - - - Returns an instance of the class with the Permanent property set to true using the specified action name. - An instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. - The action name. - - - Returns an instance of the class with the Permanent property set to true using the specified action name, and route values. - An instance of the class with the Permanent property set to true using the specified action name, and route values. - The action name. - The route values. - - - Returns an instance of the class with the Permanent property set to true using the specified action name, and controller name. - An instance of the class with the Permanent property set to true using the specified action name, and controller name. - The action name. - The controller name. - - - Returns an instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. - An instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. - The action name. - The controller name. - The route values. - - - Returns an instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. - An instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. - The action name. - The controller name. - The route values. - - - Returns an instance of the class with the Permanent property set to true using the specified action name, and route values. - An instance of the class with the Permanent property set to true using the specified action name, and route values. - The action name. - The route values. - - - Redirects to the specified route using the specified route values. - The redirect-to-route result object. - The parameters for a route. - - - Redirects to the specified route using the route name. - The redirect-to-route result object. - The name of the route. - - - Redirects to the specified route using the route name and route values. - The redirect-to-route result object. - The name of the route. - The parameters for a route. - - - Redirects to the specified route using the route name and route dictionary. - The redirect-to-route result object. - The name of the route. - The parameters for a route. - - - Redirects to the specified route using the route dictionary. - The redirect-to-route result object. - The parameters for a route. - - - Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route values. - Returns an instance of the RedirectResult class with the Permanent property set to true. - The route name. - - - Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route name. - Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route name. - The route name. - - - Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route name and route values. - An instance of the RedirectResult class with the Permanent property set to true using the specified route name and route values. - The route name. - The route values. - - - Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route name and route values. - An instance of the RedirectResult class with the Permanent property set to true. - The route name. - The route values. - - - Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route values. - An instance of the RedirectResult class with the Permanent property set to true using the specified route values. - The route values. - - - Gets the HttpRequestBase object for the current HTTP request. - The request object. - - - Represents a replaceable dependency resolver providing services. By default, it uses the . - - - Gets the HttpResponseBase object for the current HTTP response. - The HttpResponseBase object for the current HTTP response. - - - Gets the route data for the current request. - The route data. - - - Gets the HttpServerUtilityBase object that provides methods that are used during Web request processing. - The HTTP server object. - - - Gets the HttpSessionStateBase object for the current HTTP request. - The HTTP session-state object for the current HTTP request. - - - This method calls the BeginExecute method. - The result of the operation. - The request context. - The asynchronous callback. - The state of the object. - - - This method calls the EndExecute method. - The asynchronous result of the operation. - - - This method calls the OnAuthentication method. - The filter context. - - - This method calls the OnAuthenticationChallenge method. - The filter context. - - - This method calls the OnActionExecuted method. - The filter context. - - - This method calls the OnActionExecuting method. - The filter context. - - - This method calls the OnAuthorization method. - The filter context. - - - This method calls the OnException method. - The filter context. - - - This method calls the OnResultExecuted method. - The filter context. - - - This method calls the OnResultExecuting method. - The filter context. - - - Gets the temporary-data provider object that is used to store data for the next request. - The temporary-data provider. - - - Updates the specified model instance using values from the controller's current value provider. - true if the update is successful; otherwise, false. - The model instance to update. - The type of the model object. - The parameter or the ValueProvider property is null. - - - Updates the specified model instance using values from the controller's current value provider and a prefix. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - The type of the model object. - The parameter or the ValueProvider property is null. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - The type of the model object. - The parameter or the ValueProvider property is null. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties parameter list. - The type of the model object. - The parameter or the ValueProvider property is null. - - - Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude , and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties parameter list. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and included properties. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider and included properties. - true if the update is successful; otherwise, false. - The model instance to update. - A list of properties of the model to update. - The type of the model object. - - - Updates the specified model instance using values from the value provider and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider. - true if the update is successful; otherwise, false. - The model instance to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Validates the specified model instance. - true if the model validation is successful; otherwise, false. - The model to validate. - - - Validates the specified model instance using an HTML prefix. - true if the model validation is successful; otherwise, false. - The model to validate. - The prefix to use when looking up values in the model provider. - - - Updates the specified model instance using values from the controller's current value provider. - The model instance to update. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider and a prefix. - The model instance to update. - A prefix to use when looking up values in the value provider. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties. - The model instance to update. - A prefix to use when looking up values in the value provider. - A list of properties of the model to update. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include. - The model instance to update. - A prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties list. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude, and a list of properties to include. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties parameter list. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. - The model instance to update. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the controller object's current value provider. - The model instance to update. - A list of properties of the model to update. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. - The model instance to update. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider. - The model instance to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Gets the URL helper object that is used to generate URLs by using routing. - The URL helper object. - - - Gets the user security information for the current HTTP request. - The user security information for the current HTTP request. - - - Validates the specified model instance. - The model to validate. - - - Validates the specified model instance using an HTML prefix. - The model to validate. - The prefix to use when looking up values in the model provider. - - - Creates a object that renders a view to the response. - The result that renders a view to the response. - - - Creates a object by using the model that renders a view to the response. - The view result. - The model that is rendered by the view. - - - Creates a object by using the view name that renders a view. - The view result. - The name of the view that is rendered to the response. - - - Creates a object that renders the specified IView object. - The view result. - The view that is rendered to the response. - The model that is rendered by the view. - - - Creates a object using the view name and master-page name that renders a view to the response. - The view result. - The name of the view that is rendered to the response. - The name of the master page or template to use when the view is rendered. - - - Creates a object using the view name, master-page name, and model that renders a view. - The view result. - The name of the view that is rendered to the response. - The name of the master page or template to use when the view is rendered. - The model that is rendered by the view. - - - Creates a object that renders the specified IView object. - The view result. - The view that is rendered to the response. - - - Creates a object that renders the specified object. - The view result. - The view that is rendered to the response. - The model that is rendered by the view. - - - Gets the view engine collection. - The view engine collection. - - - Represents a class that is responsible for invoking the action methods of a controller. - - - Initializes a new instance of the class. - - - Gets or sets the model binders that are associated with the action. - The model binders that are associated with the action. - - - Creates the action result. - The action result object. - The controller context. - The action descriptor. - The action return value. - - - Finds the information about the action method. - Information about the action method. - The controller context. - The controller descriptor. - The name of the action. - - - Retrieves information about the controller by using the specified controller context. - Information about the controller. - The controller context. - - - Retrieves information about the action filters. - Information about the action filters. - The controller context. - The action descriptor. - - - Gets the value of the specified action-method parameter. - The value of the action-method parameter. - The controller context. - The parameter descriptor. - - - Gets the values of the action-method parameters. - The values of the action-method parameters. - The controller context. - The action descriptor. - - - Invokes the specified action by using the specified controller context. - The result of executing the action. - The controller context. - The name of the action to invoke. - The parameter is null. - The parameter is null or empty. - The thread was aborted during invocation of the action. - An unspecified error occurred during invocation of the action. - - - Invokes the specified action method by using the specified parameters and the controller context. - The result of executing the action method. - The controller context. - The action descriptor. - The parameters. - - - Invokes the specified action method by using the specified parameters, controller context, and action filters. - The context for the ActionExecuted method of the class. - The controller context. - The action filters. - The action descriptor. - The parameters. - - - Invokes the specified action result by using the specified controller context. - The controller context. - The action result. - - - Invokes the specified action result by using the specified action filters and the controller context. - The context for the ResultExecuted method of the class. - The controller context. - The action filters. - The action result. - - - - - Invokes the specified authorization filters by using the specified action descriptor and controller context. - The context for the object. - The controller context. - The authorization filters. - The action descriptor. - - - Invokes the specified exception filters by using the specified exception and controller context. - The context for the object. - The controller context. - The exception filters. - The exception. - - - Represents the base class for all MVC controllers. - - - Initializes a new instance of the class. - - - Gets or sets the controller context. - The controller context. - - - Executes the specified request context. - The request context. - The parameter is null. - - - Executes the request. - - - Initializes the specified request context. - The request context. - - - Executes the specified request context. - The request context. - - - Gets or sets the dictionary for temporary data. - The dictionary for temporary data. - - - Gets or sets a value that indicates whether request validation is enabled for this request. - true if request validation is enabled for this request; otherwise, false. The default is true. - - - Gets or sets the value provider for the controller. - The value provider for the controller. - - - Gets the dynamic view data dictionary. - The dynamic view data dictionary. - - - Gets or sets the dictionary for view data. - The dictionary for the view data. - - - Represents a class that is responsible for dynamically building a controller. - - - Initializes a new instance of the class. - - - Gets the current controller builder object. - The current controller builder. - - - Gets the default namespaces. - The default namespaces. - - - Gets the associated controller factory. - The controller factory. - - - Sets the controller factory by using the specified type. - The type of the controller factory. - The parameter is null. - The controller factory cannot be assigned from the type in the parameter. - An error occurred while the controller factory was being set. - - - Sets the specified controller factory. - The controller factory. - The parameter is null. - - - Encapsulates information about an HTTP request that matches specified and instances. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified HTTP context, URL route data, and controller. - The HTTP context. - The route data. - The controller. - - - Initializes a new instance of the class by using the specified controller context. - The controller context. - The parameter is null. - - - Initializes a new instance of the class by using the specified request context and controller. - The request context. - The controller. - One or both parameters are null. - - - Gets or sets the controller. - The controller. - - - Gets the display mode. - The display mode. - - - Gets or sets the HTTP context. - The HTTP context. - - - Gets a value that indicates whether the associated action method is a child action. - true if the associated action method is a child action; otherwise, false. - - - Gets an object that contains the view context information for the parent action method. - An object that contains the view context information for the parent action method. - - - Gets or sets the request context. - The request context. - - - Gets or sets the URL route data. - The URL route data. - - - Encapsulates information that describes a controller, such as its name, type, and actions. - - - Initializes a new instance of the class. - - - Gets the name of the controller. - The name of the controller. - - - Gets the type of the controller. - The type of the controller. - - - Finds an action method by using the specified name and controller context. - The information about the action method. - The controller context. - The name of the action. - - - Retrieves a list of action-method descriptors in the controller. - A list of action-method descriptors in the controller. - - - Retrieves custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Retrieves custom attributes of a specified type that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - The parameter is null (Nothing in Visual Basic). - - - Gets the filter attributes. - The filter attributes. - true if the cache should be used; otherwise, false. - - - Retrieves a value that indicates whether one or more instance of the specified custom attribute are defined for this member. - true if the is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The parameter is null (Nothing in Visual Basic). - - - When implemented in a derived class, gets the unique ID for the controller descriptor using lazy initialization. - The unique ID. - - - Adds the controller to the instance. - - - Initializes a new instance of the class. - - - Returns the collection of controller instance filters. - The collection of controller instance filters. - The controller context. - The action descriptor. - - - Represents an attribute that invokes a custom model binder. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - A reference to an object that implements the interface. - - - Provides a container for common metadata, for the class, and for the class for a data model. - - - Initializes a new instance of the class. - The data-annotations model metadata provider. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - The display column attribute. - - - Returns simple text for the model data. - Simple text for the model data. - - - Implements the default model metadata provider for ASP.NET MVC. - - - Initializes a new instance of the class. - - - Gets the metadata for the specified property. - The metadata for the property. - The attributes. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - - - Represents the method that creates a instance. - - - Provides a model validator. - - - Initializes a new instance of the class. - The metadata for the model. - The controller context for the model. - The validation attribute for the model. - - - Gets the validation attribute for the model validator. - The validation attribute for the model validator. - - - Gets the error message for the validation failure. - The error message for the validation failure. - - - Retrieves a collection of client validation rules. - A collection of client validation rules. - - - Gets a value that indicates whether model validation is required. - true if model validation is required; otherwise, false. - - - Returns a list of validation error messages for the model. - A list of validation error messages for the model, or an empty list if no errors have occurred. - The container for the model. - - - Provides a model validator for a specified validation type. - - - - Initializes a new instance of the class. - The metadata for the model. - The controller context for the model. - The validation attribute for the model. - - - Gets the validation attribute from the model validator. - The validation attribute from the model validator. - - - Implements the default validation provider for ASP.NET MVC. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether non-nullable value types are required. - true if non-nullable value types are required; otherwise, false. - - - Gets a list of validators. - A list of validators. - The metadata. - The context. - The list of validation attributes. - - - Registers an adapter to provide client-side validation. - The type of the validation attribute. - The type of the adapter. - - - Registers an adapter factory for the validation provider. - The type of the attribute. - The factory that will be used to create the object for the specified attribute. - - - Registers the default adapter. - The type of the adapter. - - - Registers the default adapter factory. - The factory that will be used to create the object for the default adapter. - - - Registers an adapter to provide default object validation. - The type of the adapter. - - - Registers an adapter factory for the default object validation provider. - The factory. - - - Registers an adapter to provide object validation. - The type of the model. - The type of the adapter. - - - Registers an adapter factory for the object validation provider. - The type of the model. - The factory. - - - Provides a factory for validators that are based on . - - - Provides a container for the error-information model validator. - - - Initializes a new instance of the class. - - - Gets a list of error-information model validators. - A list of error-information model validators. - The model metadata. - The controller context. - - - Represents the controller factory that is registered by default. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a controller activator. - An object that implements the controller activator interface. - - - Creates the specified controller by using the specified request context. - The controller. - The context of the HTTP request, which includes the HTTP context and route data. - The name of the controller. - The parameter is null. - The parameter is null or empty. - - - Retrieves the controller instance for the specified request context and controller type. - The controller instance. - The context of the HTTP request, which includes the HTTP context and route data. - The type of the controller. - - is null. - - cannot be assigned. - An instance of cannot be created. - - - Returns the controller's session behavior. - The controller's session behavior. - The request context. - The type of the controller. - - - Retrieves the controller type for the specified name and request context. - The controller type. - The context of the HTTP request, which includes the HTTP context and route data. - The name of the controller. - - - Releases the specified controller. - The controller to release. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The controller's session behavior. - The request context. - The controller name. - - - Maps a browser request to a data object. This class provides a concrete implementation of a model binder. - - - Initializes a new instance of the class. - - - Gets or sets the model binders for the application. - The model binders for the application. - - - Binds the model by using the specified controller context and binding context. - The bound object. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The parameter is null. - - - Binds the specified property by using the specified controller context and binding context and the specified property descriptor. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property to be bound. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - - - Creates the specified model type by using the specified controller context and binding context. - A data object of the specified type. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The type of the model object to return. - - - Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is an integer. - The name of the subindex. - The prefix for the subindex. - The index value. - - - Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is a string. - The name of the subindex. - The prefix for the subindex. - The index value. - - - Creates the name of the subproperty by using the specified prefix and property name. - The name of the subproperty. - The prefix for the subproperty. - The name of the property. - - - Returns a set of properties that match the property filter restrictions that are established by the specified . - An enumerable set of property descriptors. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Returns the properties of the model by using the specified controller context and binding context. - A collection of property descriptors. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Returns the value of a property using the specified controller context, binding context, property descriptor, and property binder. - An object that represents the property value. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The descriptor for the property to access. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - An object that provides a way to bind the property. - - - Returns the descriptor object for a type that is specified by its controller context and binding context. - A custom type descriptor object. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Determines whether a data model is valid for the specified binding context. - true if the model is valid; otherwise, false. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The parameter is null. - - - Called when the model is updated. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Called when the model is updating. - true if the model is updating; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Called when the specified property is validated. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property to be validated. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - The value to set for the property. - - - Called when the specified property is validating. - true if the property is validating; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property being validated. The descriptor provides information such as component type, property type, and property value. It also provides methods to get or set the property value. - The value to set for the property. - - - Gets or sets the name of the resource file (class key) that contains localized string values. - The name of the resource file (class key). - - - Sets the specified property by using the specified controller context, binding context, and property value. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property to be set. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - The value to set for the property. - - - Represents a memory cache for view locations. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified cache time span. - The cache time span. - The Ticks attribute of the parameter is set to a negative number. - - - Retrieves the default view location by using the specified HTTP context and cache key. - The default view location. - The HTTP context. - The cache key - The parameter is null. - - - Inserts the view in the specified virtual path by using the specified HTTP context, cache key, and virtual path. - The HTTP context. - The cache key. - The virtual path - The parameter is null. - - - Creates an empty view location cache. - - - Gets or sets the cache time span. - The cache time span. - - - Provides a registration point for dependency resolvers that implement or the Common Service Locator IServiceLocator interface. - - - Initializes a new instance of the class. - - - Gets the implementation of the dependency resolver. - The implementation of the dependency resolver. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - The implementation of the dependency resolver. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - The function that provides the service. - The function that provides the services. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - The common service locator. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - The object that implements the dependency resolver. - - - Provides a registration point for dependency resolvers using the specified service delegate and specified service collection delegates. - The service delegate. - The services delegates. - - - Provides a registration point for dependency resolvers using the provided common service locator when using a service locator interface. - The common service locator. - - - Provides a registration point for dependency resolvers, using the specified dependency resolver interface. - The dependency resolver. - - - Provides a type-safe implementation of and . - - - Resolves singly registered services that support arbitrary object creation. - The requested service or object. - The dependency resolver instance that this method extends. - The type of the requested service or object. - - - Resolves multiply registered services. - The requested services. - The dependency resolver instance that this method extends. - The type of the requested services. - - - Represents the base class for value providers whose values come from a collection that implements the interface. - The type of the value. - - - Initializes a new instance of the class. - The name/value pairs that are used to initialize the value provider. - Information about a specific culture, such as the names of the culture, the writing system, and the calendar used. - The parameter is null. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - The parameter is null. - - - Gets the keys from the prefix. - The keys from the prefix. - the prefix. - - - Returns a value object using the specified key and controller context. - The value object for the specified key. - The key of the value object to retrieve. - The parameter is null. - - - Provides an empty metadata provider for data models that do not require metadata. - - - Initializes a new instance of the class. - - - Creates a new instance of the class. - A new instance of the class. - The attributes. - The type of the container. - The model accessor. - The type of the model. - The name of the model. - - - Provides an empty validation provider for models that do not require a validator. - - - Initializes a new instance of the class. - - - Gets the empty model validator. - The empty model validator. - The metadata. - The context. - - - Represents a result that does nothing, such as a controller action method that returns nothing. - - - Initializes a new instance of the class. - - - Executes the specified result context. - The result context. - - - Provides the context for using the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class for the specified exception by using the specified controller context. - The controller context. - The exception. - The parameter is null. - - - Gets or sets the exception object. - The exception object. - - - Gets or sets a value that indicates whether the exception has been handled. - true if the exception has been handled; otherwise, false. - - - Gets or sets the action result. - The action result. - - - Provides a helper class to get the model name from an expression. - - - Gets the model name from a lambda expression. - The model name. - The expression. - - - Gets the model name from a string expression. - The model name. - The expression. - - - Provides a container for client-side field validation metadata. - - - Initializes a new instance of the class. - - - Gets or sets the name of the data field. - The name of the data field. - - - Gets or sets a value that indicates whether the validation message contents should be replaced with the client validation error. - true if the validation message contents should be replaced with the client validation error; otherwise, false. - - - Gets or sets the validator message ID. - The validator message ID. - - - Gets the client validation rules. - The client validation rules. - - - Sends the contents of a binary file to the response. - - - Initializes a new instance of the class by using the specified file contents and content type. - The byte array to send to the response. - The content type to use for the response. - The parameter is null. - - - The binary content to send to the response. - The file contents. - - - Writes the file content to the response. - The response. - - - Sends the contents of a file to the response. - - - Initializes a new instance of the class by using the specified file name and content type. - The name of the file to send to the response. - The content type of the response. - The parameter is null or empty. - - - Gets or sets the path of the file that is sent to the response. - The path of the file that is sent to the response. - - - Writes the file to the response. - The response. - - - Represents a base class that is used to send binary file content to the response. - - - Initializes a new instance of the class. - The type of the content. - The parameter is null or empty. - - - Gets the content type to use for the response. - The type of the content. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets the content-disposition header so that a file-download dialog box is displayed in the browser with the specified file name. - The name of the file. - - - Writes the file to the response. - The response. - - - Sends binary content to the response by using a instance. - - - Initializes a new instance of the class. - The stream to send to the response. - The content type to use for the response. - The parameter is null. - - - Gets the stream that will be sent to the response. - The file stream. - - - Writes the file to the response. - The response. - - - Represents a metadata class that contains a reference to the implementation of one or more of the filter interfaces, the filter's order, and the filter's scope. - - - Initializes a new instance of the class. - The instance. - The scope. - The order. - - - Represents a constant that is used to specify the default ordering of filters. - - - Gets the instance of this class. - The instance of this class. - - - Gets the order in which the filter is applied. - The order in which the filter is applied. - - - Gets the scope ordering of the filter. - The scope ordering of the filter. - - - Represents the base class for action and result filter attributes. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether more than one instance of the filter attribute can be specified. - true if more than one instance of the filter attribute can be specified; otherwise, false. - - - Gets or sets the order in which the action filters are executed. - The order in which the action filters are executed. - - - Defines a filter provider for filter attributes. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and optionally caches attribute instances. - true to cache attribute instances; otherwise, false. - - - Gets a collection of custom action attributes. - A collection of custom action attributes. - The controller context. - The action descriptor. - - - Gets a collection of controller attributes. - A collection of controller attributes. - The controller context. - The action descriptor. - - - Aggregates the filters from all of the filter providers into one collection. - The collection filters from all of the filter providers. - The controller context. - The action descriptor. - - - Encapsulates information about the available action filters. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified filters collection. - The filters collection. - - - Gets all the action filters in the application. - The action filters. - - - Gets all the authentication filters in the application. - The list of authentication filters. - - - Gets all the authorization filters in the application. - The authorization filters. - - - Gets all the exception filters in the application. - The exception filters. - - - Gets all the result filters in the application. - The result filters. - - - Represents the collection of filter providers for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with specified list of filter provider. - The list of filter providers. - - - Removes all elements from the collection. - - - Returns the collection of filter providers. - The collection of filter providers. - The controller context. - The action descriptor. - - - Inserts an element into the collection at the specified index. - The zero-based index at which item should be inserted. - The object to insert. The value can be null for reference types. - - - Removes the element at the specified index of the collection - The zero-based index of the element to remove. - - - Replaces the element at the specified index. - The zero-based index of the element to replace. - The new value for the element at the specified index. The value can be null for reference types. - - - Provides a registration point for filters. - - - Provides a registration point for filters. - The collection of filters. - - - Defines values that specify the order in which ASP.NET MVC filters run within the same filter type and filter order. - - - Specifies an order before and after . - - - Specifies an order before and after . - - - Specifies first. - - - Specifies an order before and after . - - - Specifies last. - - - Contains the form value providers for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The collection. - The parameter is null. - - - Gets the specified value provider. - The value provider. - The name of the value provider to get. - The parameter is null or empty. - - - Gets a value that indicates whether the value provider contains an entry that has the specified prefix. - true if the value provider contains an entry that has the specified prefix; otherwise, false. - The prefix to look for. - - - Gets a value from a value provider using the specified key. - A value from a value provider. - The key. - - - Returns a dictionary that contains the value providers. - A dictionary of value providers. - - - Encapsulates information that is required in order to validate and process the input data from an HTML form. - - - Initializes a new instance of the class. - - - Gets the field validators for the form. - A dictionary of field validators for the form. - - - Gets or sets the form identifier. - The form identifier. - - - Returns a serialized object that contains the form identifier and field-validation values for the form. - A serialized object that contains the form identifier and field-validation values for the form. - - - Returns the validation value for the specified input field. - The value to validate the field input with. - The name of the field to retrieve the validation value for. - The parameter is either null or empty. - - - Returns the validation value for the specified input field and a value that indicates what to do if the validation value is not found. - The value to validate the field input with. - The name of the field to retrieve the validation value for. - true to create a validation value if one is not found; otherwise, false. - The parameter is either null or empty. - - - Returns a value that indicates whether the specified field has been rendered in the form. - true if the field has been rendered; otherwise, false. - The field name. - - - Sets a value that indicates whether the specified field has been rendered in the form. - The field name. - true to specify that the field has been rendered in the form; otherwise, false. - - - Determines whether client validation errors should be dynamically added to the validation summary. - true if client validation errors should be added to the validation summary; otherwise, false. - - - Gets or sets the identifier for the validation summary. - The identifier for the validation summary. - - - Enumerates the HTTP request types for a form. - - - Specifies a GET request. - - - Specifies a POST request. - - - Represents a value provider for form values that are contained in a object. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - - - Represents a class that is responsible for creating a new instance of a form-value provider object. - - - Initializes a new instance of the class. - - - Returns a form-value provider object for the specified controller context. - A form-value provider object. - An object that encapsulates information about the current HTTP request. - The parameter is null. - - - Represents a class that contains all the global filters. - - - Initializes a new instance of the class. - - - Adds the specified filter to the global filter collection. - The filter. - - - Adds the specified filter to the global filter collection using the specified filter run order. - The filter. - The filter run order. - - - Removes all filters from the global filter collection. - - - Determines whether a filter is in the global filter collection. - true if is found in the global filter collection; otherwise, false. - The filter. - - - Gets the number of filters in the global filter collection. - The number of filters in the global filter collection. - - - Returns an enumerator that iterates through the global filter collection. - An enumerator that iterates through the global filter collection. - - - Removes all the filters that match the specified filter. - The filter to remove. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - An enumerator that iterates through the global filter collection. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - An enumerator that iterates through the global filter collection. - The controller context. - The action descriptor. - - - Represents the global filter collection. - - - Gets or sets the global filter collection. - The global filter collection. - - - Represents an attribute that is used to handle an exception that is thrown by an action method. - - - Initializes a new instance of the class. - - - Gets or sets the type of the exception. - The type of the exception. - - - Gets or sets the master view for displaying exception information. - The master view. - - - Called when an exception occurs. - The action-filter context. - The parameter is null. - - - Gets the unique identifier for this attribute. - The unique identifier for this attribute. - - - Gets or sets the page view for displaying exception information. - The page view. - - - Encapsulates information for handling an error that was thrown by an action method. - - - Initializes a new instance of the class. - The exception. - The name of the controller. - The name of the action. - The parameter is null. - The or parameter is null or empty. - - - Gets or sets the name of the action that was executing when the exception was thrown. - The name of the action. - - - Gets or sets the name of the controller that contains the action method that threw the exception. - The name of the controller. - - - Gets or sets the exception object. - The exception object. - - - Represents an attribute that is used to indicate whether a property or field value should be rendered as a hidden input element. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether to display the value of the hidden input element. - true if the value should be displayed; otherwise, false. - - - Enumerates the date rendering mode for HTML5. - - - The current culture formatting. - - - The RFC 3339 formatting. - - - Supports the rendering of HTML controls in a view. - - - Initializes a new instance of the class by using the specified view context and view data container. - The view context. - The view data container. - The or the viewDataContainer parameter is null. - - - Initializes a new instance of the class by using the specified view context, view data container, and route collection. - The view context. - The view data container. - The route collection. - One or more parameters is null. - - - Replaces underscore characters (_) with hyphens (-) in the specified HTML attributes. - The HTML attributes with underscore characters replaced by hyphens. - The HTML attributes. - - - Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. - The generated form field (anti-forgery token). - - - Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. The field value is generated using the specified salt value. - The generated form field (anti-forgery token). - The salt value, which can be any non-empty string. - - - Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. The field value is generated using the specified salt value, domain, and path. - The generated form field (anti-forgery token). - The salt value, which can be any non-empty string. - The application domain. - The virtual path. - - - Converts the specified attribute value to an HTML-encoded string. - The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string. - The object to encode. - - - Converts the specified attribute value to an HTML-encoded string. - The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string. - The string to encode. - - - Gets or sets a value that indicates whether client validation is enabled. - true if enable client validation is enabled; otherwise, false. - - - Enables input validation that is performed by using client script in the browser. - - - Enables or disables client validation. - true to enable client validation; otherwise, false. - - - Enables or disables unobtrusive JavaScript. - - - Enables or disables unobtrusive JavaScript. - true to enable unobtrusive JavaScript; otherwise, false. - - - Converts the value of the specified object to an HTML-encoded string. - The HTML-encoded string. - The object to encode. - - - Converts the specified string to an HTML-encoded string. - The HTML-encoded string. - The string to encode. - - - Formats the value. - The formatted value. - The value. - The format string. - - - Creates an HTML element ID using the specified element name. - The ID of the HTML element. - The name of the HTML element. - The name parameter is null. - - - Creates an HTML element ID using the specified element name and a string that replaces dots in the name. - The ID of the HTML element. - The name of the HTML element. - The string that replaces dots (.) in the name parameter. - The name parameter or the idAttributeDotReplacement parameter is null. - - - Generates an HTML anchor element (a element) that links to the specified action method, and enables the user to specify the communication protocol, name of the host, and a URL fragment. - An HTML element that links to the specified action method. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - The name of the action method. - The name of the controller. - The communication protocol, such as HTTP or HTTPS. If this parameter is null, the protocol defaults to HTTP. - The name of the host. - The fragment identifier. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Generates an HTML anchor element (a element) that links to the specified action method. - An HTML element that links to the specified action method. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Generates an HTML anchor element (a element) that links to the specified URL route, and enables the user to specify the communication protocol, name of the host, and a URL fragment. - An HTML element that links to the specified URL route. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - The communication protocol, such as HTTP or HTTPS. If this parameter is null, the protocol defaults to HTTP. - The name of the host. - The fragment identifier. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Generates an HTML anchor element (a element) that links to the specified URL route. - An HTML element that links to the specified URL route. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Returns the HTTP method that handles form input (GET or POST) as a string. - The form method string, either "get" or "post". - The HTTP method that handles the form. - - - Returns the HTML input control type as a string. - The input type string ("checkbox", "hidden", "password", "radio", or "text"). - The enumerated input type. - - - Gets the collection of unobtrusive JavaScript validation attributes using the specified HTML name attribute. - The collection of unobtrusive JavaScript validation attributes. - The HTML name attribute. - - - Gets the collection of unobtrusive JavaScript validation attributes using the specified HTML name attribute and model metadata. - The collection of unobtrusive JavaScript validation attributes. - The HTML name attribute. - The model metadata. - - - Gets or sets the HTML5 date rendering mode. - The HTML5 date rendering mode. - - - Returns a hidden input element that identifies the override method for the specified HTTP data-transfer method that was used by the client. - The override method that uses the HTTP data-transfer method that was used by the client. - The HTTP data-transfer method that was used by the client (DELETE, HEAD, or PUT). - The httpVerb parameter is not "PUT", "DELETE", or "HEAD". - - - Returns a hidden input element that identifies the override method for the specified verb that represents the HTTP data-transfer method used by the client. - The override method that uses the verb that represents the HTTP data-transfer method used by the client. - The verb that represents the HTTP data-transfer method used by the client. - The httpVerb parameter is not "PUT", "DELETE", or "HEAD". - - - Gets or sets the character that replaces periods in the ID attribute of an element. - The character that replaces periods in the ID attribute of an element. - - - Creates a dictionary from an object, by adding each public instance property as a key with its associated value to the dictionary. It will expose public properties from derived types as well. This is typically used with objects of an anonymous type. - The created dictionary of property names and property values. - The object to be converted. - - - Returns markup that is not HTML encoded. - The HTML markup without encoding. - The HTML markup. - - - Returns markup that is not HTML encoded. - The HTML markup without encoding. - The HTML markup. - - - Gets or sets the collection of routes for the application. - The collection of routes for the application. - - - Set element name used to wrap the validation message generated by and other overloads. - - - Set element name used to wrap a top-level message in and other overloads. - - - Gets or sets a value that indicates whether unobtrusive JavaScript is enabled. - true if unobtrusive JavaScript is enabled; otherwise, false. - - - The name of the CSS class that is used to style an input field when a validation error occurs. - - - The name of the CSS class that is used to style an input field when the input is valid. - - - The name of the CSS class that is used to style the error message when a validation error occurs. - - - Element name used to wrap the validation message generated by and other overloads. - - - The name of the CSS class that is used to style the validation message when the input is valid. - - - The name of the CSS class that is used to style validation summary error messages. - - - Element name used to wrap a top-level message in and other overloads. - - - The name of the CSS class that is used to style the validation summary when the input is valid. - - - Gets the view bag. - The view bag. - - - Gets or sets the context information about the view. - The context of the view. - - - Gets the current view data dictionary. - The view data dictionary. - - - Gets or sets the view data container. - The view data container. - - - Represents support for rendering HTML controls in a strongly typed view. - The type of the model. - - - Initializes a new instance of the class by using the specified view context and view data container. - The view context. - The view data container. - - - Initializes a new instance of the class by using the specified view context, view data container, and route collection. - The view context. - The view data container. - The route collection. - - - Gets the view bag. - The view bag. - - - Gets the strongly typed view data dictionary. - The strongly typed view data dictionary. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP DELETE requests. - - - Initializes a new instance of the class. - - - Determines whether the action method delete request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Represents a value provider to use with values that come from a collection of HTTP files. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - - - Represents a class that is responsible for creating a new instance of an HTTP file collection value provider object. - - - Initializes a new instance of the class. - - - Returns a value provider object for the specified controller context. - An HTTP file collection value provider. - An object that encapsulates information about the HTTP request. - The parameter is null. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP GET requests. - - - Initializes a new instance of the class. - - - Determines whether the action method get request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Specifies that the HTTP request must be the HTTP HEAD method. - - - Initializes a new instance of the class. - - - Determines whether the action method request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Defines an object that is used to indicate that the requested resource was not found. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a status description. - The status description. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP OPTIONS requests. - - - Initializes a new instance of the class. - - - Determines whether the action method request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP PATCH requests. - - - Initializes a new instance of the class. - - - Determines whether the action method request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP POST requests. - - - Initializes a new instance of the class. - - - Determines whether the action method post request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Binds a model to a posted file. - - - Initializes a new instance of the class. - - - Binds the model. - The bound value.Implements - The controller context. - The binding context. - One or both parameters are null. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP PUT requests. - - - Initializes a new instance of the class. - - - Determines whether the action method put request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Extends the class that contains the HTTP values that were sent by a client during a Web request. - - - Retrieves the HTTP data-transfer method override that was used by the client. - The HTTP data-transfer method override that was used by the client. - An object that contains the HTTP values that were sent by a client during a Web request. - The parameter is null. - The HTTP data-transfer method override was not implemented. - - - Provides a way to return an action result with a specific HTTP response status code and description. - - - Initializes a new instance of the class using a status code. - The status code. - - - Initializes a new instance of the class using a status code and status description. - The status code. - The status description. - - - Initializes a new instance of the class using a status code. - The status code. - - - Initializes a new instance of the class using a status code and status description. - The status code. - The status description. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - - - Gets the HTTP status code. - The HTTP status code. - - - Gets the HTTP status description. - the HTTP status description. - - - Represents the result of an unauthorized HTTP request. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the status description. - The status description. - - - Enumerates the HTTP verbs. - - - Requests that a specified URI be deleted. - - - Retrieves the information or entity that is identified by the URI of the request. - - - Retrieves the message headers for the information or entity that is identified by the URI of the request. - - - Represents a request for information about the communication options available on the request/response chain identified by the Request-URI. - - - Requests that a set of changes described in the request entity be applied to the resource identified by the Request- URI. - - - Posts a new entity as an addition to a URI. - - - Replaces an entity that is identified by a URI. - - - Defines the methods that are used in an action filter. - - - Called after the action method executes. - The filter context. - - - Called before an action method executes. - The filter context. - - - Defines the contract for an action invoker, which is used to invoke an action in response to an HTTP request. - - - Invokes the specified action by using the specified controller context. - true if the action was found; otherwise, false. - The controller context. - The name of the action. - - - Used to create an instance for the current request. - - - Creates an instance of action invoker for the current request. - The created . - - - Defines the methods that are required for an authorization filter. - - - Called when authorization is required. - The filter context. - - - Provides a way for the ASP.NET MVC validation framework to discover at run time whether a validator has support for client validation. - - - When implemented in a class, returns client validation rules for that class. - The client validation rules for this validator. - The model metadata. - The controller context. - - - Defines the methods that are required for a controller. - - - Executes the specified request context. - The request context. - - - Provides fine-grained control over how controllers are instantiated using dependency injection. - - - When implemented in a class, creates a controller. - The created controller. - The request context. - The controller type. - - - Defines the methods that are required for a controller factory. - - - Creates the specified controller by using the specified request context. - The controller. - The request context. - The name of the controller. - - - Gets the controller's session behavior. - The controller's session behavior. - The request context. - The name of the controller whose session behavior you want to get. - - - Releases the specified controller. - The controller. - - - Defines the methods that simplify service location and dependency resolution. - - - Resolves singly registered services that support arbitrary object creation. - The requested service or object. - The type of the requested service or object. - - - Resolves multiply registered services. - The requested services. - The type of the requested services. - - - Represents a special that has the ability to be enumerable. - - - Gets the keys from the prefix. - The keys. - The prefix. - - - Defines the methods that are required for an exception filter. - - - Called when an exception occurs. - The filter context. - - - Provides an interface for finding filters. - - - Returns an enumerator that contains all the instances in the service locator. - The enumerator that contains all the instances in the service locator. - The controller context. - The action descriptor. - - - Provides an interface for exposing attributes to the class. - - - When implemented in a class, provides metadata to the model metadata creation process. - The model metadata. - - - An optional interface for types which provide a . - - - Gets the MethodInfo - - - Defines the methods that are required for a model binder. - - - Binds the model to a value by using the specified controller context and binding context. - The bound value. - The controller context. - The binding context. - - - Defines methods that enable dynamic implementations of model binding for classes that implement the interface. - - - Returns the model binder for the specified type. - The model binder for the specified type. - The type of the model. - - - Defines members that specify the order of filters and whether multiple filters are allowed. - - - When implemented in a class, gets or sets a value that indicates whether multiple filters are allowed. - true if multiple filters are allowed; otherwise, false. - - - When implemented in a class, gets the filter order. - The filter order. - - - Enumerates the types of input controls. - - - A check box. - - - A hidden field. - - - A password box. - - - A radio button. - - - A text box. - - - Defines the methods that are required for a result filter. - - - Called after an action result executes. - The filter context. - - - Called before an action result executes. - The filter context. - - - Associates a route with an area in an ASP.NET MVC application. - - - Gets the name of the area to associate the route with. - The name of the area to associate the route with. - - - Defines the contract for temporary-data providers that store data that is viewed on the next request. - - - Loads the temporary data. - The temporary data. - The controller context. - - - Saves the temporary data. - The controller context. - The values. - - - Used to create an instance for the controller. - - - Creates an instance of for the controller. - The created . - - - Represents an interface that can skip request validation. - - - Retrieves the value of the object that is associated with the specified key. - The value of the object for the specified key. - The key. - true if validation should be skipped; otherwise, false. - - - Defines the methods that are required for a value provider in ASP.NET MVC. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Retrieves a value object using the specified key. - The value object for the specified key, or null if the key is not found. - The key of the value object to retrieve. - - - Defines the methods that are required for a view. - - - Renders the specified view context by using the specified the writer object. - The view context. - The writer object. - - - Defines the methods that are required for a view data dictionary. - - - Gets or sets the view data dictionary. - The view data dictionary. - - - Defines the methods that are required for a view engine. - - - Finds the specified partial view by using the specified controller context. - The partial view. - The controller context. - The name of the partial view. - true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. - - - Finds the specified view by using the specified controller context. - The page view. - The controller context. - The name of the view. - The name of the master. - true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. - - - Releases the specified view by using the specified controller context. - The controller context. - The view. - - - Defines the methods that are required in order to cache view locations in memory. - - - Gets the view location by using the specified HTTP context and the cache key. - The view location. - The HTTP context. - The cache key. - - - Inserts the specified view location into the cache by using the specified HTTP context and the cache key. - The HTTP context. - The cache key. - The virtual path. - - - Provides fine-grained control over how view pages are created using dependency injection. - - - Provides fine-grained control over how view pages are created using dependency injection. - The created view page. - The controller context. - The type of the controller. - - - Sends JavaScript content to the response. - - - Initializes a new instance of the class. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets the script. - The script. - - - The JQuery Form Value provider is used to handle JQuery formatted data in request Forms. - - - Constructs a new instance of the JQuery form ValueProvider - The context on which the ValueProvider operates. - - - Provides the necessary ValueProvider to handle JQuery Form data. - - - Constructs a new instance of the factory which provides JQuery form ValueProviders. - - - Returns the suitable ValueProvider. - The context on which the ValueProvider should operate. - - - Specifies whether HTTP GET requests from the client are allowed. - - - HTTP GET requests from the client are allowed. - - - HTTP GET requests from the client are not allowed. - - - Represents a class that is used to send JSON-formatted content to the response. - - - Initializes a new instance of the class. - - - Gets or sets the content encoding. - The content encoding. - - - Gets or sets the type of the content. - The type of the content. - - - Gets or sets the data. - The data. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets a value that indicates whether HTTP GET requests from the client are allowed. - A value that indicates whether HTTP GET requests from the client are allowed. - - - Gets or sets the maximum length of data. - The maximum length of data. - - - Gets or sets the recursion limit. - The recursion limit. - - - Enables action methods to send and receive JSON-formatted text and to model-bind the JSON text to parameters of action methods. - - - Initializes a new instance of the class. - - - Returns a JSON value-provider object for the specified controller context. - A JSON value-provider object for the specified controller context. - The controller context. - - - Maps a browser request to a LINQ object. - - - Initializes a new instance of the class. - - - Binds the model by using the specified controller context and binding context. - The bound data object. If the model cannot be bound, this method returns null.Implements. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Provides an adapter for the MaxLengthAttribute attribute. - - - Initializes a new instance of the MaxLengthAttribute class. - The model metadata. - The controller context. - The MaxLength attribute. - - - Gets a list of client validation rules for a max length check. - A list of client validation rules for the check. - - - Provides an adapter for the MinLengthAttribute attribute. - - - Initializes a new instance of the MinLenghtAttribute class. - The model metadata. - The controller context. - The minimum length attribute. - - - Gets a list of client validation rules for the minimum length check. - A list of client validation rules for a check. - - - Represents an attribute that is used to associate a model type to a model-builder type. - - - Initializes a new instance of the class. - The type of the binder. - The parameter is null. - - - Gets or sets the type of the binder. - The type of the binder. - - - Retrieves an instance of the model binder. - A reference to an object that implements the interface. - An error occurred while an instance of the model binder was being created. - - - Represents a class that contains all model binders for the application, listed by binder type. - - - Initializes a new instance of the class. - - - Adds the specified item to the model binder dictionary. - The object to add to the instance. - The object is read-only. - - - Adds the specified item to the model binder dictionary using the specified key. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the same key already exists in the object. - - - Removes all items from the model binder dictionary. - The object is read-only. - - - Determines whether the model binder dictionary contains a specified value. - true if is found in the model binder dictionary; otherwise, false. - The object to locate in the object. - - - Determines whether the model binder dictionary contains an element that has the specified key. - true if the model binder dictionary contains an element that has the specified key; otherwise, false. - The key to locate in the object. - - is null. - - - Copies the elements of the model binder dictionary to an array, starting at a specified index. - The one-dimensional array that is the destination of the elements copied from . The array must have zero-based indexing. - The zero-based index in at which copying starts. - - is null. - - is less than 0. - - is multidimensional.-or- is equal to or greater than the length of .-or- The number of elements in the source object is greater than the available space from to the end of the destination array. -or- Type cannot be cast automatically to the type of the destination array. - - - Gets the number of elements in the model binder dictionary. - The number of elements in the model binder dictionary. - - - Gets or sets the default model binder. - The default model binder. - - - Retrieves the model binder for the specified type. - The model binder. - The type of the model to retrieve. - The parameter is null. - - - Retrieves the model binder for the specified type or retrieves the default model binder. - The model binder. - The type of the model to retrieve. - true to retrieve the default model binder. - The parameter is null. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the model binder dictionary is read-only. - true if the model binder dictionary is read-only; otherwise, false. - - - Gets or sets the specified key in an object that implements the interface. - The key for the specified item. - - - Gets a collection that contains the keys in the model binder dictionary. - A collection that contains the keys in the model binder dictionary. - - - Removes the first occurrence of the specified element from the model binder dictionary. - true if was successfully removed from the model binder dictionary; otherwise, false. This method also returns false if is not found in the model binder dictionary. - The object to remove from the object. - The object is read-only. - - - Removes the element that has the specified key from the model binder dictionary. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the model binder dictionary. - The key of the element to remove. - The object is read-only. - - is null. - - - Returns an enumerator that can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - Gets the value that is associated with the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the value to get. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - is null. - - - Gets a collection that contains the values in the model binder dictionary. - A collection that contains the values in the model binder dictionary. - - - No content here will be updated; please do not add material here. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a list of model binder providers. - A list of model binder providers. - - - Removes all elements from the collection. - - - Returns a model binder of the specified type. - A model binder of the specified type. - The type of the model binder. - - - Inserts a model binder provider into the ModelBinderProviderCollection at the specified index. - The index. - The model binder provider. - - - Removes the element at the specified index of the collection. - The zero-based index of the element to remove. - - - Replaces the model binder provider element at the specified index. - The index. - The model binder provider. - - - Provides a container for model binder providers. - - - Provides a registration point for model binder providers for applications that do not use dependency injection. - The model binder provider collection. - - - Provides global access to the model binders for the application. - - - Gets the model binders for the application. - The model binders for the application. - - - Provides the context in which a model binder functions. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the binding context. - The binding context. - - - Gets or sets a value that indicates whether the binder should use an empty prefix. - true if the binder should use an empty prefix; otherwise, false. - - - Gets or sets the model. - The model. - - - Gets or sets the model metadata. - The model metadata. - - - Gets or sets the name of the model. - The name of the model. - - - Gets or sets the state of the model. - The state of the model. - - - Gets or sets the type of the model. - The type of the model. - - - Gets or sets the property filter. - The property filter. - - - Gets the property metadata. - The property metadata. - - - Gets or sets the value provider. - The value provider. - - - Represents an error that occurs during model binding. - - - Initializes a new instance of the class by using the specified exception. - The exception. - The parameter is null. - - - Initializes a new instance of the class by using the specified exception and error message. - The exception. - The error message. - The parameter is null. - - - Initializes a new instance of the class by using the specified error message. - The error message. - - - Gets or sets the error message. - The error message. - - - Gets or sets the exception object. - The exception object. - - - A collection of instances. - - - Initializes a new instance of the class. - - - Adds the specified object to the model-error collection. - The exception. - - - Adds the specified error message to the model-error collection. - The error message. - - - Provides a container for common metadata, for the class, and for the class for a data model. - - - Initializes a new instance of the class. - The provider. - The type of the container. - The model accessor. - The type of the model. - The name of the model. - - - Gets a dictionary that contains additional metadata about the model. - A dictionary that contains additional metadata about the model. - - - A reference to the model's container object. Will be non-null if the model represents a property. - - - Gets or sets the type of the container for the model. - The type of the container for the model. - - - Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. - true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. - - - Gets or sets meta information about the data type. - Meta information about the data type. - - - The default order value, which is 10000. - - - Gets or sets the description of the model. - The description of the model. The default value is null. - - - Gets or sets the display format string for the model. - The display format string for the model. - - - Gets or sets the display name of the model. - The display name of the model. - - - Gets or sets the edit format string of the model. - The edit format string of the model. - - - Returns the metadata from the parameter for the model. - The metadata. - An expression that identifies the model. - The view data dictionary. - The type of the parameter. - The type of the value. - - - Gets the metadata from the expression parameter for the model. - The metadata for the model. - An expression that identifies the model. - The view data dictionary. - - - Gets the display name for the model. - The display name for the model. - - - Returns the simple description of the model. - The simple description of the model. - - - Gets a list of validators for the model. - A list of validators for the model. - The controller context. - - - Gets or sets a value that indicates whether the model object should be rendered using associated HTML elements. - true if the associated HTML elements that contains the model object should be included with the object; otherwise, false. - - - Gets or sets a value that indicates whether the model is a complex type. - A value that indicates whether the model is considered a complex type by the MVC framework. - - - Gets a value that indicates whether the type is nullable. - true if the type is nullable; otherwise, false. - - - Gets or sets a value that indicates whether the model is read-only. - true if the model is read-only; otherwise, false. - - - Gets or sets a value that indicates whether the model is required. - true if the model is required; otherwise, false. - - - Gets the value of the model. - The value of the model. For more information about , see the entry ASP.NET MVC 2 Templates, Part 2: ModelMetadata on Brad Wilson's blog - - - Gets the type of the model. - The type of the model. - - - Gets or sets the string to display for null values. - The string to display for null values. - - - Gets or sets a value that represents order of the current metadata. - The order value of the current metadata. - - - Gets a collection of model metadata objects that describe the properties of the model. - A collection of model metadata objects that describe the properties of the model. - - - Gets the property name. - The property name. - - - Gets or sets the provider. - The provider. - - - Gets or sets a value that indicates whether request validation is enabled. - true if request validation is enabled; otherwise, false. - - - Gets or sets a short display name. - The short display name. - - - Gets or sets a value that indicates whether the property should be displayed in read-only views such as list and detail views. - true if the model should be displayed in read-only views; otherwise, false. - - - Gets or sets a value that indicates whether the model should be displayed in editable views. - true if the model should be displayed in editable views; otherwise, false. - - - Gets or sets the simple display string for the model. - The simple display string for the model. - - - Gets or sets a hint that suggests what template to use for this model. - A hint that suggests what template to use for this model. - - - Gets or sets a value that can be used as a watermark. - The watermark. - - - Provides an abstract base class for a custom metadata provider. - - - When overridden in a derived class, initializes a new instance of the object that derives from the class. - - - Gets a object for each property of a model. - A object for each property of a model. - The container. - The type of the container. - - - Gets metadata for the specified property. - A object for the property. - The model accessor. - The type of the container. - The property to get the metadata model for. - - - Gets metadata for the specified model accessor and model type. - A object for the specified model accessor and model type. - The model accessor. - The type of the model. - - - Provides a container for the current instance. - - - Gets or sets the current object. - The current object. - - - Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself. - - - Initializes a new instance of the class. - - - Returns a object that contains any errors that occurred during model binding. - The errors. - - - Returns a object that encapsulates the value that was being bound during model binding. - The value. - - - Represents the state of an attempt to bind a posted form to an action method, which includes validation information. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using values that are copied from the specified model-state dictionary. - The model-state dictionary. - The parameter is null. - - - Adds the specified item to the model-state dictionary. - The object to add to the model-state dictionary. - The model-state dictionary is read-only. - - - Adds an element that has the specified key and value to the model-state dictionary. - The key of the element to add. - The value of the element to add. - The model-state dictionary is read-only. - - is null. - An element that has the specified key already occurs in the model-state dictionary. - - - Adds the specified model error to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The exception. - - - Adds the specified error message to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The error message. - - - Removes all items from the model-state dictionary. - The model-state dictionary is read-only. - - - Determines whether the model-state dictionary contains a specific value. - true if is found in the model-state dictionary; otherwise, false. - The object to locate in the model-state dictionary. - - - Determines whether the model-state dictionary contains the specified key. - true if the model-state dictionary contains the specified key; otherwise, false. - The key to locate in the model-state dictionary. - - - Copies the elements of the model-state dictionary to an array, starting at a specified index. - The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. - The zero-based index in at which copying starts. - - is null. - - is less than 0. - - is multidimensional.-or- is equal to or greater than the length of .-or- The number of elements in the source collection is greater than the available space from to the end of the destination .-or- Type cannot be cast automatically to the type of the destination . - - - Gets the number of key/value pairs in the collection. - The number of key/value pairs in the collection. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets a value that indicates whether this instance of the model-state dictionary is valid. - true if this instance is valid; otherwise, false. - - - Determines whether there are any objects that are associated with or prefixed with the specified key. - true if the model-state dictionary contains a value that is associated with the specified key; otherwise, false. - The key. - The parameter is null. - - - Gets or sets the value that is associated with the specified key. - The model state item. - - - Gets a collection that contains the keys in the dictionary. - A collection that contains the keys of the model-state dictionary. - - - Copies the values from the specified object into this dictionary, overwriting existing values if keys are the same. - The dictionary. - - - Removes the first occurrence of the specified object from the model-state dictionary. - true if was successfully removed the model-state dictionary; otherwise, false. This method also returns false if is not found in the model-state dictionary. - The object to remove from the model-state dictionary. - The model-state dictionary is read-only. - - - Removes the element that has the specified key from the model-state dictionary. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the model-state dictionary. - The key of the element to remove. - The model-state dictionary is read-only. - - is null. - - - Sets the value for the specified key by using the specified value provider dictionary. - The key. - The value. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Attempts to gets the value that is associated with the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the value to get. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - is null. - - - Gets a collection that contains the values in the dictionary. - A collection that contains the values of the model-state dictionary. - - - Provides a container for a validation result. - - - Initializes a new instance of the class. - - - Gets or sets the name of the member. - The name of the member. - - - Gets or sets the validation result message. - The validation result message. - - - Provides a base class for implementing validation logic. - - - Called from constructors in derived classes to initialize the class. - The metadata. - The controller context. - - - Gets the controller context. - The controller context. - - - When implemented in a derived class, returns metadata for client validation. - The metadata for client validation. - - - Returns a composite model validator for the model. - A composite model validator for the model. - The metadata. - The controller context. - - - Gets or sets a value that indicates whether a model property is required. - true if the model property is required; otherwise, false. - - - Gets the metadata for the model validator. - The metadata for the model validator. - - - When implemented in a derived class, validates the object. - A list of validation results. - The container. - - - Provides a list of validators for a model. - - - When implemented in a derived class, initializes a new instance of the class. - - - Gets a list of validators. - A list of validators. - The metadata. - The context. - - - No content here will be updated; please do not add material here. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a list of model-validation providers. - A list of model-validation providers. - - - Removes all elements from the collection. - - - Returns the list of model validators. - The list of model validators. - The model metadata. - The controller context. - - - Inserts a model-validator provider into the collection. - The zero-based index at which item should be inserted. - The model-validator provider object to insert. - - - Removes the element at the specified index of the collection. - The zero-based index of the element to remove. - - - Replaces the model-validator provider element at the specified index. - The zero-based index of the model-validator provider element to replace. - The new value for the model-validator provider element. - - - Provides a container for the current validation provider. - - - Gets the model validator provider collection. - The model validator provider collection. - - - Represents a list of items that users can select more than one item from. - - - Initializes a new instance of the class by using the specified items to include in the list. - The items. - The parameter is null. - - - Initializes a new instance of the class by using the specified items to include in the list and the selected values. - The items. - The selected values. - The parameter is null. - - - Initializes a new instance of the MultiSelectList class by using the items to include in the list, the selected values, the disabled values. - The items used to build each of the list. - The selected values field. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - - - Initializes a new instance of the class by using the items to include in the list, the data value field, and the data text field. - The items. - The data value field. - The data text field. - The parameter is null. - - - Initializes a new instance of the class by using the items to include in the list, the data value field, the data text field, and the selected values. - The items. - The data value field. - The data text field. - The selected values. - The parameter is null. - - - Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the selected values, and the disabled values. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The selected values field. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - - - Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, and the data group field. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - - - Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the data group field, and the selected values. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - The selected values field. Used to match the Selected property of the corresponding . - - - Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the data group field, the selected values, and the disabled values. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - The selected values field. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - - - Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the data group field, the selected values, the disabled values, and the disabled groups. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - The selected values field. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - The disabled groups. Used to match the Disabled property of the corresponding . - - - Gets the data group field. - - - Gets or sets the data text field. - The data text field. - - - Gets or sets the data value field. - The data value field. - - - Gets the disabled groups. - - - Gets the disabled values. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets or sets the items in the list. - The items in the list. - - - Gets or sets the selected values. - The selected values. - - - Returns an enumerator can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - When implemented in a derived class, provides a metadata class that contains a reference to the implementation of one or more of the filter interfaces, the filter's order, and the filter's scope. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and specifies the order of filters and whether multiple filters are allowed. - true to specify that multiple filters of the same type are allowed; otherwise, false. - The filter order. - - - Gets a value that indicates whether more than one instance of the filter attribute can be specified. - true if more than one instance of the filter attribute is allowed; otherwise, false.Implements. - - - Gets a value that indicates the order in which a filter is applied. - A value that indicates the order in which a filter is applied.Implements. - - - Selects the controller that will handle an HTTP request. - - - Initializes a new instance of the class. - The request context. - The parameter is null. - - - Adds the version header by using the specified HTTP context. - The HTTP context. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The state of the asynchronous object. - - - Called by ASP.NET to begin asynchronous request processing using the base HTTP context. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The state of the asynchronous object. - - - Gets or sets a value that indicates whether the MVC response header is disabled. - true if the MVC response header is disabled; otherwise, false. - - - Called by ASP.NET when asynchronous request processing has ended. - The asynchronous result. - - - Gets a value that indicates whether another request can use the instance. - true if the instance is reusable; otherwise, false. - - - Contains the header name of the ASP.NET MVC version. - - - Processes the request by using the specified HTTP request context. - The HTTP context. - - - Processes the request by using the specified base HTTP request context. - The HTTP context. - - - Gets the request context. - The request context. - - - Called by ASP.NET to begin asynchronous request processing using the base HTTP context. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The data. - - - Called by ASP.NET when asynchronous request processing has ended. - The asynchronous result. - - - Gets a value that indicates whether another request can use the instance. - true if the instance is reusable; otherwise, false. - - - Enables processing of HTTP Web requests by a custom HTTP handler that implements the interface. - An object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) that are used to service HTTP requests. - - - Represents an HTML-encoded string that should not be encoded again. - - - Initializes a new instance of the class. - The string to create. If no value is assigned, the object is created using an empty-string value. - - - Creates an HTML-encoded string using the specified text value. - An HTML-encoded string. - The value of the string to create . - - - Contains an empty HTML string. - - - Determines whether the specified string contains content or is either null or empty. - true if the string is null or empty; otherwise, false. - The string. - - - Verifies and processes an HTTP request. - - - Initializes a new instance of the class. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The state. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The base HTTP context. - The asynchronous callback method. - The state. - - - Called by ASP.NET when asynchronous request processing has ended. - The asynchronous result. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The context. - The asynchronous callback method. - An object that contains data. - - - Called by ASP.NET when asynchronous request processing has ended. - The status of the asynchronous operations. - - - Verifies and processes an HTTP request. - The HTTP handler. - The HTTP context. - - - Creates an object that implements the IHttpHandler interface and passes the request context to it. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified factory controller object. - The controller factory. - - - Returns the HTTP handler by using the specified HTTP context. - The HTTP handler. - The request context. - - - Returns the session behavior. - The session behavior. - The request context. - - - Returns the HTTP handler by using the specified request context. - The HTTP handler. - The request context. - - - Creates instances of files. - - - Initializes a new instance of the class. - - - Creates a Razor host. - A Razor host. - The virtual path to the target file. - The physical path to the target file. - - - Extends a NameValueCollection object so that the collection can be copied to a specified dictionary. - - - Copies the specified collection to the specified destination. - The collection. - The destination. - - - Copies the specified collection to the specified destination, and optionally replaces previous entries. - The collection. - The destination. - true to replace previous entries; otherwise, false. - - - Represents the base class for value providers whose values come from a object. - - - Initializes a new instance of the class using the specified unvalidated collection. - A collection that contains the values that are used to initialize the provider. - A collection that contains the values that are used to initialize the provider. This collection will not be validated. - An object that contains information about the target culture. - - - Initializes Name Value collection provider. - Key value collection from request. - Unvalidated key value collection from the request. - Culture with which the values are to be used. - jQuery POST when sending complex Javascript objects to server does not encode in the way understandable by MVC. This flag should be set if the request should be normalized to MVC form - https://aspnetwebstack.codeplex.com/workitem/1564. - - - Initializes a new instance of the class. - A collection that contains the values that are used to initialize the provider. - An object that contains information about the target culture. - The parameter is null. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - The parameter is null. - - - Gets the keys using the specified prefix. - They keys. - The prefix. - - - Returns a value object using the specified key. - The value object for the specified key. - The key of the value object to retrieve. - The parameter is null. - - - Returns a value object using the specified key and validation directive. - The value object for the specified key. - The key. - true if validation should be skipped; otherwise, false. - - - Provides a convenience wrapper for the attribute. - - - Initializes a new instance of the class. - - - Represents an attribute that is used to indicate that a controller method is not an action method. - - - Initializes a new instance of the class. - - - Determines whether the attribute marks a method that is not an action method by using the specified controller context. - true if the attribute marks a valid non-action method; otherwise, false. - The controller context. - The method information. - - - Represents an attribute that is used to mark an action method whose output will be cached. - - - Initializes a new instance of the class. - - - Gets or sets the cache profile name. - The cache profile name. - - - Gets or sets the child action cache. - The child action cache. - - - Gets or sets the cache duration, in seconds. - The cache duration. - - - Returns a value that indicates whether a child action cache is active. - true if the child action cache is active; otherwise, false. - The controller context. - - - Gets or sets the location. - The location. - - - Gets or sets a value that indicates whether to store the cache. - true if the cache should be stored; otherwise, false. - - - This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. - The filter context. - - - This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. - The filter context. - - - This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. - The filter context. - - - This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. - The filter context. - - - Called before the action result executes. - The filter context, which encapsulates information for using . - The parameter is null. - - - Gets or sets the SQL dependency. - The SQL dependency. - - - Gets or sets the vary-by-content encoding. - The vary-by-content encoding. - - - Gets or sets the vary-by-custom value. - The vary-by-custom value. - - - Gets or sets the vary-by-header value. - The vary-by-header value. - - - Gets or sets the vary-by-param value. - The vary-by-param value. - - - Represents the attributes associated with the override filter. - - - Initializes a new instance of the class. - - - Gets the filters to override for this instance. - The filters to override for this instance. - - - Represents the attributes associated with the authentication. - - - Initializes a new instance of the class. - - - Gets the filters to override for this instance. - The filters to override for this instance. - - - Represents the attributes associated with the authorization. - - - Initializes a new instance of the class. - - - Gets the filters to override for this instance. - The filters to override for this instance. - - - Represents the attributes associated with the exception filter. - - - Initializes a new instance of the class. - - - Gets the filters to override for this instance. - The filters to override for this instance. - - - Represents the attributes associated with the result filter. - - - Initializes a new instance of the class. - - - Gets the filters to override for this instance. - The filters to override for this instance. - - - Encapsulates information for binding action-method parameters to a data model. - - - Initializes a new instance of the class. - - - Gets the model binder. - The model binder. - - - Gets a comma-delimited list of property names for which binding is disabled. - The exclude list. - - - Gets a comma-delimited list of property names for which binding is enabled. - The include list. - - - Gets the prefix to use when the MVC framework binds a value to an action parameter or to a model property. - The prefix. - - - Contains information that describes a parameter. - - - Initializes a new instance of the class. - - - Gets the action descriptor. - The action descriptor. - - - Gets the binding information. - The binding information. - - - Gets the default value of the parameter. - The default value of the parameter. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - The parameter is null. - - - Indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The parameter is null. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Represents a base class that is used to send a partial view to the response. - - - Initializes a new instance of the class. - - - Returns the object that is used to render the view. - The view engine result. - The controller context. - An error occurred while the method was attempting to find the view. - - - Provides a registration point for ASP.NET Razor pre-application start code. - - - Registers Razor pre-application start code. - - - Represents a value provider for query strings that are contained in a object. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - - - Represents a class that is responsible for creating a new instance of a query-string value-provider object. - - - Initializes a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A query-string value-provider object. - An object that encapsulates information about the current HTTP request. - The parameter is null. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The range attribute. - - - Gets a list of client validation rules for a range check. - A list of client validation rules for a range check. - - - Represents the class used to create views that have Razor syntax. - - - Initializes a new instance of the class. - The controller context. - The view path. - The layout or master page. - A value that indicates whether view start files should be executed before the view. - The set of extensions that will be used when looking up view start files. - - - Initializes a new instance of the class using the view page activator. - The controller context. - The view path. - The layout or master page. - A value that indicates whether view start files should be executed before the view. - The set of extensions that will be used when looking up view start files. - The view page activator. - - - Gets the layout or master page. - The layout or master page. - - - Renders the specified view context by using the specified writer and instance. - The view context. - The writer that is used to render the view to the response. - The instance. - - - Gets a value that indicates whether view start files should be executed before the view. - A value that indicates whether view start files should be executed before the view. - - - Gets or sets the set of file extensions that will be used when looking up view start files. - The set of file extensions that will be used when looking up view start files. - - - Represents a view engine that is used to render a Web page that uses the ASP.NET Razor syntax. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the view page activator. - The view page activator. - - - Creates a partial view using the specified controller context and partial path. - The partial view. - The controller context. - The path to the partial view. - - - Creates a view by using the specified controller context and the paths of the view and master view. - The view. - The controller context. - The path to the view. - The path to the master view. - - - Controls the processing of application actions by redirecting to a specified URI. - - - Initializes a new instance of the class. - The target URL. - The parameter is null. - - - Initializes a new instance of the class using the specified URL and permanent-redirection flag. - The URL. - A value that indicates whether the redirection should be permanent. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets a value that indicates whether the redirection should be permanent. - true if the redirection should be permanent; otherwise, false. - - - Gets or sets the target URL. - The target URL. - - - Represents a result that performs a redirection by using the specified route values dictionary. - - - Initializes a new instance of the class by using the specified route name and route values. - The name of the route. - The route values. - - - Initializes a new instance of the class by using the specified route name, route values, and permanent-redirection flag. - The name of the route. - The route values. - A value that indicates whether the redirection should be permanent. - - - Initializes a new instance of the class by using the specified route values. - The route values. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets a value that indicates whether the redirection should be permanent. - true if the redirection should be permanent; otherwise, false. - - - Gets or sets the name of the route. - The name of the route. - - - Gets or sets the route values. - The route values. - - - Contains information that describes a reflected action method. - - - Initializes a new instance of the class. - The action-method information. - The name of the action. - The controller descriptor. - Either the or parameter is null. - The parameter is null or empty. - - - Gets the name of the action. - The name of the action. - - - Gets the controller descriptor. - The controller descriptor. - - - Executes the specified controller context by using the specified action-method parameters. - The action return value. - The controller context. - The parameters. - The or parameter is null. - - - Returns an array of custom attributes defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Gets the filter attributes. - The filter attributes. - true to use the cache, otherwise false. - - - Retrieves the parameters of the action method. - The parameters of the action method. - - - Retrieves the action selectors. - The action selectors. - - - Indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Gets or sets the action-method information. - The action-method information. - - - Gets the unique ID for the reflected action descriptor using lazy initialization. - The unique ID. - - - Contains information that describes a reflected controller. - - - Initializes a new instance of the class. - The type of the controller. - The parameter is null. - - - Gets the type of the controller. - The type of the controller. - - - Finds the specified action for the specified controller context. - The information about the action. - The controller context. - The name of the action. - The parameter is null. - The parameter is null or empty. - - - Returns the list of actions for the controller. - A list of action descriptors for the controller. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Gets the filter attributes. - The filter attributes. - true to use the cache, otherwise false. - - - Returns a value that indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Contains information that describes a reflected action-method parameter. - - - Initializes a new instance of the class. - The parameter information. - The action descriptor. - The or parameter is null. - - - Gets the action descriptor. - The action descriptor. - - - Gets the binding information. - The binding information. - - - Gets the default value of the reflected parameter. - The default value of the reflected parameter. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns a value that indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Gets or sets the parameter information. - The parameter information. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The regular expression attribute. - - - Gets a list of regular-expression client validation rules. - A list of regular-expression client validation rules. - - - Provides an attribute that uses the jQuery validation plug-in remote validator. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified route name. - The route name. - - - Initializes a new instance of the class using the specified action-method name and controller name. - The name of the action method. - The name of the controller. - - - Initializes a new instance of the class using the specified action-method name, controller name, and area name. - The name of the action method. - The name of the controller. - The name of the area. - - - Initializes a new instance of the class. - The route name. - The name of the controller. - Find the controller in the root if . Otherwise look in the current area. - - - Gets or sets the additional fields that are required for validation. - The additional fields that are required for validation. - - - Returns a comma-delimited string of validation field names. - A comma-delimited string of validation field names. - The name of the validation property. - - - Formats the error message that is displayed when validation fails. - A formatted error message. - A name to display with the error message. - - - Formats the property for client validation by prepending an asterisk (*) and a dot. - The string "*." Is prepended to the property. - The property. - - - Gets a list of client validation rules for the property. - A list of remote client validation rules for the property. - The model metadata. - The controller context. - - - Gets the URL for the remote validation call. - The URL for the remote validation call. - The controller context. - - - Gets or sets the HTTP method used for remote validation. - The HTTP method used for remote validation. The default value is "Get". - - - This method always returns true. - true - The validation target. - - - Gets the route data dictionary. - The route data dictionary. - - - Gets or sets the route name. - The route name. - - - Gets the route collection from the route table. - The route collection from the route table. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The required attribute. - - - Gets a list of required-value client validation rules. - A list of required-value client validation rules. - - - Represents an attribute that forces an unsecured HTTP request to be re-sent over HTTPS. - - - Initializes a new instance of the class. - - - Handles unsecured HTTP requests that are sent to the action method. - An object that encapsulates information that is required in order to use the attribute. - The HTTP request contains an invalid transfer method override. All GET requests are considered invalid. - - - Determines whether a request is secured (HTTPS) and, if it is not, calls the method. - An object that encapsulates information that is required in order to use the attribute. - The parameter is null. - - - Provides the context for the method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The controller context. - The result object. - true to cancel execution; otherwise, false. - The exception object. - The parameter is null. - - - Gets or sets a value that indicates whether this instance is canceled. - true if the instance is canceled; otherwise, false. - - - Gets or sets the exception object. - The exception object. - - - Gets or sets a value that indicates whether the exception has been handled. - true if the exception has been handled; otherwise, false. - - - Gets or sets the action result. - The action result. - - - Provides the context for the method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified controller context and action result. - The controller context. - The action result. - The parameter is null. - - - Gets or sets a value that indicates whether this value is "cancel". - true if the value is "cancel"; otherwise, false. - - - Gets or sets the action result. - The action result. - - - Defines the area to set for all the routes defined in this controller. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The name of the area. If the value is null, an attempt will be made to infer the area name from the target controller's namespace. - - - Gets the area name to set for all the routes defined in the controller. If the value is null, an attempt will be made to infer the area name from the target controller's namespace. - The area name to set for all the routes defined in the controller. - - - Gets the URL prefix to apply to the routes of this area. Defaults to the area's name. - The URL prefix to apply to the routes of this area. - - - Place on a controller or action to expose it directly via a route. When placed on a controller, it applies to actions that do not have any System.Web.Mvc.RouteAttribute’s on them. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified template. - The pattern of the route to match. - - - Gets or sets the name of the route. - The name of the route - - - Gets the order the route is applied. - The order the route is applied. - - - Creates a direct route entry. - The direct route entry. - The context to use to create the route. - - - Gets the pattern for the route to match. - The pattern to match. - - - Provides routing extensions for route collection attribute. - - - Maps the attribute-defined routes for the application. - A collection of routes. - - - Maps the attribute-defined routes for the application. - The to use for mapping routes. - - - Maps the attribute-defined routes for the application. - A collection of routes. - The to use for resolving inline constraints in route templates. - - - Maps the attribute-defined routes for the application. - The to use for resolving inline constraints in route templates. - The to use for mapping routes. - - - Extends a object for MVC routing. - - - Returns an object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains the routes for the applications. - An object that encapsulates information about the requested route. - The name of the route to use when information about the URL path is retrieved. - An object that contains the parameters for a route. - - - Returns an object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains the routes for the applications. - An object that encapsulates information about the requested route. - An object that contains the parameters for a route. - - - Ignores the specified URL route for the given list of available routes. - A collection of routes for the application. - The URL pattern for the route to ignore. - The or parameter is null. - - - Ignores the specified URL route for the given list of the available routes and a list of constraints. - A collection of routes for the application. - The URL pattern for the route to ignore. - A set of expressions that specify values for the parameter. - The or parameter is null. - - - Maps the specified URL route. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - The or parameter is null. - - - Maps the specified URL route and sets default route values. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - The or parameter is null. - - - Maps the specified URL route and sets default route values and constraints. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify values for the parameter. - The or parameter is null. - - - Maps the specified URL route and sets default route values, constraints, and namespaces. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify values for the parameter. - A set of namespaces for the application. - The or parameter is null. - - - Maps the specified URL route and sets default route values and namespaces. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - A set of namespaces for the application. - The or parameter is null. - - - Maps the specified URL route and sets the namespaces. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - A set of namespaces for the application. - The or parameter is null. - - - Represents a value provider for route data that is contained in an object that implements the interface. - - - Initializes a new instance of the class. - An object that contain information about the HTTP request. - - - Represents a factory for creating route-data value provider objects. - - - Initialized a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - The parameter is null. - - - Annotates a controller with a route prefix that applies to all actions within the controller. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified prefix. - The route prefix for the controller. - - - Gets the route prefix. - The route prefix. - - - Represents a list that lets users select one item. - - - Initializes a new instance of the class by using the specified items for the list. - The items. - - - Initializes a new instance of the class by using the specified items for the list and a selected value. - The items. - The selected value. - - - Initializes a new instance of the SelectList class by using the specified items for the list, the selected value, and the disabled values. - The items used to build each of the list. - The selected value. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - - - Initializes a new instance of the class by using the specified items for the list, the data value field, and the data text field. - The items. - The data value field. - The data text field. - - - Initializes a new instance of the class by using the specified items for the list, the data value field, the data text field, and a selected value. - The items. - The data value field. - The data text field. - The selected value. - - - Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the selected value, and the disabled values. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The selected value. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - - - Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the data group field, and the selected value. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - The selected value. Used to match the Selected property of the corresponding . - - - Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the data group field, the selected value, and the disabled values. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - The selected value. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - - - Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the data group field. the selected value, the disabled values, and the disabled groups. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - The selected value. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - The disabled groups. Used to match the Disabled property of the corresponding . - - - Gets the list value that was selected by the user. - The selected value. - - - Represents the optgroup HTML element and its attributes. In a select list, multiple groups with the same name are supported. They are compared with reference equality. - - - - Gets or sets a value that indicates whether this is disabled. - - - Represents the value of the optgroup's label. - - - Represents the selected item in an instance of the class. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether this is disabled. - - - Represents the optgroup HTML element this item is wrapped into. In a select list, multiple groups with the same name are supported. They are compared with reference equality. - - - Gets or sets a value that indicates whether this is selected. - true if the item is selected; otherwise, false. - - - Gets or sets the text of the selected item. - The text. - - - Gets or sets the value of the selected item. - The value. - - - Specifies the session state of the controller. - - - Initializes a new instance of the class - The type of the session state. - - - Get the session state behavior for the controller. - The session state behavior for the controller. - - - Provides session-state data to the current object. - - - Initializes a new instance of the class. - - - Loads the temporary data by using the specified controller context. - The temporary data. - The controller context. - An error occurred when the session context was being retrieved. - - - Saves the specified values in the temporary data dictionary by using the specified controller context. - The controller context. - The values. - An error occurred the session context was being retrieved. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The string-length attribute. - - - Gets a list of string-length client validation rules. - A list of string-length client validation rules. - - - Represents a set of data that persists only from one request to the next. - - - Initializes a new instance of the class. - - - Adds an element that has the specified key and value to the object. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the same key already exists in the object. - - - Removes all items from the instance. - The object is read-only. - - - Determines whether the instance contains an element that has the specified key. - true if the instance contains an element that has the specified key; otherwise, false. - The key to locate in the instance. - - is null. - - - Determines whether the dictionary contains the specified value. - true if the dictionary contains the specified value; otherwise, false. - The value. - - - Gets the number of elements in the object. - The number of elements in the object. - - - Gets the enumerator. - The enumerator. - - - Gets or sets the object that has the specified key. - The object that has the specified key. - - - Marks all keys in the dictionary for retention. - - - Marks the specified key in the dictionary for retention. - The key to retain in the dictionary. - - - Gets an object that contains the keys of elements in the object. - The keys of the elements in the object. - - - Loads the specified controller context by using the specified data provider. - The controller context. - The temporary data provider. - - - Returns an object that contains the element that is associated with the specified key, without marking the key for deletion. - An object that contains the element that is associated with the specified key. - The key of the element to return. - - - Removes the element that has the specified key from the object. - true if the element was removed successfully; otherwise, false. This method also returns false if was not found in the . instance. - The key of the element to remove. - The object is read-only. - - is null. - - - Saves the specified controller context by using the specified data provider. - The controller context. - The temporary data provider. - - - Adds the specified key/value pair to the dictionary. - The key/value pair. - - - Determines whether a sequence contains a specified element by using the default equality comparer. - true if the dictionary contains the specified key/value pair; otherwise, false. - The key/value pair to search for. - - - Copies a key/value pair to the specified array at the specified index. - The target array. - The index. - - - Gets a value that indicates whether the dictionary is read-only. - true if the dictionary is read-only; otherwise, false. - - - Deletes the specified key/value pair from the dictionary. - true if the key/value pair was removed successfully; otherwise, false. - The key/value pair. - - - Returns an enumerator that can be used to iterate through a collection. - An object that can be used to iterate through the collection. - - - Gets the value of the element that has the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the value to get. - When this method returns, the value that is associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - is null. - - - Gets the object that contains the values in the object. - The values of the elements in the object that implements . - - - Encapsulates information about the current template context. - - - Initializes a new instance of the class. - - - Gets or sets the formatted model value. - The formatted model value. - - - Retrieves the full DOM ID of a field using the specified HTML name attribute. - The full DOM ID. - The value of the HTML name attribute. - - - Retrieves the fully qualified name (including a prefix) for a field using the specified HTML name attribute. - The prefixed name of the field. - The value of the HTML name attribute. - - - Gets or sets the HTML field prefix. - The HTML field prefix. - - - Contains the number of objects that were visited by the user. - The number of objects. - - - Determines whether the template has been visited by the user. - true if the template has been visited by the user; otherwise, false. - An object that encapsulates information that describes the model. - - - Contains methods to build URLs for ASP.NET MVC within an application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified request context. - An object that contains information about the current request and about the route that it matched. - - - Initializes a new instance of the class using the specified request context and route collection. - An object that contains information about the current request and about the route that it matched. - A collection of routes. - The or the parameter is null. - - - Generates a string to a fully qualified URL to an action method. - A string to a fully qualified URL to an action method. - - - Generates a fully qualified URL to an action method by using the specified action name. - The fully qualified URL to an action method. - The name of the action method. - - - Generates a fully qualified URL to an action method by using the specified action name and route values. - The fully qualified URL to an action method. - The name of the action method. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL to an action method by using the specified action name and controller name. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - - - Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL to an action method by using the specified action name, controller name, route values, and protocol to use. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The protocol for the URL, such as "http" or "https". - - - Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - - - Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, and protocol to use. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The protocol for the URL, such as "http" or "https". - - - Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, protocol to use and host name. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - - - Generates a fully qualified URL to an action method for the specified action name and route values. - The fully qualified URL to an action method. - The name of the action method. - An object that contains the parameters for a route. - - - Converts a virtual (relative) path to an application absolute path. - The application absolute path. - The virtual path of the content. - - - Encodes special characters in a URL string into character-entity equivalents. - An encoded URL string. - The text to encode. - - - Returns a string that contains a content URL. - A string that contains a content URL. - The content path. - The http context. - - - Returns a string that contains a URL. - A string that contains a URL. - The route name. - The action name. - The controller name. - The HTTP protocol. - The host name. - The fragment. - The route values. - The route collection. - The request context. - true to include implicit MVC values; otherwise false. - - - Returns a string that contains a URL. - A string that contains a URL. - The route name. - The action name. - The controller name. - The route values. - The route collection. - The request context. - true to include implicit MVC values; otherwise false. - - - Generates a fully qualified URL for the specified route values. - A fully qualified URL for the specified route values. - The route name. - The route values. - - - Generates a fully qualified URL for the specified route values. - A fully qualified URL for the specified route values. - The route name. - The route values. - - - Returns a value that indicates whether the URL is local. - true if the URL is local; otherwise, false. - The URL. - - - Gets information about an HTTP request that matches a defined route. - The request context. - - - Gets a collection that contains the routes that are registered for the application. - The route collection. - - - Generates a fully qualified URL for the specified route values. - The fully qualified URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL for the specified route name. - The fully qualified URL. - The name of the route that is used to generate URL. - - - Generates a fully qualified URL for the specified route values by using a route name. - The fully qualified URL. - The name of the route that is used to generate URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL for the specified route values by using a route name and the protocol to use. - The fully qualified URL. - The name of the route that is used to generate the URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The protocol for the URL, such as "http" or "https". - - - Generates a fully qualified URL for the specified route values by using a route name. - The fully qualified URL. - The name of the route that is used to generate URL. - An object that contains the parameters for a route. - - - Generates a fully qualified URL for the specified route values by using the specified route name, protocol to use, and host name. - The fully qualified URL. - The name of the route that is used to generate URL. - An object that contains the parameters for a route. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - - - Generates a fully qualified URL for the specified route values. - The fully qualified URL. - An object that contains the parameters for a route. - - - Represents an optional parameter that is used by the class during routing. - - - Contains the read-only value for the optional parameter. - - - Returns an empty string. This method supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - An empty string. - - - Provides an object adapter that can be validated. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - - - Validates the specified object. - A list of validation results. - The container. - - - Represents an attribute that is used to prevent forgery of a request. - - - Initializes a new instance of the class. - - - Called when authorization is required. - The filter context. - The parameter is null. - - - Gets or sets the salt string. - The salt string. - - - Represents an attribute that is used to mark action methods whose input must be validated. - - - Initializes a new instance of the class. - true to enable validation. - - - Gets or sets a value that indicates whether to enable validation. - true if validation is enabled; otherwise, false. - - - Called when authorization is required. - The filter context. - The parameter is null. - - - Represents the collection of value-provider objects for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and registers the specified value providers. - The list of value providers to register. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Gets the keys using the specified prefix. - They keys. - The prefix. - - - Returns a value object using the specified key. - The value object for the specified key. - The key of the value object to retrieve. - - - Returns a value object using the specified key and skip-validation parameter. - The value object for the specified key. - The key of the value object to retrieve. - true to specify that validation should be skipped; otherwise, false. - - - Inserts the specified value-provider object into the collection at the specified index location. - The zero-based index location at which to insert the value provider into the collection. - The value-provider object to insert. - The parameter is null. - - - Replaces the value provider at the specified index location with a new value provider. - The zero-based index of the element to replace. - The new value for the element at the specified index. - The parameter is null. - - - Note: This API is now obsolete.Represents a dictionary of value providers for the application. - - - Initializes a new instance of the class. - The controller context. - - - Adds the specified item to the collection of value providers. - The object to add to the object. - The object is read-only. - - - Adds an element that has the specified key and value to the collection of value providers. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the specified key already exists in the object. - - - Adds an element that has the specified key and value to the collection of value providers. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the specified key already exists in the object. - - - Removes all items from the collection of value providers. - The object is read-only. - - - Determines whether the collection of value providers contains the specified item. - true if is found in the collection of value providers; otherwise, false. - The object to locate in the instance. - - - Determines whether the collection of value providers contains an element that has the specified key. - true if the collection of value providers contains an element that has the key; otherwise, false. - The key of the element to find in the instance. - - is null. - - - Gets or sets the controller context. - The controller context. - - - Copies the elements of the collection to an array, starting at the specified index. - The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. - The zero-based index in at which copying starts. - - is null. - - is less than 0. - - is multidimensional.-or- is equal to or greater than the length of .-or-The number of elements in the source collection is greater than the available space from to the end of the destination .-or-Type cannot be cast automatically to the type of the destination array. - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets the object that has the specified key. - The object. - - - Gets a collection that contains the keys of the instance. - A collection that contains the keys of the object that implements the interface. - - - Removes the first occurrence of the specified item from the collection of value providers. - true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the collection. - The object to remove from the instance. - The object is read-only. - - - Removes the element that has the specified key from the collection of value providers. - true if the element was successfully removed; otherwise, false. This method also returns false if was not found in the collection. - The key of the element to remove. - The object is read-only. - - is null. - - - Returns an enumerator that can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Returns a value object using the specified key. - The value object for the specified key. - The key of the value object to return. - - - Gets the value of the element that has the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the element to get. - When this method returns, the value that is associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - is null. - - - Gets a collection that contains the values in the object. - A collection of the values in the object that implements the interface. - - - Represents a container for value-provider factory objects. - - - Gets the collection of value-provider factories for the application. - The collection of value-provider factory objects. - - - Represents a factory for creating value-provider objects. - - - Initializes a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - - - Represents the collection of value-provider factories for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified list of value-provider factories. - A list of value-provider factories to initialize the collection with. - - - Removes all elements from the collection. - - - Returns the value-provider factory for the specified controller context. - The value-provider factory object for the specified controller context. - An object that encapsulates information about the current HTTP request. - - - Inserts the specified value-provider factory object at the specified index location. - The zero-based index location at which to insert the value provider into the collection. - The value-provider factory object to insert. - The parameter is null. - - - Removes the element at the specified index of the . - The zero-based index of the element to remove. - - is less than zero.-or- is equal to or greater than - - - Sets the specified value-provider factory object at the given index location. - The zero-based index location at which to insert the value provider into the collection. - The value-provider factory object to set. - The parameter is null. - - - Represents the result of binding a value (such as from a form post or query string) to an action-method argument property, or to the argument itself. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified raw value, attempted value, and culture information. - The raw value. - The attempted value. - The culture. - - - Gets or sets the raw value that is converted to a string for display. - The raw value. - - - Converts the value that is encapsulated by this result to the specified type. - The converted value. - The target type. - The parameter is null. - - - Converts the value that is encapsulated by this result to the specified type by using the specified culture information. - The converted value. - The target type. - The culture to use in the conversion. - The parameter is null. - - - Gets or sets the culture. - The culture. - - - Gets or set the raw value that is supplied by the value provider. - The raw value. - - - Encapsulates information that is related to rendering a view. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified controller context, view, view data dictionary, temporary data dictionary, and text writer. - Encapsulates information about the HTTP request. - The view to render. - The dictionary that contains the data that is required in order to render the view. - The dictionary that contains temporary data for the view. - The text writer object that is used to write HTML output. - One of the parameters is null. - - - Gets or sets a value that indicates whether client-side validation is enabled. - true if client-side validation is enabled; otherwise, false. - - - Gets or sets an object that encapsulates information that is required in order to validate and process the input data from an HTML form. - An object that encapsulates information that is required in order to validate and process the input data from an HTML form. - - - Writes the client validation information to the HTTP response. - - - Gets data that is associated with this request and that is available for only one request. - The temporary data. - - - Gets or sets a value that indicates whether unobtrusive JavaScript is enabled. - true if unobtrusive JavaScript is enabled; otherwise, false. - - - Element name used to wrap a top-level message generated by and other overloads. - - - Element name used to wrap a top-level message generated by and other overloads. - - - Gets an object that implements the interface to render in the browser. - The view. - - - Gets the dynamic view data dictionary. - The dynamic view data dictionary. - - - Gets the view data that is passed to the view. - The view data. - - - Gets or sets the text writer object that is used to write HTML output. - The object that is used to write the HTML output. - - - Represents a container that is used to pass data between a controller and a view. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified model. - The model. - - - Initializes a new instance of the class by using the specified dictionary. - The dictionary. - The parameter is null. - - - Adds the specified item to the collection. - The object to add to the collection. - The collection is read-only. - - - Adds an element to the collection using the specified key and value . - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element with the same key already exists in the object. - - - Removes all items from the collection. - The object is read-only. - - - Determines whether the collection contains the specified item. - true if is found in the collection; otherwise, false. - The object to locate in the collection. - - - Determines whether the collection contains an element that has the specified key. - true if the collection contains an element that has the specified key; otherwise, false. - The key of the element to locate in the collection. - - is null. - - - Copies the elements of the collection to an array, starting at a particular index. - The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing. - The zero-based index in at which copying begins. - - is null. - - is less than 0. - - is multidimensional.-or- is equal to or greater than the length of .-or- The number of elements in the source collection is greater than the available space from to the end of the destination .-or- Type cannot be cast automatically to the type of the destination . - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Evaluates the specified expression. - The results of the evaluation. - The expression. - The parameter is null or empty. - - - Evaluates the specified expression by using the specified format. - The results of the evaluation. - The expression. - The format. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Returns information about the view data as defined by the parameter. - An object that contains the view data information that is defined by the parameter. - A set of key/value pairs that define the view-data information to return. - The parameter is either null or empty. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets the item that is associated with the specified key. - The value of the selected item. - - - Gets a collection that contains the keys of this dictionary. - A collection that contains the keys of the object that implements . - - - Gets or sets the model that is associated with the view data. - The model that is associated with the view data. - - - Gets or sets information about the model. - Information about the model. - - - Gets the state of the model. - The state of the model. - - - Removes the first occurrence of a specified object from the collection. - true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the collection. - The object to remove from the collection. - The collection is read-only. - - - Removes the element from the collection using the specified key. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original collection. - The key of the element to remove. - The collection is read-only. - - is null. - - - Sets the data model to use for the view. - The data model to use for the view. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets or sets an object that encapsulates information about the current template context. - An object that contains information about the current template. - - - Attempts to retrieve the value that is associated with the specified key. - true if the collection contains an element with the specified key; otherwise, false. - The key of the value to get. - When this method returns, the value that is associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - is null. - - - Gets a collection that contains the values in this dictionary. - A collection that contains the values of the object that implements . - - - Represents a container that is used to pass strongly typed data between a controller and a view. - The type of the model. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified view data dictionary. - An existing view data dictionary to copy into this instance. - - - Initializes a new instance of the class by using the specified model. - The data model to use for the view. - - - Gets or sets the model. - A reference to the data model. - - - Gets or sets information about the model. - Information about the model. - - - Sets the data model to use for the view. - The data model to use for the view. - An error occurred while the model was being set. - - - Encapsulates information about the current template content that is used to develop templates and about HTML helpers that interact with templates. - - - Initializes a new instance of the class. - - - Initializes a new instance of the T:System.Web.Mvc.ViewDataInfo class and associates a delegate for accessing the view data information. - A delegate that defines how the view data information is accessed. - - - Gets or sets the object that contains the values to be displayed by the template. - The object that contains the values to be displayed by the template. - - - Gets or sets the description of the property to be displayed by the template. - The description of the property to be displayed by the template. - - - Gets or sets the current value to be displayed by the template. - The current value to be displayed by the template. - - - Represents a collection of view engines that are available to the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified list of view engines. - The list that is wrapped by the new collection. - - is null. - - - Removes all elements from the . - - - Finds the specified partial view by using the specified controller context. - The partial view. - The controller context. - The name of the partial view. - The parameter is null. - The parameter is null or empty. - - - Finds the specified view by using the specified controller context and master view. - The view. - The controller context. - The name of the view. - The name of the master view. - The parameter is null. - The parameter is null or empty. - - - Inserts an element into the collection at the specified index. - The zero-based index at which item should be inserted. - The object to insert. - - is less than zero.-or- is greater than the number of items in the collection. - The parameter is null. - - - Removes the element at the specified index of the . - The zero-based index of the element to remove. - - is less than zero.-or- is equal to or greater than - - - Replaces the element at the specified index. - The zero-based index of the element to replace. - The new value for the element at the specified index. - - is less than zero.-or- is greater than the number of items in the collection. - The parameter is null. - - - Represents the result of locating a view engine. - - - Initializes a new instance of the class by using the specified searched locations. - The searched locations. - The parameter is null. - - - Initializes a new instance of the class by using the specified view and view engine. - The view. - The view engine. - The or parameter is null. - - - Gets or sets the searched locations. - The searched locations. - - - Gets or sets the view. - The view. - - - Gets or sets the view engine. - The view engine. - - - Represents a collection of view engines that are available to the application. - - - Gets the view engines. - The view engines. - - - Represents the information that is needed to build a master view page. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the master page. - The AJAX script for the master page. - - - Gets the HTML for the master page. - The HTML for the master page. - - - Gets the model. - The model. - - - Gets the temporary data. - The temporary data. - - - Gets the URL. - The URL. - - - Gets the dynamic view-bag dictionary. - The dynamic view-bag dictionary. - - - Gets the view context. - The view context. - - - Gets the view data. - The view data. - - - Gets the writer that is used to render the master page. - The writer that is used to render the master page. - - - Represents the information that is required in order to build a strongly typed master view page. - The type of the model. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the master page. - The AJAX script for the master page. - - - Gets the HTML for the master page. - The HTML for the master page. - - - Gets the model. - A reference to the data model. - - - Gets the view data. - The view data. - - - Represents the properties and methods that are needed to render a view as a Web Forms page. - - - Initializes a new instance of the class. - - - Gets or sets the object that is used to render HTML in Ajax scenarios. - The Ajax helper object that is associated with the view. - - - Gets or sets the object that is used to render HTML elements. - The HTML helper object that is associated with the view. - - - Initializes the , , and properties. - - - Gets or sets the path of the master view. - The path of the master view. - - - Gets the Model property of the associated object. - The Model property of the associated object. - - - Raises the event at the beginning of page initialization. - The event data. - - - Enables processing of the specified HTTP request by the ASP.NET MVC framework. - An object that encapsulates HTTP-specific information about the current HTTP request. - - - Initializes the object that receives the page content to be rendered. - The object that receives the page content. - - - Renders the view page to the response using the specified view context. - An object that encapsulates the information that is required in order to render the view, which includes the controller context, form context, the temporary data, and the view data for the associated view. - - - Note: This API is now obsolete.Sets the text writer that is used to render the view to the response. - The writer that is used to render the view to the response. - - - Sets the view data dictionary for the associated view. - A dictionary of data to pass to the view. - - - Gets the temporary data to pass to the view. - The temporary data to pass to the view. - - - Gets or sets the URL of the rendered page. - The URL of the rendered page. - - - Gets the view bag. - The view bag. - - - Gets or sets the information that is used to render the view. - The information that is used to render the view, which includes the form context, the temporary data, and the view data of the associated view. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Gets the text writer that is used to render the view to the response. - The text writer that is used to render the view to the response. - - - Represents the information that is required in order to render a strongly typed view as a Web Forms page. - The type of the model. - - - Initializes a new instance of the class. - - - Gets or sets the object that supports rendering HTML in Ajax scenarios. - The Ajax helper object that is associated with the view. - - - Gets or sets the object that provides support for rendering elements. - The HTML helper object that is associated with the view. - - - Instantiates and initializes the and properties. - - - Gets the property of the associated object. - A reference to the data model. - - - Sets the view data dictionary for the associated view. - A dictionary of data to pass to the view. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Represents a class that is used to render a view by using an instance that is returned by an object. - - - Initializes a new instance of the class. - - - Searches the registered view engines and returns the object that is used to render the view. - The object that is used to render the view. - The controller context. - An error occurred while the method was searching for the view. - - - Gets the name of the master view (such as a master page or template) to use when the view is rendered. - The name of the master view. - - - Represents a base class that is used to provide the model to the view and then render the view to the response. - - - Initializes a new instance of the class. - - - When called by the action invoker, renders the view to the response. - The context that the result is executed in. - The parameter is null. - - - Returns the object that is used to render the view. - The view engine. - The context. - - - Gets the view data model. - The view data model. - - - Gets or sets the object for this result. - The temporary data. - - - Gets or sets the object that is rendered to the response. - The view. - - - Gets the view bag. - The view bag. - - - Gets or sets the view data object for this result. - The view data. - - - Gets or sets the collection of view engines that are associated with this result. - The collection of view engines. - - - Gets or sets the name of the view to render. - The name of the view. - - - Provides an abstract class that can be used to implement a view start (master) page. - - - When implemented in a derived class, initializes a new instance of the class. - - - When implemented in a derived class, gets the HTML markup for the view start page. - The HTML markup for the view start page. - - - When implemented in a derived class, gets the URL for the view start page. - The URL for the view start page. - - - When implemented in a derived class, gets the view context for the view start page. - The view context for the view start page. - - - Provides a container for objects. - - - Initializes a new instance of the class. - - - Provides a container for objects. - The type of the model. - - - Initializes a new instance of the class. - - - Gets the formatted value. - The formatted value. - - - Represents the type of a view. - - - Initializes a new instance of the class. - - - Gets or sets the name of the type. - The name of the type. - - - Represents the information that is needed to build a user control. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the view. - The AJAX script for the view. - - - Ensures that view data is added to the object of the user control if the view data exists. - - - Gets the HTML for the view. - The HTML for the view. - - - Gets the model. - The model. - - - Renders the view by using the specified view context. - The view context. - - - Sets the text writer that is used to render the view to the response. - The writer that is used to render the view to the response. - - - Sets the view-data dictionary by using the specified view data. - The view data. - - - Gets the temporary-data dictionary. - The temporary-data dictionary. - - - Gets the URL for the view. - The URL for the view. - - - Gets the view bag. - The view bag. - - - Gets or sets the view context. - The view context. - - - Gets or sets the view-data dictionary. - The view-data dictionary. - - - Gets or sets the view-data key. - The view-data key. - - - Gets the writer that is used to render the view to the response. - The writer that is used to render the view to the response. - - - Represents the information that is required in order to build a strongly typed user control. - The type of the model. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the view. - The AJAX script for the view. - - - Gets the HTML for the view. - The HTML for the view. - - - Gets the model. - A reference to the data model. - - - Sets the view data for the view. - The view data. - - - Gets or sets the view data. - The view data. - - - Represents an abstract base-class implementation of the interface. - - - Initializes a new instance of the class. - - - Gets or sets the area-enabled master location formats. - The area-enabled master location formats. - - - Gets or sets the area-enabled partial-view location formats. - The area-enabled partial-view location formats. - - - Gets or sets the area-enabled view location formats. - The area-enabled view location formats. - - - Creates the specified partial view by using the specified controller context. - A reference to the partial view. - The controller context. - The partial path for the new partial view. - - - Creates the specified view by using the controller context, path of the view, and path of the master view. - A reference to the view. - The controller context. - The path of the view. - The path of the master view. - - - Gets or sets the display mode provider. - The display mode provider. - - - Returns a value that indicates whether the file is in the specified path by using the specified controller context. - true if the file is in the specified path; otherwise, false. - The controller context. - The virtual path. - - - Gets or sets the file-name extensions that are used to locate a view. - The file-name extensions that are used to locate a view. - - - Finds the specified partial view by using the specified controller context. - The partial view. - The controller context. - The name of the partial view. - true to use the cached partial view. - The parameter is null (Nothing in Visual Basic). - The parameter is null or empty. - - - Finds the specified view by using the specified controller context and master view name. - The page view. - The controller context. - The name of the view. - The name of the master view. - true to use the cached view. - The parameter is null (Nothing in Visual Basic). - The parameter is null or empty. - - - Gets or sets the master location formats. - The master location formats. - - - Gets or sets the partial-view location formats. - The partial-view location formats. - - - Releases the specified view by using the specified controller context. - The controller context. - The view to release. - - - Gets or sets the view location cache. - The view location cache. - - - Gets or sets the view location formats. - The view location formats. - - - Gets or sets the virtual path provider. - The virtual path provider. - - - Represents the information that is needed to build a Web Forms page in ASP.NET MVC. - - - Initializes a new instance of the class using the controller context and view path. - The controller context. - The view path. - - - Initializes a new instance of the class using the controller context, view path, and the path to the master page. - The controller context. - The view path. - The path to the master page. - - - Initializes a new instance of the class using the controller context, view path, the path to the master page, and a instance. - The controller context. - The view path. - The path to the master page. - An instance of the view page activator interface. - - - Gets or sets the master path. - The master path. - - - Renders the view to the response. - An object that encapsulates the information that is required in order to render the view, which includes the controller context, form context, the temporary data, and the view data for the associated view. - The text writer object that is used to write HTML output. - The view page instance. - - - Represents a view engine that is used to render a Web Forms page to the response. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified view page activator. - An instance of a class that implements the interface. - - - Creates the specified partial view by using the specified controller context. - The partial view. - The controller context. - The partial path. - - - Creates the specified view by using the specified controller context and the paths of the view and master view. - The view. - The controller context. - The view path. - The master-view path. - - - Represents the properties and methods that are needed in order to render a view that uses ASP.NET Razor syntax. - - - Initializes a new instance of the class. - - - Gets or sets the object that is used to render HTML using Ajax. - The object that is used to render HTML using Ajax. - - - Sets the view context and view data for the page. - The parent page. - - - Gets the object that is associated with the page. - The object that is associated with the page. - - - Runs the page hierarchy for the ASP.NET Razor execution pipeline. - - - Gets or sets the object that is used to render HTML elements. - The object that is used to render HTML elements. - - - Initializes the , , and classes. - - - Gets the Model property of the associated object. - The Model property of the associated object. - - - Sets the view data. - The view data. - - - Gets the temporary data to pass to the view. - The temporary data to pass to the view. - - - Gets or sets the URL of the rendered page. - The URL of the rendered page. - - - Gets the view bag. - The view bag. - - - Gets or sets the information that is used to render the view. - The information that is used to render the view, which includes the form context, the temporary data, and the view data of the associated view. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Represents the properties and methods that are needed in order to render a view that uses ASP.NET Razor syntax. - The type of the view data model. - - - Initializes a new instance of the class. - - - Gets or sets the object that is used to render HTML markup using Ajax. - The object that is used to render HTML markup using Ajax. - - - Gets or sets the object that is used to render HTML elements. - The object that is used to render HTML elements. - - - Initializes the , , and classes. - - - Gets the Model property of the associated object. - The Model property of the associated object. - - - Sets the view data. - The view data. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Represents support for ASP.NET AJAX within an ASP.NET MVC application. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element.. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML script element that contains a reference to a globalization script that defines the culture information. - A script element whose src attribute is set to the globalization script, as in the following example: <script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script> - The AJAX helper object that this method extends. - - - Returns an HTML script element that contains a reference to a globalization script that defines the specified culture information. - An HTML script element whose src attribute is set to the globalization script, as in the following example:<script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script> - The AJAX helper object that this method extends. - Encapsulates information about the target culture, such as date formats. - The parameter is null. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Represents option settings for running Ajax scripts in an ASP.NET MVC application. - - - Initializes a new instance of the class. - - - - Gets or sets the message to display in a confirmation window before a request is submitted. - The message to display in a confirmation window. - - - Gets or sets the HTTP request method ("Get" or "Post"). - The HTTP request method. The default value is "Post". - - - Gets or sets the mode that specifies how to insert the response into the target DOM element. - The insertion mode ("InsertAfter", "InsertBefore", or "Replace"). The default value is "Replace". - - - Gets or sets a value, in milliseconds, that controls the duration of the animation when showing or hiding the loading element. - A value, in milliseconds, that controls the duration of the animation when showing or hiding the loading element. - - - Gets or sets the id attribute of an HTML element that is displayed while the Ajax function is loading. - The ID of the element that is displayed while the Ajax function is loading. - - - Gets or sets the name of the JavaScript function to call immediately before the page is updated. - The name of the JavaScript function to call before the page is updated. - - - Gets or sets the JavaScript function to call when response data has been instantiated but before the page is updated. - The JavaScript function to call when the response data has been instantiated. - - - Gets or sets the JavaScript function to call if the page update fails. - The JavaScript function to call if the page update fails. - - - Gets or sets the JavaScript function to call after the page is successfully updated. - The JavaScript function to call after the page is successfully updated. - - - Returns the Ajax options as a collection of HTML attributes to support unobtrusive JavaScript. - The Ajax options as a collection of HTML attributes to support unobtrusive JavaScript. - - - Gets or sets the ID of the DOM element to update by using the response from the server. - The ID of the DOM element to update. - - - Gets or sets the URL to make the request to. - The URL to make the request to. - - - Enumerates the AJAX script insertion modes. - - - Insert after the element. - - - Insert before the element. - - - Replace the element. - - - Replace the entire element. - - - Provides information about an asynchronous action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - - - Invokes the asynchronous action method by using the specified parameters and controller context. - An object that contains the result of an asynchronous call. - The controller context. - The parameters of the action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Returns the result of an asynchronous operation. - The result of an asynchronous operation. - An object that represents the status of an asynchronous operation. - - - Executes the asynchronous action method by using the specified parameters and controller context. - The result of executing the asynchronous action method. - The controller context. - The parameters of the action method. - - - Represents a class that is responsible for invoking the action methods of an asynchronous controller. - - - Initializes a new instance of the class. - - - Invokes the asynchronous action method by using the specified controller context, action name, callback method, and state. - An object that contains the result of an asynchronous operation.Implements - The controller context. - The name of the action. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Invokes the asynchronous action method by using the specified controller context, action descriptor, parameters, callback method, and state. - An object that contains the result of an asynchronous operation. - The controller context. - The action descriptor. - The parameters for the asynchronous action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Invokes the asynchronous action method by using the specified controller context, filters, action descriptor, parameters, callback method, and state. - An object that contains the result of an asynchronous operation. - The controller context. - The filters. - The action descriptor. - The parameters for the asynchronous action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Cancels the action. - true if the action was canceled; otherwise, false. - The user-defined object that qualifies or contains information about an asynchronous operation. - - - Cancels the action. - true if the action was canceled; otherwise, false. - The user-defined object that qualifies or contains information about an asynchronous operation. - - - Cancels the action. - true if the action was canceled; otherwise, false. - The user-defined object that qualifies or contains information about an asynchronous operation. - - - Returns the controller descriptor. - The controller descriptor. - The controller context. - - - Provides asynchronous operations for the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the synchronization context. - The synchronization context. - - - Notifies ASP.NET that all asynchronous operations are complete. - - - Occurs when the method is called. - - - Gets the number of outstanding operations. - The number of outstanding operations. - - - Gets the parameters that were passed to the asynchronous completion method. - The parameters that were passed to the asynchronous completion method. - - - Executes a callback in the current synchronization context. - The asynchronous action. - - - Gets or sets the asynchronous timeout value, in milliseconds. - The asynchronous timeout value, in milliseconds. - - - Defines the interface for an action invoker, which is used to invoke an asynchronous action in response to an HTTP request. - - - Invokes the specified action. - The status of the asynchronous result. - The controller context. - The name of the asynchronous action. - The callback method. - The state. - - - Cancels the asynchronous action. - true if the asynchronous method could be canceled; otherwise, false. - The asynchronous result. - - - Used to create an instance for the current request. - - - Creates an instance of async action invoker for the current request. - The created . - - - Defines the methods that are required for an asynchronous controller. - - - Executes the specified request context. - The status of the asynchronous operation. - The request context. - The asynchronous callback method. - The state. - - - Ends the asynchronous operation. - The asynchronous result. - - - Provides a container for the asynchronous manager object. - - - Gets the asynchronous manager object. - The asynchronous manager object. - - - Provides a container that maintains a count of pending asynchronous operations. - - - Initializes a new instance of the class. - - - Occurs when an asynchronous method completes. - - - Gets the operation count. - The operation count. - - - Reduces the operation count by 1. - The updated operation count. - - - Reduces the operation count by the specified value. - The updated operation count. - The number of operations to reduce the count by. - - - Increments the operation count by one. - The updated operation count. - - - Increments the operation count by the specified value. - The updated operation count. - The number of operations to increment the count by. - - - Provides information about an asynchronous action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - An object that contains information about the method that begins the asynchronous operation (the method whose name ends with "Asynch"). - An object that contains information about the completion method (method whose name ends with "Completed"). - The name of the action. - The controller descriptor. - - - Gets the name of the action method. - The name of the action method. - - - Gets the method information for the asynchronous action method. - The method information for the asynchronous action method. - - - Begins running the asynchronous action method by using the specified parameters and controller context. - An object that contains the result of an asynchronous call. - The controller context. - The parameters of the action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Gets the method information for the asynchronous completion method. - The method information for the asynchronous completion method. - - - Gets the controller descriptor for the asynchronous action method. - The controller descriptor for the asynchronous action method. - - - Returns the result of an asynchronous operation. - The result of an asynchronous operation. - An object that represents the status of an asynchronous operation. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes of the specified type exist. - The type of the custom attributes to return. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Gets the filter attributes. - The filter attributes. - Use cache flag. - - - Returns the parameters of the action method. - The parameters of the action method. - - - Returns the action-method selectors. - The action-method selectors. - - - Determines whether one or more instances of the specified attribute type are defined for the action member. - true if an attribute of type that is represented by is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - - Gets the lazy initialized unique ID of the instance of this class. - The lazy initialized unique ID of the instance of this class. - - - Encapsulates information that describes an asynchronous controller, such as its name, type, and actions. - - - Initializes a new instance of the class. - The type of the controller. - - - Gets the type of the controller. - The type of the controller. - - - Finds an action method by using the specified name and controller context. - The information about the action method. - The controller context. - The name of the action. - - - Returns a list of action method descriptors in the controller. - A list of action method descriptors in the controller. - - - Returns custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns custom attributes of a specified type that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Gets the filter attributes. - The filter attributes. - true to use the cache, otherwise false. - - - Returns a value that indicates whether one or more instances of the specified custom attribute are defined for this member. - true if an attribute of the type represented by is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Represents an exception that occurred during the synchronous processing of an HTTP request in an ASP.NET MVC application. - - - Initializes a new instance of the class using a system-supplied message. - - - Initializes a new instance of the class using the specified message. - The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. - - - Initializes a new instance of the class using a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - When an action method returns either Task or Task<T> the provides information about the action. - - - Initializes a new instance of the class. - The task method information. - The action name. - The controller descriptor. - - - Gets the name of the action method. - The name of the action method. - - - Invokes the asynchronous action method using the specified parameters, controller context callback and state. - An object that contains the result of an asynchronous call. - The controller context. - The parameters of the action method. - The optional callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Gets the controller descriptor. - The controller descriptor. - - - Ends the asynchronous operation. - The result of an asynchronous operation. - An object that represents the status of an asynchronous operation. - - - Executes the asynchronous action method - The result of executing the asynchronous action method. - The controller context. - The parameters of the action method. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns an array of all custom attributes applied to this member. - An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. - true to search this member's inheritance chain to find the attributes; otherwise, false. - - - Returns the parameters of the asynchronous action method. - The parameters of the asynchronous action method. - - - Returns the asynchronous action-method selectors. - The asynchronous action-method selectors. - - - Returns a value that indicates whether one or more instance of the specified custom attribute are defined for this member. - A value that indicates whether one or more instance of the specified custom attribute are defined for this member. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - - Gets information for the asynchronous task. - Information for the asynchronous task. - - - Gets the unique ID for the task. - The unique ID for the task. - - - Represents an authentication challenge context containing information for executing an authentication challenge. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The controller context. - The action methods associated with the challenge. - The challenge response. - - - Gets or sets the action descriptor. - The action descriptor associated with the challenge. - - - Gets or sets the action result to execute. - The challenge response. - - - Represents an authentication context containing information for performing authentication. - - - Initializes a new instance of the class. - - - - Gets or sets the action descriptor. - The action methods associated with the authentication - - - Gets or sets the currently authenticated principal. - The security credentials for the authentication. - - - Gets or sets the error result, which indicates that authentication was attempted and failed. - The authentication result. - - - Defines a filter that performs authentication. - - - Authenticates the request. - The context to use for authentication. - - - Adds an authentication challenge to the current . - The context to use for the authentication challenge. - - - Defines a filter that overrides other filters. - - - Gets the type of filters to override. - The filter to override. - - - Represents support for calling child action methods and rendering the result inline in a parent view. - - - Invokes the specified child action method and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method with the specified parameters and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified controller name and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The name of the controller that contains the action method. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The name of the controller that contains the action method. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The name of the controller that contains the action method. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified controller name and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The name of the controller that contains the action method. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The name of the controller that contains the action method. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The name of the controller that contains the action method. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Represents support for rendering object values as HTML. - - - Returns HTML markup for each property in the object that is represented by a string expression. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - - - Returns HTML markup for each property in the object that is represented by a string expression, using additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template and an HTML field ID. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template, HTML field ID, and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the object that is represented by the expression. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The type of the model. - The type of the value. - - - Returns a string that contains each property value in the object that is represented by the specified expression, using additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns a string that contains each property value in the object that is represented by the , using the specified template. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - The type of the model. - The type of the value. - - - Returns a string that contains each property value in the object that is represented by the specified expression, using the specified template and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns HTML markup for each property in the object that is represented by the , using the specified template and an HTML field ID. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - The type of the model. - The type of the value. - - - Returns HTML markup for each property in the object that is represented by the specified expression, using the template, an HTML field ID, and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns HTML markup for each property in the model. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - - - Returns HTML markup for each property in the model, using additional view data. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the model using the specified template. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - - - Returns HTML markup for each property in the model, using the specified template and additional view data. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the model using the specified template and HTML field ID. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns HTML markup for each property in the model, using the specified template, an HTML field ID, and additional view data. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Provides a mechanism to get display names. - - - Gets the display name. - The display name. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the display name. - - - Gets the display name for the model. - The display name for the model. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the display name. - The type of the model. - The type of the value. - - - Gets the display name for the model. - The display name for the model. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the display name. - The type of the model. - The type of the value. - - - Gets the display name for the model. - The display name for the model. - The HTML helper instance that this method extends. - - - Provides a way to render object values as HTML. - - - Returns HTML markup for each property in the object that is represented by the specified expression. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - - - Returns HTML markup for each property in the object that is represented by the specified expression. - The HTML markup for each property. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The type of the model. - The type of the result. - - - Represents support for the HTML input element in an application. - - - Returns an HTML input element for each property in the object that is represented by the expression. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - - - Returns an HTML input element for each property in the object that is represented by the expression, using additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and HTML field name. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template, HTML field name, and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the object that is represented by the expression. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and HTML field name. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template, HTML field name, and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the model. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - - - Returns an HTML input element for each property in the model, using additional view data. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the model, using the specified template. - An HTML input element for each property in the model and in the specified template. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - - - Returns an HTML input element for each property in the model, using the specified template and additional view data. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the model, using the specified template name and HTML field name. - An HTML input element for each property in the model and in the named template. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns an HTML input element for each property in the model, using the template name, HTML field name, and additional view data. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Provides methods for working with enumeration values and select lists. - - - Gets a list of objects corresponding to enum constants defined in the given type. - A list for the given . - The type to evaluate. - - - Gets a list of objects corresponding to enum constants defined in the given type. Also ensures the will round-trip even if it does not match a defined constant and sets the Selected property to true for one element in the returned list -- matching the . - A list for the given , possibly extended to include an unrecognized . - The type to evaluate. - The value from type to select. - - - Gets a list of objects corresponding to enum constants defined in the given metadata. - A list for the given metadata. - The model metadata to evaluate. - - - Gets a list of objects corresponding to enum constants defined in the given metadata. Also ensures the value will round-trip even if it does not match a defined constant and sets the Selected property to true for one element in the returned list -- matching the value. - A list for the given , possibly extended to include an unrecognized . - The metadata to evaluate. - Value from the type of metadata to select. - - - Gets a value indicating whether the given type or an expression of this type is suitable for use in and calls. - true if will not throw when passed the given type and will not throw when passed an expression of this type; otherwise, false. - The type to check. - - - Gets a value indicating whether the given metadata or associated expression is suitable for use in and calls. - true if will return not throw when passed given and will not throw when passed associated expression; otherwise, false. - The metadata to check. - - - Represents support for HTML in an application. - - - Writes an opening <form> tag to the response. The form uses the POST method, and the request is processed by the action method for the view. - An opening <form> tag. - The HTML helper instance that this method extends. - - - Writes an opening <form> tag to the response and includes the route values in the action attribute. The form uses the POST method, and the request is processed by the action method for the view. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the POST method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - - - Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values. The form uses the POST method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response and sets the action tag to the specified controller, action, and route values. The form uses the specified HTTP method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response and sets the action tag to the specified controller, action, and route values. The form uses the specified HTTP method and includes the HTML attributes. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method and includes the HTML attributes from a dictionary. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method and includes the HTML attributes. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the POST method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - - - Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the specified HTTP method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the specified HTTP method, and includes the HTML attributes from the dictionary. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response and includes the route values from the route value dictionary in the action attribute. The form uses the POST method, and the request is processed by the action method for the view. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route - - - Renders the closing </form> tag to the response. - The HTML helper instance that this method extends. - - - Represents support for HTML input controls in an application. - - - Returns a check box input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, and a value to indicate whether the check box is selected. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - true to select the check box; otherwise, false. The value of the check box is retrieved in this order - the object, the value of this parameter, the object, and lastly, a checked attribute in the html attributes. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, a value to indicate whether the check box is selected, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - true to select the check box; otherwise, false. The value of the check box is retrieved in this order - the object, the value of this parameter, the object, and lastly, a checked attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, a value that indicates whether the check box is selected, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - true to select the check box; otherwise, false. The value of the check box is retrieved in this order - the object, the value of this parameter, the object, and lastly, a checked attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The parameter is null. - - - Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The parameter is null. - - - Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The parameter is null. - - - Returns a hidden input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - - - Returns a hidden input element by using the specified HTML helper, the name of the form field, and the value. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the hidden input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - - - Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the hidden input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - - - Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the hidden input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML hidden input element for each property in the object that is represented by the specified expression. - An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the property. - - - Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - - - Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - - - Returns a password input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - - - Returns a password input element by using the specified HTML helper, the name of the form field, and the value. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the password input element. If a value for this parameter is not provided, the value attribute in the html attributes is used to retrieve the value. - - - Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the password input element. If a value for this parameter is not provided, the value attribute in the html attributes is used to retrieve the value. - An object that contains the HTML attributes to set for the element. - - - Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the password input element. If a value for this parameter is not provided, the value attribute in the html attributes is used to retrieve the value. - An object that contains the HTML attributes to set for the element. - - - Returns a password input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - true to select the radio button; otherwise, false. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - true to select the radio button; otherwise, false. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - true to select the radio button; otherwise, false. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a text input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - - - Returns a text input element by using the specified HTML helper, the name of the form field, and the value. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - - - Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - - - Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - - - Returns a text input element. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field. - The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - A string that is used to format the input. - - - Returns a text input element. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - A string that is used to format the input. - An object that contains the HTML attributes to set for the element. - - - Returns a text input element. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - A string that is used to format the input. - An object that contains the HTML attributes to set for the element. - - - Returns a text input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element type attribute is set to "text" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Returns a text input element. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A string that is used to format the input. - The type of the model. - The type of the value. - - - Returns a text input element. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A string that is used to format the input. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns a text input element. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A string that is used to format the input. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Represents support for the HTML label element in an ASP.NET MVC view. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression using the label text. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The label text to display. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The label text. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The label text. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The type of the model. - The type of the value. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - An object that contains the HTML attributes to set for the element. - The type of the model. - The value. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression using the label text. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The label text to display. - The type of the model. - The type of the value. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The label text to display. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The label text. - An object that contains the HTML attributes to set for the element. - The type of the model. - The Value. - - - Returns an HTML label element and the property name of the property that is represented by the model. - An HTML label element and the property name of the property that is represented by the model. - The HTML helper instance that this method extends. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression using the label text. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - The label text to display. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - The label Text. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - The label text. - An object that contains the HTML attributes to set for the element. - - - Represents support for HTML links in an application. - - - Returns an anchor element (a element) for the specified link text and action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, and route values. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, route values, and HTML attributes. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes for the element. The attributes are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, and controller. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, controller, route values, and HTML attributes. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, controller, protocol, host name, URL fragment, route values, and HTML attributes. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, controller, protocol, host name, URL fragment, route values as a route value dictionary, and HTML attributes as a dictionary. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, controller, route values as a route value dictionary, and HTML attributes as a dictionary. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, and route values as a route value dictionary. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, route values as a route value dictionary, and HTML attributes as a dictionary. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Represents an HTML form element in an MVC view. - - - Initializes a new instance of the class using the specified HTTP response object. - The HTTP response object. - The parameter is null. - - - Initializes a new instance of the class using the specified view context. - An object that encapsulates the information that is required in order to render a view. - The parameter is null. - - - Releases all resources that are used by the current instance of the class. - - - Releases unmanaged and, optionally, managed resources used by the current instance of the class. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Ends the form and disposes of all form resources. - - - Gets the HTML ID and name attributes of the string. - - - Gets the ID of the string. - The HTML ID attribute value for the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the ID. - - - Gets the ID of the string - The HTML ID attribute value for the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the ID. - The type of the model. - The type of the property. - - - Gets the ID of the string. - The HTML ID attribute value for the object that is represented by the expression. - The HTML helper instance that this method extends. - - - Gets the full HTML field name for the object that is represented by the expression. - The full HTML field name for the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the name. - - - Gets the full HTML field name for the object that is represented by the expression. - The full HTML field name for the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the name. - The type of the model. - The type of the property. - - - Gets the full HTML field name for the object that is represented by the expression. - The full HTML field name for the object that is represented by the expression. - The HTML helper instance that this method extends. - - - Represents the functionality to render a partial view as an HTML-encoded string. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view to render. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view to render. - The model for the partial view. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view. - The model for the partial view. - The view data dictionary for the partial view. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view to render. - The view data dictionary for the partial view. - - - Provides support for rendering a partial view. - - - Renders the specified partial view by using the specified HTML helper. - The HTML helper. - The name of the partial view - - - Renders the specified partial view, passing it a copy of the current object, but with the Model property set to the specified model. - The HTML helper. - The name of the partial view. - The model. - - - Renders the specified partial view, replacing the partial view's ViewData property with the specified object and setting the Model property of the view data to the specified model. - The HTML helper. - The name of the partial view. - The model for the partial view. - The view data for the partial view. - - - Renders the specified partial view, replacing its ViewData property with the specified object. - The HTML helper. - The name of the partial view. - The view data. - - - Represents support for making selections in a list. - - - Returns a single-selection select element using the specified HTML helper and the name of the form field. - An HTML select element. - The HTML helper instance that this method extends. - The name of the form field to return. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, and the specified list items. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and an option label. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, and an option label. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - The text for a default empty item. This parameter can be null. - The parameter is null or empty. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and option label. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each value in the enumeration that is represented by the specified expression. - An HTML select element for each value in the enumeration that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the values to display. - The type of the model. - The type of the value. - - - Returns an HTML select element for each value in the enumeration that is represented by the specified expression. - An HTML select element for each value in the enumeration that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the values to display. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns an HTML select element for each value in the enumeration that is represented by the specified expression. - An HTML select element for each value in the enumeration that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the values to display. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns an HTML select element for each value in the enumeration that is represented by the specified expression. - An HTML select element for each value in the enumeration that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the values to display. - The text for a default empty item. This parameter can be null. - The type of the model. - The type of the value. - - - Returns an HTML select element for each value in the enumeration that is represented by the specified expression. - An HTML select element for each value in the enumeration that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the values to display. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns an HTML select element for each value in the enumeration that is represented by the specified expression. - An HTML select element for each value in the enumeration that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the values to display. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns a multi-select select element using the specified HTML helper and the name of the form field. - An HTML select element. - The HTML helper instance that this method extends. - The name of the form field to return. - The parameter is null or empty. - - - Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The parameter is null or empty. - - - Returns a multi-select select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HMTL attributes. - An HTML select element with an option subelement for each item in the list.. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items. - An HTML select element with an option subelement for each item in the list.. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an HTML select element for each property in the object that is represented by the specified expression and using the specified list items. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Represents support for HTML textarea controls. - - - Returns the specified textarea element by using the specified HTML helper and the name of the form field. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper and HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, and the text content. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, the number of rows and columns, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - The number of rows. - The number of columns. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, the number of rows and columns, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - The number of rows. - The number of columns. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The number of rows. - The number of columns. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The number of rows. - The number of columns. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Provides support for validating the input from an HTML form. - - - Gets or sets the name of the resource file (class key) that contains localized string values. - The name of the resource file (class key). - - - Retrieves the validation metadata for the specified model and applies each rule to the data field. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The parameter is null. - - - Retrieves the validation metadata for the specified model and applies each rule to the data field. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the property. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified entry in the object. - null if the entry is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - The name of the entry being validated. - An that contains the HTML attributes for the element. - The tag to be set for the wrapping HTML element of the validation message. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified entry in the object. - null if the entry is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - The name of the entry being validated. - An object that contains the HTML attributes for the element. - The tag to be set for the wrapping HTML element of the validation message. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The message to display if the specified field contains an error. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified entry in the object. - null if the model object is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - The name of the model object being validated. - The message to display if the specified entry contains an error. - An that contains the HTML attributes for the element. - The tag to be set for the wrapping HTML element of the validation message. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified entry in the object. - null if the entry is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - The name of the entry being validated. - The message to display if the specified entry contains an error. - An object that contains the HTML attributes for the element. - The tag to be set for the wrapping HTML element of the validation message. - - - Displays a validation message if an error exists for the specified entry in the object. - null if the entry is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - The name of the entry being validated. - The message to display if the specified entry contains an error. - The tag to be set for the wrapping HTML element of the validation message. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The message to display if the specified field contains an error. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for the specified expression. - null if the model object is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - An expression that identifies the object that contains the properties to render. - The message to display if a validation error occurs. - An that contains the HTML attributes for the element. - The tag to be set for the wrapping HTML element of the validation message. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for the specified expression. - null if the model object is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - An expression that identifies the object that contains the properties to render. - The message to display if a validation error occurs. - An object that contains the HTML attributes for the element. - The tag to be set for the wrapping HTML element of the validation message. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for the specified expression. - null if the model object is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - An expression that identifies the object that contains the properties to render. - The message to display if a validation error occurs. - The tag to be set for the wrapping HTML element of the validation message. - The type of the model. - The type of the property. - - - Returns an unordered list (ul element) of validation messages that are in the object. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - The message to display with the validation summary. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - The message to display with the validation summary. - A dictionary that contains the HTML attributes for the element. - - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - The message to display with the validation summary. - An object that contains the HTML attributes for the element. - - - - - Returns an unordered list (ul element) of validation messages that are in the object. - A string that contains an unordered list (ul element) of validation messages. - The HMTL helper instance that this method extends. - The message to display if the specified field contains an error. - - - Returns an unordered list (ul element) of validation messages that are in the object. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - The message to display if the specified field contains an error. - A dictionary that contains the HTML attributes for the element. - - - - Returns an unordered list (ul element) of validation messages in the object. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - - - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - The HTML markup for the value. - The HTML helper instance that this method extends. - The name of the model. - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - The HTML markup for the value. - The HTML helper instance that this method extends. - The name of the model. - The format string. - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - The HTML markup for the value. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to expose. - The model. - The property. - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - The HTML markup for the value. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to expose. - The format string. - The model. - The property. - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - The HTML markup for the value. - The HTML helper instance that this method extends. - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - The HTML markup for the value. - The HTML helper instance that this method extends. - The format string. - - - Compiles ASP.NET Razor views into classes. - - - Initializes a new instance of the class. - - - The inherits directive. - - - The model directive. - - - Extends the VBCodeParser class by adding support for the @model keyword. - - - Initializes a new instance of the class. - - - Sets a value that indicates whether the current code block and model should be inherited. - true if the code block and model is inherited; otherwise, false. - - - The Model Type Directive. - Returns void. - - - Configures the ASP.NET Razor parser and code generator for a specified file. - - - Initializes a new instance of the class. - The virtual path of the ASP.NET Razor file. - The physical path of the ASP.NET Razor file. - - - Returns the ASP.NET MVC language-specific Razor code generator. - The ASP.NET MVC language-specific Razor code generator. - The C# or Visual Basic code generator. - - - Returns the ASP.NET MVC language-specific Razor code parser using the specified language parser. - The ASP.NET MVC language-specific Razor code parser. - The C# or Visual Basic code parser. - - - - - Creates instances based on the provided factories and action. The route entries provide direct routing to the provided action. - A set of route entries. - The action descriptor. - The direct route factories. - The constraint resolver. - - - Gets a set of route factories for the given action descriptor. - A set of route factories. - The action descriptor. - - - Gets the area prefix from the provided controller. - The area prefix or null. - The controller descriptor. - - - Creates instances based on the provided factories, controller and actions. The route entries provided direct routing to the provided controller and can reach the set of provided actions. - A set of route entries. - The controller descriptor. - The action descriptors. - The direct route factories. - The constraint resolver. - - - Gets route factories for the given controller descriptor. - A set of route factories. - The controller descriptor. - - - Gets direct routes for the given controller descriptor and action descriptors based on attributes. - A set of route entries. - The controller descriptor. - The action descriptors for all actions. - The constraint resolver. - - - Gets the route prefix from the provided controller. - The route prefix or null. - The controller descriptor. - - - The default implementation of . Resolves constraints by parsing a constraint key and constraint arguments, using a map to resolve the constraint type, and calling an appropriate constructor for the constraint type. - - - - Gets the mutable dictionary that maps constraint keys to a particular constraint type. - - - - Represents a context that supports creating a direct route. - - - Initializes a new instance of the class. - The route prefix, if any, defined by the area. - The route prefix, if any, defined by the controller. - The action descriptors to which to create a route. - The inline constraint resolver. - A value indicating whether the route is configured at the action or controller level. - - - Gets the action descriptors to which to create a route. - The action descriptors to which to create a route. - - - Gets the route prefix, if any, defined by the area. - The route prefix, if any, defined by the area. - - - Gets the route prefix, if any, defined by the controller. - The route prefix, if any, defined by the controller. - - - Creates a route builder that can build a route matching this context. - A route builder that can build a route matching this context. - The route template. - - - Creates a route builder that can build a route matching this context. - A route builder that can build a route matching this context. - The route template. - The inline constraint resolver to use, if any; otherwise, null. - - - Gets the inline constraint resolver. - The inline constraint resolver. - - - Gets a value indicating whether the route is configured at the action or controller level. - true when the route is configured at the action level; otherwise false if the route is configured at the controller level. - - - Defines a builder that creates direct routes to actions (attribute routes). - - - Gets the action descriptors to which to create a route. - The action descriptors to which to create a route. - - - Creates a route entry based on the current property values. - The route entry created. - - - Gets or sets the route constraints. - The route constraints. - - - Gets or sets the route data tokens. - The route data tokens. - - - Gets or sets the route defaults. - The route defaults. - - - Gets or sets the route name. - The route name, or null if no name supplied. - - - Gets or sets the route order. - The route order. - - - Gets or sets the route precedence. - The route precedence. - - - Gets a value indicating whether the route is configured at the action or controller level. - true when the route is configured at the action level; otherwise, false if the route is configured at the controller level. - - - Gets or sets the route template. - The route template. - - - Defines a factory that creates a route directly to a set of action descriptors (an attribute route). - - - Creates a direct route entry. - The direct route entry. - The context to use to create the route. - - - Defines a provider for routes that directly target action descriptors (attribute routes). - - - Gets the direct routes for a controller. - A set of route entries for the controller. - The controller descriptor. - The action descriptors. - The inline constraint resolver. - - - Defines an abstraction for resolving inline constraints as instances of . - - - Resolves the inline constraint. - The the inline constraint was resolved to. - The inline constraint to resolve. - - - Provides information for building a System.Web.Routing.Route. - - - Gets the route template describing the URI pattern to match against. - The route template describing the URI pattern to match against. - - - Gets the name of the route to generate. - The name of the route to generate. - - - Defines a route prefix. - - - Gets the route prefix. - The route prefix. - - - Builds instances based on route information. - - - Initializes a new instance of the class using the default inline constraint resolver. - - - Initializes a new instance of the class. - The to use for resolving inline constraints. - - - Builds an for a particular action. - The generated . - The tokenized route template for the route. - The HTTP methods supported by the route. A null value specify that all possible methods are supported. - The name of the associated controller. - The name of the associated action. - The method that the route attribute has been applied on. - - - Builds an for a particular action. - The generated route. - The tokenized route template for the route. - The controller the route attribute has been applied on. - - - Builds an . - The generated . - The route defaults. - The route constraints. - The detokenized route template. - The method that the route attribute has been applied on. - - - Gets the resolver for resolving inline constraints. - The resolver for resolving inline constraints. - - - Represents a named route. - - - Initializes a new instance of the class. - The route name. - The route. - - - Gets the route name. - The route name, if any; otherwise, null. - - - Gets the route. - The route. - - - Represents an attribute route that may contain custom constraints. - - - Initializes a new instance of the class. - The route template. - - - Gets the route constraints. - The route constraints, if any; otherwise null. - - - Creates a direct route entry. - The direct route entry. - The context to use to create the route. - - - Gets the route data tokens. - The route data tokens, if any; otherwise null. - - - Gets the route defaults. - The route defaults, if any; otherwise null. - - - Gets or sets the route name. - The route name, if any; otherwise null. - - - Gets or sets the route order. - The route order. - - - Gets the route template. - The route template. - - - Constrains a route parameter to contain only lowercase or uppercase letters A through Z in the English alphabet. - - - Initializes a new instance of the class. - - - Constrains a route parameter to represent only Boolean values. - - - - - Constrains a route by several child constraints. - - - Initializes a new instance of the class. - The child constraints that must match for this constraint to match. - - - Gets the child constraints that must match for this constraint to match. - The child constraints that must match for this constraint to match. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only decimal values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only 64-bit floating-point values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only 32-bit floating-point values. - - - - - Constrains a route parameter to represent only values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only 32-bit integer values. - - - - - Constrains a route parameter to be a string of a given length or within a given range of lengths. - - - - Initializes a new instance of the class that constrains a route parameter to be a string of a given length. - The minimum length of the route parameter. - The maximum length of the route parameter. - - - Gets the length of the route parameter, if one is set. - - - - Gets the maximum length of the route parameter, if one is set. - - - Gets the minimum length of the route parameter, if one is set. - - - Constrains a route parameter to represent only 64-bit integer values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to be a string with a maximum length. - - - - - Gets the maximum length of the route parameter. - - - Constrains a route parameter to be an integer with a maximum value. - - - Initializes a new instance of the class. - The maximum value. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of parameter. - A list of parameter values. - The route direction. - - - Gets the maximum value of the route parameter. - The maximum value of the route parameter. - - - Constrains a route parameter to be a string with a maximum length. - - - Initializes a new instance of the class. - The minimum length. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the compare. - A list of parameter values. - The route direction. - - - Gets the minimum length of the route parameter. - The minimum length of the route parameter. - - - Constrains a route parameter to be a long with a minimum value. - - - Initializes a new instance of the class. - The minimum value. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the minimum value of the route parameter. - The minimum value of the route parameter. - - - Constrains a route by an inner constraint that doesn't fail when an optional parameter is set to its default value. - - - Initializes a new instance of the class. - The inner constraint to match if the parameter is not an optional parameter without a value - - - Gets the inner constraint to match if the parameter is not an optional parameter without a value. - - - - Constraints a route parameter to be an integer within a given range of values. - - - Initializes a new instance of the class. - The minimum value. - The maximum value. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the maximum value of the route parameter. - The maximum value of the route parameter. - - - Gets the minimum value of the route parameter. - The minimum value of the route parameter. - - - Constrains a route parameter to match a regular expression. - - - Initializes a new instance of the class with the specified pattern. - The pattern to match. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the regular expression pattern to match. - The regular expression pattern to match. - - - \ No newline at end of file diff --git a/lib/aspnetmvc/System.Web.Razor.dll b/lib/aspnetmvc/System.Web.Razor.dll deleted file mode 100644 index 6089cb33443..00000000000 Binary files a/lib/aspnetmvc/System.Web.Razor.dll and /dev/null differ diff --git a/lib/aspnetmvc/System.Web.Razor.xml b/lib/aspnetmvc/System.Web.Razor.xml deleted file mode 100644 index c88ee13184b..00000000000 --- a/lib/aspnetmvc/System.Web.Razor.xml +++ /dev/null @@ -1,5742 +0,0 @@ - - - - System.Web.Razor - - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a Razor code language that is based on C# syntax. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the type of the code provider. - The type of the code provider. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new Razor code generator based on C# code language. - The newly created Razor code generator based on C# code language. - The class name for the generated code. - The name of the root namespace for the generated code. - The name of the source code file. - The Razor engine host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new code parser for C# code language. - The newly created code parser for C# code language. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the name of the C# code language. - The name of the C# code language. Value is ‘csharp’. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents results from code generation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - true if the code generation is a success; otherwise, false. - The document. - The parser errors. - The generated code. - The dictionary of design-time generated code mappings. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The document. - The parser errors. - The generated code. - The dictionary of design-time generated code mappings. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The parser results. - The generated code. - The dictionary of design-time generated code mappings. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the dictionary of design-time generated code mappings. - The dictionary of design-time generated code mappings. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the generated code. - The generated code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the results of parsing a Razor document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - true if parsing was successful; otherwise, false. - The root node in the document’s syntax tree. - The list of errors which occurred during parsing. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The root node in the document’s syntax tree. - The list of errors which occurred during parsing. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the root node in the document’s syntax tree. - The root node in the document’s syntax tree. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the list of errors which occurred during parsing. - The list of errors which occurred during parsing. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether parsing was successful. - true if parsing was successful; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - Represents the base for all Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - Initializes a new instance of the class.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - Gets the type of the CodeDOM provider.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The type of the CodeDOM provider. - - - Creates the code generator for the Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The code generator for the Razor code language. - The class name. - The name of the root namespace. - The source file name. - The Razor engine host. - - - Creates the code parser for the Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The code parser for the Razor code language. - - - Gets the language of the Razor code using the specified file extension.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The language of the Razor code. - The file extension. - - - Gets the language name of the current Razor code, that is “csharp” or “vb”.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The language name of the current Razor code. - - - Gets the list of language supported by the Razor code.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The list of language supported by the Razor code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents an attribute for the Razor directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The name of the attribute. - The value of the attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether this instance is equal to a specified object. - true if the object is equal to the this instance; otherwise, false. - The object to compare with this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the name of the attribute. - The name of the attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the unique type ID of the attribute. - The unique type ID of the attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value of the attribute. - The value of the attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parser used by editors to avoid reparsing the entire document on each text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Constructs the editor parser. - The which defines the environment in which the generated code will live. - The physical path to use in line pragmas. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines if a change will cause a structural change to the document and if not, applies it to the existing tree. If a structural change would occur, automatically starts a reparse. - A value indicating the result of the incremental parse. - The change to apply to the parse tree. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current parse tree. - The current parse tree. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases all resources used by the current instance of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Event fired when a full reparse of the document completes. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the filename of the document to parse. - The filename of the document to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the auto complete string. - The auto complete string. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the host for the parse. - The host for the parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the last result of the parse was provisionally accepted for next partial parse. - true if the last result of the parse was provisionally accepted for next partial parse; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the generated code for the razor engine host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The specified code language. - - - Initializes a new instance of the class. - The specified code language. - The markup parser factory. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the languages supported by the code generator. - The languages supported that by the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a markup parser using the specified language parser for the . - A markup parser to create using the specified language parser for the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the methods as language-specific Razor code generator. - The methods as language-specific Razor code generator. - The C# or Visual Basic code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the methods as language-specific Razor code parser using the specified language parser. - The methods as language-specific Razor code parser using the specified language parser. - The C# or Visual Basic code parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the method to decorate markup parser using the specified language parser. - The method to decorate markup parser using the specified language parser. - The C# or Visual Basic code parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the default base class for the host. - The default base class for the host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the default class name for the host. - The default class name for the host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the default namespace for the host. - The default namespace for the host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the mode designs a time for the host. - true if the mode designs a time for the host; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the host that enables the instrumentation. - The host that enables the instrumentation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the generated class context for the host. - The generated class context for the host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the instrumented source file path for the host. - The instrumented source file path for the host. - - - Gets or sets whether the design time editor is using tabs or spaces for indentation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the namespace imports for the host. - The namespace imports for the host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns this method to post all the processed generated code for the host. - The code compile unit. - The generated namespace. - The generated class. - The execute method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns this method to post all the processed generated code for the host. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the static helpers for the host. - The static helpers for the host. - - - Tab size used by the hosting editor, when indenting with tabs. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents an entry-point to the Razor Template Engine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a code generator. - The created . - The name of the generated class. - The namespace in which the generated class will reside. - The file name to use in line pragmas. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a . - The created . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the default class name of the template. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the default namespace for the template. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - The name of the generated class, overriding whatever is specified in the host. - The namespace in which the generated class will reside. - The file name to use in line pragmas. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - The name of the generated class, overriding whatever is specified in the host. - The namespace in which the generated class will reside. - The file name to use in line pragmas. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - The name of the generated class, overriding whatever is specified in the host. - The namespace in which the generated class will reside. - The file name to use in line pragmas. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - The name of the generated class, overriding whatever is specified in the host. - The namespace in which the generated class will reside. - The file name to use in line pragmas. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a code core. - The results of the generated core. - The input text to parse. - The name of the generated class, overriding whatever is specified in the host. - The namespace in which the generated class will reside. - The file name to use in line pragmas. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the which defines the environment in which the generated template code will live. - The which defines the environment in which the generated template code will live. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. - The resulting parse tree. - The input text to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. - The resulting parse tree. - The input text to parse. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. - The resulting parse tree. - The input text to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. - The resulting parse tree. - The input text to parse. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template core. - The resulting parse tree. - The input text to parse. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the state of the machine. - The generic type Return. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the current state of the machine. - The current state of the machine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the starting state of the machine. - The starting state of the machine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Stays into the machine during the transition. - Transition of the state machine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Stays into the machine during the transition with the specified output. - The output of the transition. - The output. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Disables the machine upon transition. - The machine to stop. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the new transition of the state. - The new transition of the state. - The new state. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the new transition of the state with the specified output. - The new transition of the state with the specified output. - The output. - The new state. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Describes the turning process of the state. - The turning process of the state. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the state result. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The next output. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The output. - The next state. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the state has output. - true if the state has output; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the next state in the machine. - The next state in the machine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the output. - The representing the output. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a language generator and provider of the VB razor code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of CodeDomProvider. - The type of CodeDomProvider. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates the code language generator. - The code language generator. - The name of the class. - The root namespace name. - The source File name. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a code parser in a . - A code parser in a . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the language name. - The language name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the editing result of the Editor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The partial parse result. - The edited span builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the edited span of the . - The edited span of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the partial parse result. - The partial parse result. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides edit handler for implicit expression. - - - Initializes a new instance of the class. - The tokenizer. - The keywords. - true to accept trailing dot; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the expression accepts trailing dot. - true if the expression accepts trailing dot; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the parse that can accept change. - The partial parse result. - The target. - The normalized change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the specified object is equal to the current object. - true if the specified object is equal to the current objet; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the keywords associated with the expression. - The keywords associated with the expression. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this current instance. - A string representation of this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the handler editor for this webpages. - - - Initializes a new instance of the class. - The tokenizer symbols. - - - Initializes a new instance of the class. - The tokenizer symbols. - The accepted characters. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides methods for handling the span edits. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The method used to parse string into tokens. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The method used to parse string into tokens. - One of the values of the enumeration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that specifies the accepted characters. - One of the values of the enumeration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Applies the text change to the span. - The result of the apply operation. - The span to apply changes to. - The change to apply. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Applies the text change to the span. - The result of the apply operation. - The span to apply changes to. - The change to apply. - true to accept partial result; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the span can accept the specified change. - true if the span can accept the specified change; otherwise, false. - The span to check. - The change to apply. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new default span edit handler. - A newly created default span edit handler. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new default span edit handler. - A newly created default span edit handler. - The method used to parse string into tokens. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the editor hints. - The editor hints. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether this instance is equal to a specified object. - true if the object is equal to the this instance; otherwise, false. - The object to compare with this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the old text from the span content. - The old text from the span content. - The span to get old text from. - The text change which contains the location of the old text. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end of first line of the span content. - true if the specified change is at the end of first line of the span content; otherwise, false. - The span to check. - The change to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end of the span. - true if the specified change is at the end of the span; otherwise, false. - The span to check. - The change to chek. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end the span content and for deletion. - true if the specified change is at the end the span content and for deletion; otherwise, false. - The span to check. - The change to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end the span content and for insertion. - true if the specified change is at the end the span content and for insertion; otherwise, false. - The span to check. - The change to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end the span content and for replacement. - true if the specified change is at the end the span content and for replacement; otherwise, false. - The span to check. - The change to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the span owns the specified change. - true if the span owns the specified change; otherwise, false. - The span to check. - The change to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the method used to parse string into tokens. - The method used to parse string into tokens. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of the span edit handler. - The string representation of the span edit handler. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Updates the span using the normalized change. - The new span builder for the specified target. - The span to update. - The normalized change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the added import code generator for the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The string namespace. - The length of the keyword namespace. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether two object instances are equal. - true if the specified object is equal to the current object; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code with the specified parameters using the added import code generator. - The target span. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the string namespace of the generator to add import code generator. - The string namespace of the generator to add import code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of keyword namespace for the code generator. - The length of keyword namespace for the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. - A string that represents the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the attributes of the block code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The name. - The prefix string. - The suffix string. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to end the block using the specified parameters. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to start the block using the specified parameters. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this code generator. - The hash code for this code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the string name of the . - The string name of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the prefix of the code generator. - The prefix of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the suffix for the code generator. - The suffix for the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. - A string that represents the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represent the block code generator for this razor syntax. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the end of the block code generator for this razor syntax. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start of the block code generator for this razor syntax. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a hash code for the block code generator. - A hash code for the block code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a null value for the block code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the completion of event arguments for the code generation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The virtual path string. - The physical path string. - The generated code compile unit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the generated code to complete the event argument. - The generated code to complete the event argument. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the physical path for the code generation. - The physical path for the code generation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual path of the code generation. - The virtual path of the code generation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents the context of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a new generated code mapping to the collection. - The collection index of the newly added code mapping. - The source location of the generated code mapping. - The code start of the generated code mapping. - The length of the generated code mapping. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a code statement for a context call on the specified method. - The content span. - The name of the method to invoke a context call. - true to specify that the method parameter is literal; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a code statement that inserts the Razor design time helpers method in the specified code statement. - The code statement that receives the code insertion. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the specified code statement to the body of the target method. - The code statement to add the target method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the specified code statement to the body of the target method. - The code statement to add the target method. - The line pragma. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Appends the specified fragment to the current buffered statement. - The fragment to add. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Appends the specified fragment to the current buffered statement. - The fragment to add. - The source span for the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Appends the content of the span to the current buffered statement. - The source span whose content is to be added. - - - Assigns a new statement collector and returns a disposable action that restores the old statement collector. - A disposable action that restores the old statement collector. - The new statement collector. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the dictionary collection of generated code mapping. - The dictionary collection of generated code mapping. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the code compile unit that will hold the program graph. - The code compile unit that will hold the program graph. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new instance of the class. - The newly created instance of the code generator context. - The Razor engine host. - The class name for the generated class type declaration. - The name for the generated namespace declaration. - The source file. - true to enable the generation of line pragmas; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current buffered statement. - The current buffered statement. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the expression helper variable to the generated class if not yet added, - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Flushes the current buffered statement. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the generated class type declaration. - The generated class type declaration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the specified source. - The line pragma for the specified source. - The source span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the source. - The line pragma for the specified source. - The source span. - The start index of code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the source. - The line pragma for the specified source. - The source span. - The start index of code. - The length of code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the source. - The line pragma for the specified source. - The source location. - The start index of code. - The length of code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the Razor engine host. - The Razor engine host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Marks the end of generated code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Marks the start of generated code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the generated namespace declaration. - The generated namespace declaration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the source file. - The source file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the generated member method. - The generated member method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the name of text writer. - The name of text writer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a Razor code generator for C# language. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The class name for the generated class type declaration. - The name for the generated namespace declaration. - The source file. - The Razor engine host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes the context for this code generator. - The context for this code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the dynamic attributes of the block code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instances of the class. - The prefix. - The offset values. - The line values. - The col. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instances of the class. - The string prefix. - The value start. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to end the block using the specified parameters. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to start the block using the specified parameters. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the namespace prefix of the code generator. - The namespace prefix of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. - A string that represents the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the value start for the dynamic attribute block code generator. - The value start for the dynamic attribute block code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a code generator for expression. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether this instance and a specified object are equal. - true if and this instance are the same type and represent the same value; otherwise, false. - The object to compare with the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the expression. - The source span whose content represents an expression. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the end code for the block. - The target block for the end code generation. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start code for the block. - The target block the start code generation. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the string representation of this instance. - The string representation of this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a generated class context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The execute method name. - The write method name. - Write literal method name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - Execute method name. - Write method name. - Write literal method name. - Write to method name. - Write literal to method name. - Template type name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - Execute method name. - Write method name. - Write literal method name. - Write to method name. - Write literal to method name. - Template type name. - Define section method name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - Execute method name. - Write method name. - Write literal method name. - Write to method name. - Write literal to method name. - Template type name. - Define section method name. - Begin context method name. - End context method name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the context allows sections. - true if the context allows sections; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the context allows templates. - true if the context allows templates; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method before the generated context. - The name of the method before the generated context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default generated context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the execute method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the layout property. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the write attribute method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the write to attribute to method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Specifies the default name of the write literal method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Specifies the default name of the write method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that defines the section of the context. - The name of the method that defines the section of the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method after the generated context. - The name of the method after the generated context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will be invoked on the context. - The name of the method that will be invoked on the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the property name for the layout. - The property name for the layout. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are equal. - true if the two object are equal; otherwise, false. - The first object to compare. - The second object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are not equal. - true if the two object are not equal; otherwise, false. - The first object to compare. - The second object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that resolves a Url for the context. - The name of the method that resolves a Url for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the generated class supports instrumentation. - true if the generated class supports instrumentation; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the type name for the template. - The type name for the template. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that writes an attribute. - The name of the method that writes an attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write an attribute. - The name of the method where to write an attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write literal for the context. - The name of the method where to write literal for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write literal for the context. - The name of the method where to write literal for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will write on the context. - The name of the method that will write on the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will write on the context. - The name of the method that will write on the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the generated code mapping objects. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The starting line. - The starting column. - The start generated column. - The code length. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The start offset. - The starting line. - The starting column. - The start generated column. - The code length. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of the generated map codes. - The length of the generated map codes. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current generated code mapping object. - true if the specified object is equal to the current generated code mapping object; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for the generated code mapping object. - The hash code for the generated code mapping object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two specified generated code mapping objects have the same value. - true if the two specified generated code mapping objects have the same value; otherwise, false. - The left generated code mapping objects. - The right generated code mapping objects. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two specified generated code mapping objects have different values. - true the two specified generated code mapping objects have different values; otherwise, false. - The right generated code mapping objects. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the starting column of the generated code maps. - The starting column of the generated code maps. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the starting column of a generated code maps in the generated source file. - The starting column of a generated code maps in the generated source file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the starting line of the generated code maps. - The starting line of the generated code maps. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the starting offset of the generated code maps. - The starting offset of the generated code maps. - - - Returns a string that represents the current object. - A string that represents the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a helper code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The signature. - true to complete the header; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the footer for this code. - The footer for this code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block after the code. - The block to generate. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block before the code. - The block to generate. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the hash code for the current instance. - The hash code for the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the header for this code is complete. - true if the header for this code is complete; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the signature for this code. - The signature for this code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the current instance. - A string representation of the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a hybrid code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the data model from switches identified by parameters. - The target object. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates an end block code. - The target object. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start block code. - The target object. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the for the webpages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the end block code for the razor. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start block code for the razor. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a phase of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the data model with the specified target and context. - The target object. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for literal attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. . Initializes a new instance of the class. - The prefix of the literal attribute. - The value of the literal attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. . Initializes a new instance of the class. - The prefix of the literal attribute. - The value generator for the literal attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the literal attribute. - The source span whose content represents the literal attribute. - The context of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the hash code for the current instance. - The hash code for the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the prefix of the literal attribute. - The prefix of the literal attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of this instance. - The string representation of this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value of the literal attribute. - The value of the literal attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value generator for the literal attribute. - The value generator for the literal attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for markup. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the markup. - The source span whose content represents the markup. - The context of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. - The string representation for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a Razor code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The class name. - The root namespace name. - The source file name. - The host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the class name for this code. - The class name for this code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the context of this code generator. - The context of this code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the code generator is in design-time mode. - true if the code generator is in design-time mode; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the generator should generate line pragmas in the Razor code. - true if the generator should generate line pragmas in the Razor code; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the razor engine host. - The razor engine host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes the current instance. - The context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Raises the Complete event. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the root namespace. - The name of the root namespace. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the source file. - The name of the source file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the end block. - The block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the span. - The span to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the start block. - The block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the razor comment code generator for the webpages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start block code with the specified parameters. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for Razor directive attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The name of the directive attribute. - The value of the directive attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the directive attribute. - The source span whose content represents the directive attribute to generate. - The context of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the name of the directive attribute. - The name of the directive attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. - The string representation for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value of the directive attribute. - The value of the directive attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the resolve Url code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether this instance and a specified object are equal. - true if and this instance are the same type and represent the same value; otherwise, false. - The object to compare with the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the Url. - The target object. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the fully qualified type name of this instance. - The fully qualified type name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a section code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The name of the section code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block after the section code. - The target to generate. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block before the section code. - The target to generate. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the section. - The name of the section. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this current instance. - A string representation of this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for set base type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The set base type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the set base type. - The set base type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for this set base type. - The source span that contains the set base type to generate code. - The context of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Resolves the given set base type. - The resolved set base type. - The context of the code generator. - The set base type to resolve. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. - The string representation for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a code generator that sets layout for the web Razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The layout path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a layout code. - The target where to generate the code. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves a hash code for this current instance. - A hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the path of the layout code. - The path of the layout code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this current instance. - A string representation of this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the conversion of the SetVBOptionCodeGenerator of the value. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The option name. - true if the object has a value; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Converts the explicitly to the on and off value. - The explicitly converts to the on and off value. - true if the converts to on and off value; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the explicit code Dom option name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the specified parameters. - The target. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the option name for the code generator. - The option name for the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Strictly converts the to the on and off value. - The strictly converts to the on and off value. - true if the strictly converts to the on and off value; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the strict code Dom option name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a String that represents the current Object. - A String that represents the current Object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the has a value. - true if the has a value; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the span code generator for the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a code for the specified target and context parameters. - The target span. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a hash code for the span code generator. - A hash code for the span code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a null value for the span code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for the statement. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the statement. - The span source whose content contains the statement to generate. - The context of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. - The string representation for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the template block code generator of the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to end the block of the template block code generator. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to start the block for the template block code generator. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a type member code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code with a given target and context. - The target where to generate the code. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this code. - A string representation of this code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the razor code generator for VB. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The name of the class. - The root namespace. - The file name of the asset source. - The host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a visitor that executes a callback upon the completion of a visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The delegate for the span visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The delegate for the span visit. - The delegate for the error visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The delegate for the span visit. - The delegate for the error visit. - The delegate for the start block visit. - The delegate for the end block visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The delegate for the span visit. - The delegate for the error visit. - The delegate for the start block visit. - The delegate for the end block visit. - The delegate to execute for the complete event. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the synchronization context for this callback visitor. - The synchronization context for this callback visitor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the end block. - The end block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the error. - The Razor error to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the span. - The span to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the start block. - The start block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a C sharp code parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts the ‘IF’ keyword. - true if the parser accepts the ‘IF’ keyword; otherwise, false. - The keyword to accept. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Asserts a directive code. - The directive code to assert. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code contains ‘AT’ keyword. - true if the code contains ‘AT’ keyword; otherwise, false. - The keyword. - - - Indicates the base type directive. - The no type name error. - The create code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the functions directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the code that handles embedded transition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a helper directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates which class the application will derive the view from, and can therefore ensure proper type checking. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Inherits a directive core. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is at embedded transition. - true if the code is at embedded transition; otherwise, false. - true to allow templates and comments; otherwise, false. - true to allow transitions; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the code is nested. - true if the code is nested; otherwise, false. - - - Indicates whether the lines and comments is spacing token. - The function that indicates the spacing token. - true to include new lines; otherwise, false. - true to include comments; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the C sharp language keywords. - The C sharp language keywords. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the specific language for parsing. - The specific language for parsing. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the layout directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Maps the given directives. - The handler. - The directives. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the other parser used for the code. - The other parser used for the code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Spans the output of the parsing before the comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Blocks the parsing. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the reserved directive. - Determines whether the directive is a top level. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a section directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a session state directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the session state directive core. - - - Indicates the directive for session state type. - The no value error. - The create code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a directive handler. - true if successful; otherwise, false. - The directive. - The handler. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the value of the session state is valid. - true if the value of the session state is valid; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the block for this CSharpCode parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The string name. - The start of the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The CSharp symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the string name for the block. - The string name for the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the source location to start the block. - The source location to start the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the different language characteristics in a CSharp language. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a marker symbol in the code. - A marker symbol in the code. - The source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a symbol in the code. - A symbol in the code. - The source location. - The content value. - The html symbol type. - List of errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a language tokenizer. - A language tokenizer. - The source of the text document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flips the bracket symbol in the code. - The bracket symbol in the code. - The symbol bracket. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the keyword in the code. - The keyword in the code. - The keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the in the code. - The in the code. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol in the code. - A sample symbol in the code. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol in the code. - A sample symbol in the code. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the instance for the class. - The instance for the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the different language characteristics in an html. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a marker symbol in the Html. - A marker symbol in the Html. - The source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a symbol in the Html. - A symbol in the Html. - The source location. - The content value. - The html symbol type. - List of errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates an html tokenizer. - An html tokenizer. - The source of the text document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flips the bracket symbol in the html. - The bracket symbol in the html. - The symbol bracket. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the in the html. - The in the html. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol in the html. - A sample symbol in the html. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the instance for the class. - The instance for the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a parser specifically for parsing HTML markup. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Builds the span for the given content using the specified span builder. - The span builder used to build the span. - The start location. - The span content. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the function delegate used to determine the token used for HTML spacing. - The function delegate used to determine the token used for HTML spacing. - true to indicate that new lines are considered as spacing token; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the instance that defines the characteristics of HTML language. - The instance that defines the characteristics of HTML language. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the other parser for parsing HTML markup. - The other parser for parsing HTML markup. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Builds the span before the Razor comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Parses the next HTML block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Parses the HTML document. - - - Parses a section with markups given by the nesting sequences. - A tuple that specifies the markup nesting sequences. - true to indicate case-sensitive parsing; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Skips the parse until the specified condition is meet. - A function delegate that defines the condition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Skips the parse until the specified HTML symbol type is encountered. - The HTML symbol type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the HTML tags that are considered as void. - The HTML tags that are considered as void. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides methods that define the behavior of a Razor code language. - The type of the code tokenizer for the Razor language. - The type for the language symbol. - The enumeration type for the language symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a code language symbol with the specified source location as the start marker. - The symbol for the code language. - The source location as the start marker. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a code language symbol with the specified source location with the specified source location as the start marker. - The symbol for the code language. - The source location as the start marker. - The content. - The enumeration type for the language symbol. - The collection of error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a Razor code language tokenizer for the specified source document. - A Razor code language tokenizer for the specified source document. - The source document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the opposite bracket symbol for the specified bracket symbol. - The opposite bracket symbol for the specified bracket symbol. - The bracket symbol to flip. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the specific language symbol type for the given symbol type. - The specific language symbol type for the given symbol type. - The symbol type to get. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the actual symbol for the given language symbol type. - The actual symbol for the given language symbol type. - The language symbol type to get. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a comment body type. - true if the symbol is a comment body type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a comment star type. - true if the symbol is a comment star type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a comment start type. - true if the symbol is a comment start type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is an identifier type. - true if the symbol is an identifier type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a keyword type. - true if the symbol is a keyword type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol type is a known symbol type. - true if the symbol type is a known symbol type; otherwise, false. - The symbol whose type is to be checked. - The known type of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a new line type. - true if the symbol is a new line type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a transition type. - true if the symbol is a transition type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is an unknown type. - true if the symbol is an unknown type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a whitespace type. - true if the symbol is a whitespace type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is an unknown type. - true if the symbol is an unknown type; otherwise, false. - The known type of the symbol. - - - Splits the content of the code language symbol at the specified index. - A tuple of code language symbol. - The symbol whose content is to be splitted. - The index where the split occurs. - The enumeration type for the language symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Splits the specified string into tokens. - The collection of token. - The string to tokenize. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Splits the specified string into tokens. - The collection of token. - The source location as the start marker for the tokenizer. - The string to tokenize. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the parser base class for the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a span for the parser base. - The span builder. - The beginning of the source location. - The content. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the . - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the parser is a markup parser. - true if the parser is a markup parser; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the other parser . - The other parser . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Blocks the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates documentation for the parse. - - - Parses the section in ordered list of the elements. - The pair of nesting sequences. - true if the case is sensitive; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a parser whose context can be switched to either a code or a markup. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The source document. - The code parser for the context. - The markup parser for the context. - The active parser for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the active parser for the context. - The active parser for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the specified span at the end of the block builder stack. - The span to add. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the code parser for the context. - The code parser for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Parses the last span and returns the parse results that contain the newly built block. - The parse results that contain the newly built block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current block builder. - The current block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current character available from the source. - The current character available from the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that indicates whether the parser is in design mode. - true if the parser is in design mode; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates an end block from the last item of the block builder stack. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets a value that indicates whether the source status is end of file. - true if the source status is end of file; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the list of errors during parsing. - The list of errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified block type exists in the block builder list. - true if the specified block type exists in the block builder list; otherwise, false. - The block type to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the last accepted characters. - One of the values of the enumeration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the last span. - The last span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the markup parser for the context. - The markup parser for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Occurs when parse encountered error. - The source location. - The error message. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Occurs when parse encountered an error. - The source location. - The error message. - The other information about the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the text reader for the source document. - The text reader for the source document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a new block builder at the end of the block builder stack and returns a disposable action that returns an end block. - A disposable action that returns an end block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a new block builder at the end of the block builder stack and returns a disposable action that returns an end block. - A disposable action that returns an end block. - The type for the new block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Alternately switches the code parser or markup parser as the active parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that indicates whether white space is significant to ancestor block. - true is white space is significant to ancestor block; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides helper methods for the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a spacing combining mark or a non-spacing mark. - true if the specified character value is a spacing combining mark or a non-spacing mark; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a connector punctuation. - true if the specified character value is a connector punctuation; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a decimal digit number. - true if the specified character value is a decimal digit number; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is valid for use in email address. - true if the specified character value is valid for use in email address; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is used for formatting text layout or formatting text operation. - true if the specified character value is used for formatting text layout or formatting text operation.; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a hexadecimal digit number. - true if the specified character is a hexadecimal digit number; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified string value is an identifier. - true if the specified string value is an identifier; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified string value is an identifier. - true if the specified string value is an identifier; otherwise, false. - The value to check. - true to require that the identifier starts with a letter or underscore (_); otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is valid for use in identifier. - true if the specified character is valid for use in identifier; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is valid for use as start character of an identifier. - true if the specified character value is valid for use as start character of an identifier; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a letter. - true if the specified character is a letter; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a letter or a decimal digit number. - true if the specified character is a letter or a decimal digit number; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified value is a newline. - true if the specified character is a newline; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified value is a newline. - true if the specified character is a newline; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a terminating character token. - true if the specified character value is a terminating character token; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a terminating quoted string. - true if the specified character value is a terminating quoted string; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a whitespace. - true if the specified character value is a whitespace; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a whitespace or newline. - true if the specified character value is a whitespace or newline; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Sanitizes the specified input name to conform as a valid value for class name. - The sanitized class name. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a parser visitor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the cancellation token. - The cancellation token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates that a visitor method has completed execution. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified block. - The block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified black after parsing. - The block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the given razor error. - The error to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified span. - The span to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified block before parsing. - The block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides extension methods for parser visitor. - - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a Razor parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The code parser. - The markup parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. - The created . - The object to parse. - The span callback. - The error callback. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. - The created . - The object to parse. - The span callback. - The error callback. - The cancellation token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. - The created . - The object to parse. - The span callback. - The error callback. - The context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. - The created . - The object to parse. - The span callback. - The error callback. - The context. - The cancellation token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. - The created . - The object to parse. - The consumer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the design time mode. - The design time mode. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. - The parser result. - The object to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. - The object to parse. - The visitor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. - The parser result. - The object to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. - The parser result. - The object to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. - The object to parse. - The visitor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a tokenizer backed parser. - The type of tokenizer. - The type of symbol. - The type of SymbolType. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the list of symbols - The list of symbols. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the specified symbol. - The symbol to accept. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts all types of tokenizer. - true of the parser accepts all types of tokenizer; otherwise, false. - The types. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts and moves to the next tokenizer. - true if the parser accepts and moves to the next tokenizer; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts single whitespace character. - true if the parser accepts single whitespace character; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token until a token of the given type is found. - The type of the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token until a token of the given type is found and it will backup so that the next token is of the given type. - The type of the first token. - The type of the second token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the given tokens until a token of the given type is found. - The type of the first token. - The type of the second token. - The type of the third token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token until a token of the given types is found. - The types of the token. - - - Accepts token while the condition has been reached. - The condition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the token while a token of the given type is not found. - The type of the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token while the token of the given type has been reached. - The type of the first token. - The type of the second token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token while the token of the given type has been reached. - The type of the first token. - The type of the second token. - The type of the third token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token while the token of the given types has been reached. - The types. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts whitespace in lines. - true if the parser accepts whitespace in lines; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a marker symbol if necessary. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a marker symbol if necessary. - The location where to add the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token is at the specified type. - true if the token is at the specified type; otherwise, false. - The type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token is at the specified identifier. - true if the token is at the specified identifier; otherwise, false. - true to allow keywords; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parsing is balance. - true if the parsing is balance; otherwise, false. - The balancing mode. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parsing is balance. - true if the parsing is balance; otherwise, false. - The balancing mode. - The left parse. - The right parse. - The start of the mode. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a specified span. - The span to build. - The start location to build the span. - The content of the span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Configures the span. - The configuration. - - - Configures the span. - The configuration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current location of the current instance. - The current location of the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current symbol of this instance. - The current symbol of this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the tokenizer is in the end of file. - true if the tokenizer is in the end of file; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether to ensure the current parser. - true if to ensure the current parser; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the expected token with the given type. - The type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the expected token with the given types. - The types. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Handles the embedded transition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a specified span. - The span to initialize. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether this instance is at embedded transition. - true if this instance is at embedded transition; otherwise, false. - true to allow templates and comments; otherwise, false. - true to allow transitions; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the language used for parsing. - The language used for parsing. - - - Determines whether the token with the given condition would pass. - true if the token with the given condition would pass; otherwise, false. - The condition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token with the given type would pass. - true if the token with the give type would pass; otherwise, false. - The type of the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token with the given types would pass. - true if the token with the given types would pass; otherwise, false. - The types. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser advances to the next token. - true if the parser advances to the next token; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether parsing a token with the given type is optional. - true if parsing a token with the given type is optional; otherwise, false. - The type of the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether parsing a token with the given type is optional. - true if parsing a token with the given type is optional; otherwise, false. - The type of the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a token with accepted characters. - The accepted characters. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a token with span kind. - The span kind. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a token with a given span kind and accepted characters. - The span kind. - The accepted characters. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a span before the razor comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code..Gets the previous symbol of this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Pushes the span configuration. - An that shuts down the configuration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Pushes the span configuration. - An that shuts down the configuration. - The new configuration. - - - Pushes the span configuration. - An that shuts down the configuration. - The new configuration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts the transition back. - The symbols. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts the transition back. - The symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts the current transition back. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Displays the razor comment. - - - Reads a token while the condition is not reached. - The token to read. - The condition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the expected token is required. - true if the expected token is required; otherwise, false. - The expected token. - true to display an error if not found; otherwise, false. - The error base. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the associated with this instance. - The associated with this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span configuration. - The span configuration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the tokenizer. - The tokenizer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token with the given type was parsed. - true if the token with the given type was parsed; otherwise, false. - The type of the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a Visual Basic code parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts spaces in the VB code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Checks for a condition and displays a keyword in the code. - The keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Asserts the given directive. - The directive to assert. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the directive is ‘AT’ directive. - true if the directive is an ‘AT’ directive; otherwise, false. - The directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the given keyword is ‘AT’. - true if the given keyword is ‘AT’; otherwise, false. - The keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Ends a terminated directive. - The function that ends the terminated directive. - The directive. - The block type. - The code generator. - true to allow markup; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the termination of directive body is ended. - true if the termination of directive body is ended; otherwise, false. - The directive. - The block start. - true to allow all transitions; otherwise, false. - - - Ends a termination of statement. - The function that ends the termination. - The keyword. - true if the termination supports exit; otherwise, false. - true if the termination supports continue; otherwise, false. - - - Ends a termination of statement. - The function that ends the termination. - The keyword. - true if the termination supports exit; otherwise, false. - true if the termination supports continue; otherwise, false. - The block name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Handles the embedded transition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Handles the embedded transition. - The last white space. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the code that handles the Exit or Continue keyword. - The keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a code that handles a transition. - The last white space. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the code is a helper directive. - true if the code is a helper directive; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code imports a statement. - true if the code imports a statement; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code inherits a statement. - true if the code inherits a statement; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is at embedded transition. - true if the code is at embedded transition; otherwise, false. - true to allow templates and comments; otherwise, false. - true to allow transitions; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is directive defined. - true if the code is directive defined; otherwise, false. - The directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the keywords associated with the code. - The keywords associated with the code. - - - Indicates a keyword that terminates a statement. - The function that terminates the statement. - The start. - The terminator. - true if the termination supports exit; otherwise, false. - true if the termination supports continue; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the language for the parser. - The language for the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is a layout directive. - true if the code is a layout directive; otherwise, false. - - - Maps a given directive. - The directive. - The action whether to map a given directive. - - - Maps a given keyword. - The keyword. - The action whether to map a given keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a nested block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the keyword from the code is optional. - true if the keyword from the code is optional; otherwise, false. - The keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is an option statement. - true if the code is an option statement; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the other parser. - The other parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the parser block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the parser block. - The start sequence. - The end sequence. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Spans the output before Razor comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Blocks the parsing. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads a list of Visual Basic spaces. - A list of Visual Basic spaces. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the expected symbol is required. - true if the expected symbol is required; otherwise, false. - The expected symbol. - The error base. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is a reserved word. - true if the code is a reserved word; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is a section directive. - true if the code is a section directive; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code has a session state directive. - true if the code has a session state directive; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the characteristics of the Visual Basic language. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Visual Basic marker symbol. - The created Visual Basic marker symbol. - The location to create the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Visual Basic symbol. - The created . - The location to create the symbol. - The content. - The type of the symbol. - The errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Visual Basic tokenizer. - The created . - The source where to create the tokenizer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flips the given bracket. - The type of the Visual Basic symbol. - The bracket to flip. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the type of the known symbol. - The type of the known symbol. - The type to retrieve. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol with the given type. - A sample symbol with the given type. - The type of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets an instance of this . - An instance of . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the auto-complete editing handler class. - - - Initializes a new instance of the class. - The tokenizer. - - - Initializes a new instance of the class. - The tokenizer. - The accepted characters. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the auto-complete function is at the end of this span. - true if the auto-complete function is at the end of this span; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a string value to auto-complete. - A string value to auto-complete. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a parse result that can accept changes. - The phase of the target. - The normalized . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether this instance and a specified object are equal. - true if and this instance are the same type and represent the same value; otherwise, false. - The object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - A 32-bit signed integer that is the hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the fully qualified type name of this instance. - A String containing a fully qualified type name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the block for creating webpages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source for the block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the parser visitor of the block. - The parser visitor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a collection of SyntaxTreeNode to view the children of the block. - A collection of SyntaxTreeNode to view the children of the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the IBlockCodeGenerator to generate codes for the elements. - The IBlockCodeGenerator to generate codes for the elements. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current block. - true if the specified object is equal to the current block; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a value indicating whether the block is equivalent to the same element. - true if the block is equivalent to the same element; otherwise, false. - The syntax tree node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Finds the first descendent span of the block. - The first descendent span of the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Finds the last descendent span of the block. - The last descendent span of the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flattens a collection of a specified type for the block. - A collection of a specified type for the block to flatten. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the object is a block-level object. - true if the object is a block-level object; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length value of the block. - The length value of the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Locates the owner of the block. - The owner of the block to locate. - The text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the string name of the block. - The string name of the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the start to identify the specific location of the block. - The start to identify the specific location of the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. - A string that represents the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of code block. - The type of code block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the block builder for the webpages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The original block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a block for this instance. - A block builds for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the collection of child elements of the block builder. - The collection of child elements of the block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the code generator for the block builder. - The code generator for the block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the string name for the block builder. - The string name for the block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Resets the block builder to its original position. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a block type that can be assigned null. - A block type that can be assigned null. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a parsing error in Razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The error message. - The absolute index of the source location. - The line index of the source location. - The column index of the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The error message. - The absolute index of the source location. - The line index of the source location. - The column index of the source location. - The length for the error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The error message. - The source location of the error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The error message. - The source location of the error. - The length for the error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for the current instance. - The hash code for the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the length for the error. - The length for the error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the source location of the error. - The source location of the error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the error message. - The error message. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of this error instance. - The string representation of this error instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a Razor parse tree node that contains the all the content of a block node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The builder to use for this span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Accepts visit from the specified visitor. - The object that performs the visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Changes the span builder for this span. - A delegate that will be executed along with this change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Sets the start character location of this span. - The new start location to set for this span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the code generator for the span. - The code generator for the span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the content of the span. - The content of the span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the handler for span edits. - The handler for span edits. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this span. - true if the specified object is equal to this span; otherwise, false. - The object to compare to this span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified node is equivalent to this span. - true if the specified node is equal to this span; otherwise, false. - The node to compare with this span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this current span. - The hash code for this current span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that indicates whether this node is a block node. - false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the kind for this span. - One of the values of the enumeration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the length of the span content. - The length of the span content. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the next span in the tree node. - The next span in the tree node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the previous span in the tree node. - The previous span in the tree node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Replaces the span builder for this span with the specified span builder. - The new builder to use for this span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the start character location of the span. - The start character location of the span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the symbols used to generate the code for the span. - The symbols used to generate the code for the span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of this current span. - The string representation of this current span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the span builder for the syntax tree. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The original span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the given symbol for the span builder. - The symbol builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a span builder for this instance. - A span builder for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Clears the symbols of the span builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span code generator. - The span code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span edit handler of the builder. - The span edit handler of the builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span kind of the span builder. - The span kind of the span builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Resets the span builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the source location of the span builder. - The source location of the span builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the symbols for a generic read-only collection. - The symbols for a generic read-only collection. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the node for the syntax tree. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the visitor of the tree node. - The parser visitor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the syntax tree node is equivalent to given node. - true the syntax tree node is equivalent to given node; false. - The given node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the syntax tree node is a block-level object. - true if the syntax tree node is a block-level object; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length of the syntax tree node. - The length of the syntax tree node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the parent tree node of the current tree node. - The parent tree node of the current tree node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the specific source location for the syntax tree node. - The specific source location for the syntax tree node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides a lookahead buffer for the text reader. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The text reader for the buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Begins the lookahead buffering operation for this . - A disposable action that ends the lookahead buffering. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Discards the backtrack context associated the lookahead buffering operation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current character in the buffer. - The current character in the buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the current location of the character in the buffer. - The current location of the character in the buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Releases the unmanaged resources used by the current instance of this class, and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Reads the next character from the text reader and appends it to the lookahead buffer. - true if a character was read from the text reader; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Advances the buffer position to the next character. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the current character in the buffer. - The current character in the buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the current character from the buffer and advances the buffer position to the next character. - The current character from the buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a location tagged. - The type of the location tagged. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The value of the source. - The offset. - The line. - The column location of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The value of the source. - The location of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for the current instance. - The hash code for the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the location of the source. - The location of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are equal. - true if the two object are equal; otherwise, false. - The first object to compare. - The second object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Converts the specified value to a object. - true if successfully converted; otherwise, false. - The value to convert. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are not equal. - true if the two object are not equal; otherwise, false. - The first object to compare. - The second objet to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the current instance. - The string that represents the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the current instance. - A string that represents the current instance. - The format. - The format provider. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the value of the source. - The value of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the token to look for the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The action to cancel. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the resources used by the current instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a reader - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source reader. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The string content. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The text buffering. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length of the text to read. - The length of the text to read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the source of location for the text reader. - The source of location for the text reader. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the next character without changing the state of the reader or the character source. - An integer representing the next character to be read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position to seek the text reader. - The position to seek the text reader. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the next character from the text reader and advances the character position by one character. - The next character from the text reader, or -1 if no more characters are available. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The absolute index. - The line index. - The character index. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the absolute index for the source location. - The absolute index for the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds the two object. - The sum of the two object. - The first object to add. - The second object to add. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Advances the specified object to the given location. - The source location. - The location where to advance the object. - The text that advances to the given location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the character index for the source location. - The character index for the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Compares current object to the other object. - The value of the objects compared. - The object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the current object is equal to the other object. - true if the current object is equal to the other object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the line index for the source location. - The line index for the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds the two object. - The that is the sum of the two object. - The object to add. - The object to add. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two objects are equal. - true if the two objects are equal; otherwise, false. - The first object to compare. - The second object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the first object is greater than the second object. - true if the first object is greater than the second object; otherwise, false. - The first object. - The second object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are not equal. - true if the two objects are not equal; otherwise, false. - The object to compare. - The object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the first object is less than the second object. - true if the first object is greater than the second object; otherwise, false. - The first object. - The second object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - Returns . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Subtracts the first object to the second object. - The difference of the two objects. - The first object. - The second object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the source location. - A string representation of the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides a source location tracker. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The current location of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Calculates the new location of the source. - The new source location. - The last position. - The new content. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the current location of the source. - The current location of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Updates the source location. - The character to read. - The character to update. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Updates the location of the source. - The object. - The content of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides a reader for text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The text buffer to read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Begins reading the current text buffer. - An instance that stops the text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Cancels backtrack. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current location of the text buffer. - The current location of the text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the next text buffer to read. - The next text buffer to read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the current text buffer. - The current text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Describes a text change operation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The position of the text change in the snapshot immediately before the change. - The length of the old text. - An old text buffer. - The position of the text change in the snapshot immediately after the change. - The length of the new text. - A new text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Applies the specified text change. - A string that contains the value of the text. - The content of the text. - The change offset. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Applies the specified text change. - A string that contains the value of the text. - The span of the text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the hash code for this text change. - The hash code for this text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether this text change is a delete. - true if this text change is a delete; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether this text change is an insert. - true if this text change is an insert; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether this text change is a replace. - true if this text change is a replace; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a new text buffer. - A new text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of the new text. - The length of the new text. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position of the text change in the snapshot immediately after the change. - The position of the text change in the snapshot immediately after the change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the text that replaced the old text. - The text that replaced the old text. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a normalized value of this text change. - A normalized value of this text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets an old text buffer. - An old text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of the old text. - The length of the old text. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position of the text change in the snapshot immediately before the change. - The position of the text change in the snapshot immediately before the change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the text that was replaced. - The text that was replaced. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two text change are equal. - true if the two text change are equal; otherwise, false. - The left text change. - The right text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two text change are not equal. - true if the two text change are not equal; otherwise, false. - The left text change. - The right text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the text change. - A string representation of the text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides reader for text document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source to read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length of the document. - The length of the document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the location of the document. - The location of the document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the next text document to read. - The next text document to read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position of the text document. - The position of the text document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads a specified text document. - The text document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides helper functions for the CSharp tokenizer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified character can be used for identifier. - true if the specified character can be used for identifier; otherwise, false. - The character to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified character can be used as an identifier start character. - true if the specified character can be used as an identifier start character; otherwise, false. - The character to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified character is a literal suffix for real numbers. - true if the specified character is a literal suffix for real numbers; otherwise, false. - The character to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a CSharp tokenizer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a CSharp tokenizer symbol. - A CSharp tokenizer symbol. - The beginning of the source location. - The contents. - The CSharp symbol type. - A collection of razor errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the star type of the . - The star type of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor comment transition type for the . - The razor comment transition type for the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor comment type for the . - The razor comment type for the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the state of the machine. - The state of the machine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the html tokenizer of the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source for the text document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a symbol for the specified parameters of the html tokenizer. - A symbol to create for the specified parameters of the html tokenizer. - The source location. - The content string. - The type of html symbol. - The razor errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the html symbols for the razor comment star type. - The html symbols for the razor comment star type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the html symbols for the razor comment transition type. - The html symbols for the razor comment transition type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the html symbols for the razor comment type. - The html symbols for the razor comment type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the start of the state machine for the html. - The start of the state machine for the html. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The type for the language symbol. - The enumeration type for the language symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a result after the razor comment transition. - The result. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the lookahead buffer contains the expected string. - true if the lookahead buffer contains the expected string; otherwise, false. - The string to check. - true to indicate comparison is case sensitive; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the buffer for the tokenizer. - The buffer for the tokenizer. - - - Returns a function delegate, that accepts a character parameter and returns a value that indicates whether the character parameter is equal to specified character or white space. - A function delegate. - The character used to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a language symbol type for the tokenizer with the specified content. - A language symbol type for the tokenizer. - The start of the source location. - The content value. - The symbol type. - The razor error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current character in the tokenizer. - The current character. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a list of the current razor errors. - A list of the current errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current source location. - The current source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current start of the source location. - The current start of the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value whether the tokenizer current location is at the end of the file. - true if the tokenizer current location is at the end of the file; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the language end symbol type used by the tokenizer. - The language end symbol type. - The start of the source location. - The enumeration type for the language symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the language end symbol type used by the tokenizer. - The language end symbol type. - The enumeration type for the language symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value whether the tokenizer have content. - true if the tokenizer have content; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads to the next character from the code reader. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Shows the next symbol to be used. - The next symbol to be used. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the next symbol in the code. - The next symbol to read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the Razor comment body. - The object that represent the state of the result. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the star type for the razor comment. - The star type for the razor comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the transition type for the razor comment. - The transition type for the razor comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of razor comment. - The type of razor comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Sets the tokenizer status to its initial state. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Resumes using the previous language symbol type. - The previous language symbol type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Uses a single type of symbol. - A single type of symbol. - The type of symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the source of the text document. - The source of the source document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the start symbol used in this class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the next language symbol type. - The next language symbol type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Takes the string if found in the lookahead buffer into the tokenizer buffer. - true if the lookahead buffer contains the expected string; otherwise, false. - The string to match. - true to indicate comparison is case sensitive; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the current character into the buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the given input string into the buffer. - true if the whole input string was accepted; false, if only a substring was accepted. - The input string. - true to indicate comparison is case sensitive; otherwise, false. - - - Parses the source document until the condition specified by predicate is met or end file is reached. - true if the predicate condition is met; false if end of file is reached. - The predicate that specifies the processing condition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the specified parameters for the tokenizer view. - The type tokenizer. - The type symbol. - The token symbol type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The tokenizer view. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current view of the TSymbol. - The current view of the TSymbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the view can reach the end of a file. - true if the view can reach the end of a file; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the tokenizer moves to the next view. - true if the tokenizer moves to the next view; false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts a specified symbol into the tokenizer view. - The symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the source of the text document for the tokenizer view. - The source of the text document for the tokenizer view. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the tokenizer to view the symbols for the razor. - The tokenizer to view the symbols for the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a set of characters as helpers in VB. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether a specified character is enclosed in double quotation marks ("). - true if the character is enclosed in double quotation marks ("); otherwise, false. - The character. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether a character is in octal digit. - true if a character is in octal digit; otherwise, false. - The character. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether a specified character is enclosed in a single quotation mark ('). - true if the character is enclosed in a single quotation mark ('); otherwise, false. - The character. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Allows an application to break a VB symbol into tokens. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source of text. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a domain of symbols. - A domain of symbols. - The source location. - The content value. - The . - The razor error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the VB symbol type. - The VB symbol type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the transition style of the VB symbol. - The transition style of the VB symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor type comment of the . - The razor type comment of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the start state of the machine. - The start state of the machine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a C sharp symbol for the razor tokenizer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The symbol’s offset. - The line. - The column - The content of the symbol. - The type of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The symbol’s offset. - The line. - The column - The content of the symbol. - The type of the symbol. - A list of errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The location to start the symbol. - The content of the symbol. - The type of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The location to start the symbol. - The content of the symbol. - The type of the symbol. - A list of errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the symbol has an escaped identifier. - true if the symbol has an escaped identifier; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the language keyword. - The language keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the Html symbols. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The location of the symbol. - The exact line the symbol is found. - The column number the symbol is found. - The content value. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The location of the symbol. - The exact line the symbol is found. - The column number the symbol is found. - The content value. - The . - The razor error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The start of the source location. - The content value. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The start of the source location. - The content value. - The . - The razor error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents an interface for the web razor symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Changes the location of the symbol. - The new location of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of the symbol. - The content of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the starting offset of the symbol. - The location where to start the document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the location of the symbol. - The location of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a new instance of symbols. - The generic type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source location. - The content value. - The type. - The razor error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Changes the start of the machine. - The new start. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of a . - The content of a . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified Object is equal to the current Object. - true if the specified Object is equal to the current Object; otherwise, false. - The object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor error. - The razor error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves a hash code based on the current object. - A hash of the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Starts the time’s offset for the source location. - The document start. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the starting point of the source location. - The starting point of the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a string representation of the current object. - A string representation of the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a Type that inherits from the base Type. - A Type that inherits from the base Type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the symbol extensions for the web tokenizer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of this class. - The content of this class. - The symbols to provide. - The starting index of the span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of this class. - The content of this class. - The intersection with the given span. - - - Gets the content of this class. - The content of this class. - The intersection with the given span. - A list of chosen symbols. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of this class. - The content of this class. - The provided symbols. - - - Enumerates the list of Visual Basic keywords. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the VB symbol components. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The offset value. - The line value. - The column value. - The content String value. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The offset value. - The line value. - The column value. - The content String value. - The . - List of razor errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The start of the source location. - The content String value. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The start of the source location. - The content String value. - The . - List of razor errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether the current object is equal to the new object. - true if the current object is equal to the new object; otherwise, false. - The object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code to return. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the specified data sample from the object. - The specified data sample from the object. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the keyword used in the VB. - The keyword used. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - \ No newline at end of file diff --git a/lib/aspnetmvc/System.Web.WebPages.Deployment.dll b/lib/aspnetmvc/System.Web.WebPages.Deployment.dll deleted file mode 100644 index d904d0f133d..00000000000 Binary files a/lib/aspnetmvc/System.Web.WebPages.Deployment.dll and /dev/null differ diff --git a/lib/aspnetmvc/System.Web.WebPages.Deployment.xml b/lib/aspnetmvc/System.Web.WebPages.Deployment.xml deleted file mode 100644 index 7dc960bc04d..00000000000 --- a/lib/aspnetmvc/System.Web.WebPages.Deployment.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - System.Web.WebPages.Deployment - - - - Provides a registration point for pre-application start code for Web Pages deployment. - - - Registers pre-application start code for Web Pages deployment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides methods that are used to get deployment information about the Web application. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the assembly path for the Web Pages deployment. - The assembly path for the Web Pages deployment. - The Web Pages version. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the Web Pages version from the given binary path. - The Web Pages version. - The binary path for the Web Pages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the assembly references from the given path regardless of the Web Pages version. - The dictionary containing the assembly references of the Web Pages and its version. - The path to the Web Pages application. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the maximum version of the Web Pages loaded assemblies. - The maximum version of the Web Pages loaded assemblies. - - - Gets the Web Pages version from the given path. - The Web Pages version. - The path of the root directory for the application. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the Web Pages version using the configuration settings with the specified path. - The Web Pages version. - The path to the application settings. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the assemblies for this Web Pages deployment. - A list containing the assemblies for this Web Pages deployment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the Web Pages deployment is enabled. - true if the Web Pages deployment is enabled; otherwise, false. - The path to the Web Pages deployment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the Web Pages deployment is explicitly disabled. - true if the Web Pages deployment is explicitly disabled; otherwise, false. - The path to the Web Pages deployment. - - - \ No newline at end of file diff --git a/lib/aspnetmvc/System.Web.WebPages.Razor.dll b/lib/aspnetmvc/System.Web.WebPages.Razor.dll deleted file mode 100644 index 711c6ff6179..00000000000 Binary files a/lib/aspnetmvc/System.Web.WebPages.Razor.dll and /dev/null differ diff --git a/lib/aspnetmvc/System.Web.WebPages.Razor.xml b/lib/aspnetmvc/System.Web.WebPages.Razor.xml deleted file mode 100644 index bf6455588bc..00000000000 --- a/lib/aspnetmvc/System.Web.WebPages.Razor.xml +++ /dev/null @@ -1,292 +0,0 @@ - - - - System.Web.WebPages.Razor - - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the base class for the compiling path that contains event data. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The string of virtual path. - The host for the webpage razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the host for the webpage razor. - The host for the webpage razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual path for the webpage. - The virtual path for the webpage. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a build provider for Razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a virtual path dependency to the collection. - A virtual path dependency to add. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the assembly builder for Razor environment. - The assembly builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the compiler settings for Razor environment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Occurs when code generation is completed. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Occurs when code generation is started. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Occurs when compiling with a new virtual path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Razor engine host instance base on web configuration. - A Razor engine host instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the code using the provided assembly builder. - The assembly builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of the generated code. - The type of the generated code. - The results of the code compilation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates the Razor engine host instance based on the web configuration. - The Razor engine host instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Opens an internal text reader. - An internal text reader. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Raises the CompilingPath event. - The data provided for the CompilingPath event. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual path of the source code. - The virtual path of the source code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the collection of virtual path for the dependencies. - The collection of virtual path for the dependencies. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a web code razor host for the web pages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The virtual path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The virtual path. - The physical path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the class name of this instance. - The class name of this instance. - The virtual path. - - - Generates a post process code for the web code razor host. - The generator code context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the razor hosts in a webpage. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class with the specified virtual file path. - The virtual file path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class with the specified virtual and physical file path. - The virtual file path. - The physical file path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a global import on the webpage. - The notification service name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the . - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a markup parser. - A markup parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value for the DefaultBaseClass. - A value for the DefaultBaseClass. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the default class. - The name of the default class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the debug compilation is set to default. - true if the debug compilation is set to default; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the base class of the default page. - The base class of the default page. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the name of the class to which the specified webpage belongs. - The name of the class to which the specified webpage belongs. - The virtual file path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the code language specified in the webpage. - The code language specified in the webpage. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the global imports for the webpage. - The global imports for the webpage. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the file path of the instrumental source. - The file path of the instrumental source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the webpage is a special page. - true if the webpage is a special page; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the physical file system path of the razor host. - They physical file system path of the razor host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the generated code after the process. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Registers the special file with the specified file name and base type name. - The file name. - The base type name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Registers the special file with the specified file name and base type. - The file name. - The type of base file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual file path. - The virtual file path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates instances of the host files. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Loads the service description information from the configuration file and applies it to the host. - The configuration. - The webpage razor host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a default host with the specified virtual path. - A default host. - The virtual path of the file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a default host with the specified virtual and physical path. - A default host. - The virtual path of the file. - The physical file system path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Razor host. - A razor host. - The virtual path to the target file. - The physical path to the target file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a host from the configuration. - A host from the configuration. - The virtual path to the target file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a host from the configuration. - A host from the configuration. - The virtual path of the file. - The physical file system path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a host from the configuration. - A host from the configuration. - The configuration. - The virtual path of the file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a host from the configuration. - A host from the configuration. - The configuration. - The virtual path of the file. - The physical file system path. - - - Provides configuration system support for the host configuration section. - - - Initializes a new instance of the class. - - - Gets or sets the host factory. - The host factory. - - - Represents the name of the configuration section for a Razor host environment. - - - Provides configuration system support for the pages configuration section. - - - Initializes a new instance of the class. - - - Gets or sets the collection of namespaces to add to Web Pages pages in the current application. - The collection of namespaces. - - - Gets or sets the name of the page base type class. - The name of the page base type class. - - - Represents the name of the configuration section for Razor pages. - - - Provides configuration system support for the system.web.webPages.razor configuration section. - - - Initializes a new instance of the class. - - - Represents the name of the configuration section for Razor Web section. Contains the static, read-only string "system.web.webPages.razor". - - - Gets or sets the host value for system.web.webPages.razor section group. - The host value. - - - Gets or sets the value of the pages element for the system.web.webPages.razor section. - The pages element value. - - - \ No newline at end of file diff --git a/lib/aspnetmvc/System.Web.WebPages.dll b/lib/aspnetmvc/System.Web.WebPages.dll deleted file mode 100644 index cdb61e362e4..00000000000 Binary files a/lib/aspnetmvc/System.Web.WebPages.dll and /dev/null differ diff --git a/lib/aspnetmvc/System.Web.WebPages.xml b/lib/aspnetmvc/System.Web.WebPages.xml deleted file mode 100644 index 84699ef2ee0..00000000000 --- a/lib/aspnetmvc/System.Web.WebPages.xml +++ /dev/null @@ -1,2706 +0,0 @@ - - - - System.Web.WebPages - - - - Helps prevent malicious scripts from submitting forged page requests. - - - Adds an authenticating token to a form to help protect against request forgery. - Returns a string that contains the encrypted token value in a hidden HTML field. - The current object is null. - - - Adds an authenticating token to a form to help protect against request forgery and lets callers specify authentication details. - Returns the encrypted token value in a hidden HTML field. - The HTTP context data for a request. - An optional string of random characters (such as Z*7g1&p4) that is used to add complexity to the encryption for extra safety. The default is null. - The domain of a web application that a request is submitted from. - The virtual root path of a web application that a request is submitted from. - - is null. - - - Gets the search tokens. - The previous cookie token. - The new cookie token. - The form of the token. - - - Validates that input data from an HTML form field comes from the user who submitted the data. - The current value is null. - The HTTP cookie token that accompanies a valid request is missing-or-The form token is missing.-or-The form token value does not match the cookie token value.-or-The form token value does not match the cookie token value. - - - Validates that input data from an HTML form field comes from the user who submitted the data. - The cookie token value. - The token form. - - - Validates that input data from an HTML form field comes from the user who submitted the data and lets callers specify additional validation details. - The HTTP context data for a request. - An optional string of random characters (such as Z*7g1&p4) that is used to decrypt an authentication token created by the class. The default is null. - The current value is null. - The HTTP cookie token that accompanies a valid request is missing.-or-The form token is missing.-or-The form token value does not match the cookie token value.-or-The form token value does not match the cookie token value.-or-The value supplied does not match the value that was used to create the form token. - - - Provides programmatic configuration for the anti-forgery token system. - - - Gets a data provider that can provide additional data to put into all generated tokens and that can validate additional data in incoming tokens. - The data provider. - - - Gets or sets the name of the cookie that is used by the anti-forgery system. - The cookie name. - - - Gets or sets a value that indicates whether the anti-forgery cookie requires SSL in order to be returned to the server. - true if SSL is required to return the anti-forgery cookie to the server; otherwise, false. - - - Gets or sets a value that indicates whether the anti-forgery system should skip checking for conditions that might indicate misuse of the system. - true if the anti-forgery system should not check for possible misuse; otherwise, false. - - - Specifies whether to suppress the generation of X-Frame-Options header which is used to prevent ClickJacking. By default, the X-Frame-Options header is generated with the value SAMEORIGIN. If this setting is 'true', the X-Frame-Options header will not be generated for the response. - - - If claims-based authorization is in use, gets or sets the claim type from the identity that is used to uniquely identify the user. - The claim type. - - - Provides a way to include or validate custom data for anti-forgery tokens. - - - Provides additional data to store for the anti-forgery tokens that are generated during this request. - The supplemental data to embed in the anti-forgery token. - Information about the current request. - - - Validates additional data that was embedded inside an incoming anti-forgery token. - true if the data is valid, or false if the data is invalid. - Information about the current request. - The supplemental data that was embedded in the token. - - - Provides access to unvalidated form values in the object. - - - Gets a collection of unvalidated form values that were posted from the browser. - An unvalidated collection of form values. - - - Gets the specified unvalidated object from the collection of posted values in the object. - The specified member, or null if the specified item is not found. - - - Gets a collection of unvalidated query-string values. - A collection of unvalidated query-string values. - - - Excludes fields of the Request object from being checked for potentially unsafe HTML markup and client script. - - - Returns a version of form values, cookies, and query-string variables without checking them first for HTML markup and client script. - An object that contains unvalidated versions of the form and query-string values. - The object that contains values to exclude from request validation. - - - Returns a value from the specified form field, cookie, or query-string variable without checking it first for HTML markup and client script. - A string that contains unvalidated text from the specified field, cookie, or query-string value. - The object that contains values to exclude from validation. - The name of the field to exclude from validation. can refer to a form field, to a cookie, or to the query-string variable. - - - Returns all values from the Request object (including form fields, cookies, and the query string) without checking them first for HTML markup and client script. - An object that contains unvalidated versions of the form, cookie, and query-string values. - The object that contains values to exclude from validation. - - - Returns the specified value from the Request object without checking it first for HTML markup and client script. - A string that contains unvalidated text from the specified field, cookie, or query-string value. - The object that contains values to exclude from validation. - The name of the field to exclude from validation. can refer to a form field, to a cookie, or to the query-string variable. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The containing message. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The message. - The inner exception. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The error message. - The other. - - - - - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The error message. - The minimum value. - The maximum value. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The exception message. - The pattern. - - - Represents the remote rule for the validation of the model client. - - - Initializes a new instance of the class. - The error message. - The URL of the rule. - The HTTP method. - The additional fields used. - - - Represents the required rule for the validation of the model client. - - - Initializes a new instance of the class. - The error message - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a length of the validation rule of the model client. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The error message. - The minimum length of the validation rule. - The maximum length of the validation rule. - - - Contains classes and properties that are used to create HTML elements. This class is used to write helpers, such as those found in the namespace. - - - Creates a new tag that has the specified tag name. - The tag name without the "<", "/", or ">" delimiters. - - is null or empty. - - - Adds a CSS class to the list of CSS classes in the tag. - The CSS class to add. - - - Gets the collection of attributes. - The collection of attributes. - - - Replaces each invalid character in the tag ID with a valid HTML character. - The sanitized tag ID, or null if is null or empty, or if does not begin with a letter. - The ID that might contain characters to replace. - - - Replaces each invalid character in the tag ID with the specified replacement string. - The sanitized tag ID, or null if is null or empty, or if does not begin with a letter. - The ID that might contain characters to replace. - The replacement string. - - is null. - - - Generates a sanitized ID attribute for the tag by using the specified name. - The name to use to generate an ID attribute. - - - Gets or sets a string that can be used to replace invalid HTML characters. - The string to use to replace invalid HTML characters. - - - Gets or sets the inner HTML value for the element. - The inner HTML value for the element. - - - Adds a new attribute to the tag. - The key for the attribute. - The value of the attribute. - - - Adds a new attribute or optionally replaces an existing attribute in the opening tag. - The key for the attribute. - The value of the attribute. - true to replace an existing attribute if an attribute exists that has the specified value, or false to leave the original attribute unchanged. - - - Adds new attributes to the tag. - The collection of attributes to add. - The type of the key object. - The type of the value object. - - - Adds new attributes or optionally replaces existing attributes in the tag. - The collection of attributes to add or replace. - For each attribute in , true to replace the attribute if an attribute already exists that has the same key, or false to leave the original attribute unchanged. - The type of the key object. - The type of the value object. - - - Sets the property of the element to an HTML-encoded version of the specified string. - The string to HTML-encode. - - - Gets the tag name for this tag. - The name. - - - Renders the element as a element. - - - Renders the HTML tag by using the specified render mode. - The rendered HTML tag. - The render mode. - - - Enumerates the modes that are available for rendering HTML tags. - - - Represents the mode for rendering a closing tag (for example, </tag>). - - - Represents the mode for rendering normal text. - - - Represents the mode for rendering a self-closing tag (for example, <tag />). - - - Represents the mode for rendering an opening tag (for example, <tag>). - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the validation attributes from the structure or content of . - The to be implemented. - The result of the validation. - - - Contains methods to register assemblies as application parts. - - - Initializes a new instance of the class by using the specified assembly and root virtual path. - The assembly. - The root virtual path. - - is null or empty. - - - Resolves a path to the specified assembly or resource within an assembly by using the specified base virtual path and specified virtual path. - The path of the assembly or resource. - The assembly. - The base virtual path. - The virtual path. - - is not registered. - - - Adds an assembly and all web pages within the assembly to the list of available application parts. - The application part. - - is already registered. - - - Provides objects and methods that are used to execute and render ASP.NET Web Pages application start pages (_AppStart.cshtml or _AppStart.vbhtml files). - - - Initializes a new instance of the class. - - - Gets the HTTP application object that references this application startup page. - The HTTP application object that references this application startup page. - - - The prefix that is applied to all keys that are added to the cache by the application start page. - - - Gets the object that represents context data that is associated with this page. - The current context data. - - - Returns the text writer instance that is used to render the page. - The text writer. - - - Gets the output from the application start page as an HTML-encoded string. - The output from the application start page as an HTML-encoded string. - - - Gets the text writer for the page. - The text writer for the page. - - - The path to the application start page. - - - Gets or sets the virtual path of the page. - The virtual path. - - - Writes the string representation of the specified object as an HTML-encoded string. - The object to encode and write. - - - Writes the specified object as an HTML-encoded string. - The helper result to encode and write. - - - Writes the specified object without HTML encoding. - The object to write. - - - Stores the value for an attribute.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - Initializes a new instance of the class.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The namespace prefix for the attribute. - The value for the attribute. - true to indicate that the value is a literal value; otherwise, false. - - - Creates an attribute value from the specified tuple object. - The created attribute value. - The tuple object from which to create from. - - - Creates an attribute value from the specified tuple object. - The created attribute value. - The tuple object from which to create from. - - - Gets or sets a value that indicates whether the value is a literal value.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - true if the value is a literal value; otherwise, false. - - - Creates an attribute value from the specified tuple object. - The created attribute value. - The tuple object from which to create from. - - - Creates an attribute value from the specified tuple object. - The created attribute value. - The tuple object from which to create from. - - - Gets or sets the namespace prefix for the attribute.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The namespace prefix for the attribute. - - - Gets or set the value for the attribute.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The value for the attribute. - - - Provides a way to specify custom browser (user agent) information. - - - Removes any overridden user agent for the current request. - The current context. - - - Returns the browser capabilities object for the overridden browser capabilities or for the actual browser if no override has been specified. - The browser capabilities. - The current context. - - - Returns the overridden user agent value or the actual user agent string if no override has been specified. - The user agent string - The current context. - - - Gets a string that varies based on the type of the browser. - A string that identifies the browser. - The current context. - - - Gets a string that varies based on the type of the browser. - A string that identifies the browser. - The current context base. - - - Overrides the request's actual user agent value using the specified user agent. - The current context. - The user agent to use. - - - Overrides the request's actual user agent value using the specified browser override information. - The current context. - One of the enumeration values that represents the browser override information to use. - - - Specifies browser types that can be defined for the method. - - - Specifies a desktop browser. - - - Specifies a mobile browser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.The current BrowserOverrideStore is used to get and set the user agent of a request. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Looks for a user agent by searching for the browser override cookie. - The user agent. - The HTTP context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a browser override cookie with the set user agent to the response of the current request. - The HTTP context. - The user agent. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets overridden user agent for a request from a cookie. Creates a cookie to set the overridden user agent. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The days to expire. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Looks for a user agent by searching for the browser override cookie. - The user agent. - The HTTP context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a browser override cookie with the set user agent to the response of the current request. - The HTTP context. - The user agent. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the default display mode of the web pages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The suffix. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether the can handle context. - true if the can handle context; otherwise, false. - The specified http context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the context condition displays a default mode. - true if the context condition displays a default mode; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the display mode identifier of the web pages. - The display mode identifier of the web pages. - - - Retrieves the display information about an item in the result pane. - The display information about an item in the result pane. - The http context. - The virtual path. - true if the virtual path exists; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Transforms the path of the display mode. - The path of the display mode to transform. - The virtual path. - The suffix. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a property’s display information. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The virtual path. - The active display mode. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the active display mode for a Web page. - The active display mode for a Web page. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual path of the current Web page. - The virtual path of the current Web page. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the modes of display for the provider. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default display mode identifier. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a list of the available display modes for the context base. - A list of the available display modes for the context base. - The http context base. - The current display mode. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the for the virtual path. - The for the virtual path. - The virtual path. - The http context base. - true if the virtual path exists; otherwise, false. - The current display mode. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the instance of the . - The instance of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the mobile display mode identifier. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a list of modes of the . - A list of modes of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the Web page requires consistent display mode. - true if the Web page requires consistent display mode; otherwise, false. - - - Represents a base class for pages that is used when ASP.NET compiles a .cshtml or .vbhtml file and that exposes page-level and application-level properties and methods. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - Gets the application-state data as a object that callers can use to create and access custom application-scoped properties. - The application-state data. - - - Gets a reference to global application-state data that can be shared across sessions and requests in an ASP.NET application. - The application-state data. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts all the helper statements into the context of the helper page. - The text writer. - The helper virtual path. - The starting position. - The length of the context. - true of the context has a literal attribute; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts all the helper statements into the context of the helper page. - The helper virtual path. - The starting position. - The length of the context. - true of the context has a literal attribute; otherwise, false. - - - Gets the cache object for the current application domain. - The cache object. - - - Gets the object that is associated with a page. - The current context data. - - - Gets the current page for this helper page. - The current page. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the end of context block. - The text writer. - The helper virtual path. - The starting position. - The length of the context. - true of the context has a literal attribute; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the end of context block. - The helper virtual path. - The starting position. - The length of the context. - true of the context has a literal attribute; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the path of the helper page. - The path of the helper page. - - - Builds an absolute URL from an application-relative URL by using the specified parameters. - The absolute URL. - The initial path to use in the URL. - Additional path information, such as folders and subfolders. - - - Gets the object that is associated with a page. - An object that supports rendering HTML form controls in a page. - - - Gets a value that indicates whether Ajax is being used during the request of the web page. - true if Ajax is being used during the request; otherwise, false. - - - Gets a value that indicates whether the current request is a post (submitted using the HTTP POST verb). - true if the HTTP verb is POST; otherwise, false. - - - Gets the model that is associated with a page. - An object that represents a model that is associated with the view data for a page. - - - Gets the state data for the model that is associated with a page. - The state of the model. - - - Gets property-like access to page data that is shared between pages, layout pages, and partial pages. - An object that contains page data. - - - Gets and sets the HTTP context for the web page. - The HTTP context for the web page. - - - Gets array-like access to page data that is shared between pages, layout pages, and partial pages. - An object that provides array-like access to page data. - - - Gets the object for the current HTTP request. - An object that contains the HTTP values that were sent by a client during a web request. - - - Gets the object for the current HTTP response. - An object that contains the HTTP-response information from an ASP.NET operation. - - - Gets the object that provides methods that can be used as part of web-page processing. - The object. - - - Gets the object for the current HTTP request. - The object for the current HTTP request. - - - Gets data related to the URL path. - Data related to the URL path. - - - Gets a user value based on the HTTP context. - A user value based on the HTTP context. - - - Gets the virtual path of the page. - The virtual path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes an attribute associated with the helper. - The text writer. - The name of the attribute. - The prefix. - The suffix. - The attribute value. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes a literal object to the helper. - The text writer. - The value of the object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes a helper result object to the helper. - The text writer - The helper result. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes an object to the helper. - The text writer. - The object value. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes a helper result object to the helper. - The text writer. - The helper result value. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the display mode interface for the web pages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether the web pages can handle HTTP context. - true if the web pages can handle HTTP context; otherwise, false. - The HTTP context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the display mode id for the web pages. - The display mode id for the web pages. - - - Returns this method to display all the information for the web pages. - The method to display all the information for the web pages. - The HTTP context. - The virtual path. - true if the virtual path exists; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the properties and methods that objects that participate in webpages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a container for client validation for the required field. - A container for client validation for the required field. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Evaluates the condition it checks and updates the validation context. - The condition it checks and updates the validation context. - The validation context. - - - Defines methods that are implemented by virtual path handler factories. - - - Creates a handler factory for the specified virtual path. - A handler factory for the specified virtual path. - The virtual path. - - - Determines whether the specified virtual path is associated with a handler factory. - true if a handler factory exists for the specified virtual path; otherwise, false. - The virtual path. - - - Defines methods to implement an executor class that can execute the code on a web page. - - - Executes the code on the specified web page. - true if the executor took over execution of the web page; otherwise, false. - The web page. - - - Represents a path attribute for a web page class. - - - Initializes a new instance of the class by using the specified virtual path. - The virtual path. - - - Gets the virtual path of the current web page. - The virtual path. - - - Provides a registration point for pre-application start code for web pages. - - - Registers pre-application start code for web pages. - - - Defines extension methods for the class. - - - Determines whether the specified URL references the local computer. - true if the specified URL references the local computer; otherwise, false. - The HTTP request object. - The URL to test. - - - Serves as the abstract base class for the validation helper classes. - - - Initializes a new instance of the derived class and specifies the name of the HTML element that is being validated. - The name (value of the name attribute) of the user input element to validate. - - - Initializes a new instance of the derived class, registers the specified string as the error message to display if no value is supplied, and specifies whether the method can use unvalidated data. - The error message. - true to use unvalidated user input; false to reject unvalidated data. This parameter is set to true by calling methods in circumstances when the actual value of the user input is not important, such as for required fields. - - - When implemented in a derived class, gets a container for client validation for the required field. - The container. - - - Returns the HTTP context of the current request. - The context. - The validation context. - - - Returns the value to validate. - The value to validate. - The current request. - The name of the field from the current request to validate. - - - Returns a value that indicates whether the specified value is valid. - true if the value is valid; otherwise, false. - The current context. - The value to validate. - - - Performs the validation test. - The result of the validation test. - The context. - - - Defines extension methods for the base class. - - - Configures the cache policy of an HTTP response instance. - The HTTP response instance. - The length of time, in seconds, before items expire from the cache. - true to indicate that items expire from the cache on a sliding basis; false to indicate that items expire when they reach the predefined expiration time. - The list of all parameters that can be received by a GET or POST operation that affect caching. - The list of all HTTP headers that affect caching. - The list of all Content-Encoding headers that affect caching. - One of the enumeration values that specifies how items are cached. - - - Sets the HTTP status code of an HTTP response using the specified integer value. - The HTTP response instance. - The HTTP status code. - - - Sets the HTTP status code of an HTTP response using the specified HTTP status code enumeration value. - The HTTP response instance. - The HTTP status code - - - Writes a sequence of bytes that represent binary content of an unspecified type to the output stream of an HTTP response. - The HTTP response instance. - An array that contains the bytes to write. - - - Writes a sequence of bytes that represent binary content of the specified MIME type to the output stream of an HTTP response. - The receiving HTTP response instance. - An array that contains the bytes to write. - The MIME type of the binary content. - - - Provides a delegate that represents one or more methods that are called when a content section is written. - - - Provides methods and properties that are used to render start pages that use the Razor view engine. - - - Initializes a new instance of the class. - - - Gets or sets the child page of the current start page. - The child page of the current start page. - - - Gets or sets the context of the page. - The context of the page. - - - Calls the methods that are used to execute the developer-written code in the _PageStart start page and in the page. - - - Returns the text writer instance that is used to render the page. - The text writer. - - - Returns the initialization page for the specified page. - The _AppStart page if the _AppStart page exists. If the _AppStart page cannot be found, returns the _PageStart page if a _PageStart page exists. If the _AppStart and _PageStart pages cannot be found, returns . - The page. - The file name of the page. - The collection of file-name extensions that can contain ASP.NET Razor syntax, such as "cshtml" and "vbhtml". - Either or are null. - - is null or empty. - - - Gets or sets the path of the layout page for the page. - The path of the layout page for the page. - - - Gets property-like access to page data that is shared between pages, layout pages, and partial pages. - An object that contains page data. - - - Gets array-like access to page data that is shared between pages, layout pages, and partial pages. - An object that provides array-like access to page data. - - - Renders the page. - The HTML markup that represents the web page. - The path of the page to render. - Additional data that is used to render the page. - - - Executes the developer-written code in the page. - - - Writes the string representation of the specified object as an HTML-encoded string. - The object to encode and write. - - - Writes the string representation of the specified object as an HTML-encoded string. - The helper result to encode and write. - - - Writes the string representation of the specified object without HTML encoding. - The object to write. - - - Provides utility methods for converting string values to other data types. - - - Converts a string to a strongly typed value of the specified data type. - The converted value. - The value to convert. - The data type to convert to. - - - Converts a string to the specified data type and specifies a default value. - The converted value. - The value to convert. - The value to return if is null. - The data type to convert to. - - - Converts a string to a Boolean (true/false) value. - The converted value. - The value to convert. - - - Converts a string to a Boolean (true/false) value and specifies a default value. - The converted value. - The value to convert. - The value to return if is null or is an invalid value. - - - Converts a string to a value. - The converted value. - The value to convert. - - - Converts a string to a value and specifies a default value. - The converted value. - The value to convert. - The value to return if is null or is an invalid value. The default is the minimum time value on the system. - - - Converts a string to a number. - The converted value. - The value to convert. - - - Converts a string to a number and specifies a default value. - The converted value. - The value to convert. - The value to return if is null or invalid. - - - Converts a string to a number. - The converted value. - The value to convert. - - - Converts a string to a number and specifies a default value. - The converted value. - The value to convert. - The value to return if is null. - - - Converts a string to an integer. - The converted value. - The value to convert. - - - Converts a string to an integer and specifies a default value. - The converted value. - The value to convert. - The value to return if is null or is an invalid value. - - - Checks whether a string can be converted to the specified data type. - true if can be converted to the specified type; otherwise, false. - The value to test. - The data type to convert to. - - - Checks whether a string can be converted to the Boolean (true/false) type. - true if can be converted to the specified type; otherwise, false. - The string value to test. - - - Checks whether a string can be converted to the type. - true if can be converted to the specified type; otherwise, false. - The string value to test. - - - Checks whether a string can be converted to the type. - true if can be converted to the specified type; otherwise, false. - The string value to test. - - - Checks whether a string value is null or empty. - true if is null or is a zero-length string (""); otherwise, false. - The string value to test. - - - Checks whether a string can be converted to the type. - true if can be converted to the specified type; otherwise, false. - The string value to test. - - - Checks whether a string can be converted to an integer. - true if can be converted to the specified type; otherwise, false. - The string value to test. - - - Contains methods and properties that describe a file information template. - - - Initializes a new instance of the class by using the specified virtual path. - The virtual path. - - - Gets the virtual path of the web page. - The virtual path. - - - Represents a last-in-first-out (LIFO) collection of template files. - - - Returns the current template file from the specified HTTP context. - The template file, removed from the top of the stack. - The HTTP context that contains the stack that stores the template files. - - - Removes and returns the template file that is at the top of the stack in the specified HTTP context. - The template file, removed from the top of the stack. - The HTTP context that contains the stack that stores the template files. - - is null. - - - Inserts a template file at the top of the stack in the specified HTTP context. - The HTTP context that contains the stack that stores the template files. - The template file to push onto the specified stack. - - or are null. - - - Implements validation for user input. - - - Registers a list of user input elements for validation. - The names (value of the name attribute) of the user input elements to validate. - The type of validation to register for each user input element specified in . - - - Registers a user input element for validation. - The name (value of the name attribute) of the user input element to validate. - A list of one or more types of validation to register. - - - Adds an error message. - The error message. - - - Renders an attribute that references the CSS style definition to use when validation messages for the user input element are rendered. - The attribute. - The name (value of the name attribute) of the user input element to validate. - - - Renders attributes that enable client-side validation for an individual user input element. - The attributes to render. - The name (value of the name attribute) of the user input element to validate. - - - Gets the name of the current form. This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The name. - - - Returns a list of current validation errors, and optionally lets you specify a list of fields to check. - The list of errors. - Optional. The names (value of the name attribute) of the user input elements to get error information for. You can specify any number of element names, separated by commas. If you do not specify a list of fields, the method returns errors for all fields. - - - Gets the name of the class that is used to specify the appearance of error-message display when errors have occurred. This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The name. - - - Determines whether the contents of the user input fields pass validation checks, and optionally lets you specify a list of fields to check. - true if all specified field or fields pass validation checks; false if any field contains a validation error. - Optional. The names (value of the name attribute) of the user input elements to check for validation errors. You can specify any number of element names, separated by commas. If you do not specify a list of fields, the method checks all elements that are registered for validation. - - - Registers the specified field as one that requires user entry. - The name (value of the name attribute) of the user input element to validate. - - - Registers the specified field as one that requires user entry and registers the specified string as the error message to display if no value is supplied. - The name (value of the name attribute) of the user input element to validate. - The error message. - - - Registers the specified fields as ones that require user entry. - The names (value of the name attribute) of the user input elements to validate. You can specify any number of element names, separated by commas. - - - Performs validation on elements registered for validation, and optionally lets you specify a list of fields to check. - The list of errors for the specified fields, if any validation errors occurred. - Optional. The names (value of the name attribute) of the user input elements to validate. You can specify any number of element names, separated by commas. If you do not specify a list, the method validates all registered elements. - - - Gets the name of the class that is used to specify the appearance of error-message display when errors have occurred. This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The name. - - - Defines validation tests that can be registered using the method. - - - Initializes a new instance of the class. - - - Defines a validation test that tests whether a value can be treated as a date/time value. - The validation test. - The error message to display if validation fails. - - - Defines a validation test that tests whether a value can be treated as a decimal number. - The validation test. - The error message to display if validation fails. - - - Defines a validation test that test user input against the value of another field. - The validation test. - The other field to compare. - The error message to display if validation fails. - - - Defines a validation test that tests whether a value can be treated as a floating-point number. - The validation test. - The error message to display if validation fails. - - - Defines a validation test that tests whether a value can be treated as an integer. - The validation test. - The error message to display if validation fails. - - - Defines a validation test that tests whether a decimal number falls within a specific range. - The validation test. - The minimum value. The default is 0. - The maximum value. - The error message to display if validation fails. - - - Defines a validation test that tests whether an integer value falls within a specific range. - The validation test. - The minimum value. The default is 0. - The maximum value. - The error message to display if validation fails. - - - Defines a validation test that tests a value against a pattern specified as a regular expression. - The validation test. - The regular expression to use to test the user input. - The error message to display if validation fails. - - - Defines a validation test that tests whether a value has been provided. - The validation test. - The error message to display if validation fails. - - - Defines a validation test that tests the length of a string. - The validation test. - The maximum length of the string. - The minimum length of the string. The default is 0. - The error message to display if validation fails. - - - Defines a validation test that tests whether a value is a well-formed URL. - The validation test. - The error message to display if validation fails. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - Represents an ASP.NET Razor page. - - - Called from a derived class to create a new instance that is based on the class. - - - Gets or sets the object that is associated with a page. - The current context data. - - - Executes the code in a set of dependent pages. - - - Gets the object that is associated with a page. - An object that can render HTML form controls in a page. - - - Initializes an object that inherits from the class. - - - Gets the model that is associated with a page. - An object that represents a model that is associated with the view data for a page. - - - Gets the state of the model that is associated with a page. - The state of the model. - - - Adds a class to a list of classes that handle page execution and that implement custom features for pages. - The class to add. - - - Renders a content page. - An object that can write the output of the page. - The path of the page to render. - Data to pass to the page. - - - Gets the validation helper for the current page context. - The validation helper. - - - Serves as the base class for classes that represent an ASP.NET Razor page. - - - Initializes the class for use by an inherited class instance. This constructor can only be called by an inherited class. - - - When overridden in a derived class, configures the current web page based on the configuration of the parent web page. - The parent page from which to read configuration information. - - - Creates a new instance of the class by using the specified virtual path. - The new object. - The virtual path to use to create the instance. - - - Attempts to create a WebPageBase instance from a virtualPath and wraps complex compiler exceptions with simpler messages - - - Called by content pages to create named content sections. - The name of the section to create. - The type of action to take with the new section. - - - Executes the code in a set of dependent web pages. - - - Executes the code in a set of dependent web pages by using the specified parameters. - The context data for the page. - The writer to use to write the executed HTML. - - - Executes the code in a set of dependent web pages by using the specified context, writer, and start page. - The context data for the page. - The writer to use to write the executed HTML. - The page to start execution in the page hierarchy. - - - Returns the text writer instance that is used to render the page. - The text writer. - - - Initializes the current page. - - - Returns a value that indicates whether the specified section is defined in the page. - true if the specified section is defined in the page; otherwise, false. - The name of the section to search for. - - - Gets or sets the path of a layout page. - The path of the layout page. - - - Gets the current object for the page. - The object. - - - Gets the stack of objects for the current page context. - The objects. - - - Provides property-like access to page data that is shared between pages, layout pages, and partial pages. - An object that contains page data. - - - Provides array-like access to page data that is shared between pages, layout pages, and partial pages. - A dictionary that contains page data. - - - Returns and removes the context from the top of the instance. - - - Inserts the specified context at the top of the instance. - The page context to push onto the instance. - The writer for the page context. - - - In layout pages, renders the portion of a content page that is not within a named section. - The HTML content to render. - - - Renders the content of one page within another page. - The HTML content to render. - The path of the page to render. - (Optional) An array of data to pass to the page being rendered. In the rendered page, these parameters can be accessed by using the property. - - - In layout pages, renders the content of a named section. - The HTML content to render. - The section to render. - The section was already rendered.-or-The section was marked as required but was not found. - - - In layout pages, renders the content of a named section and specifies whether the section is required. - The HTML content to render. - The section to render. - true to specify that the section is required; otherwise, false. - - - Writes the specified object as an HTML-encoded string. - The object to encode and write. - - - Writes the specified object as an HTML-encoded string. - The helper result to encode and write. - - - Writes the specified object without HTML-encoding it first. - The object to write. - - - Contains data that is used by a object to reference details about the web application, the current HTTP request, the current execution context, and page-rendering data. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified context, page, and model. - The HTTP request context data to associate with the page context. - The page data to share between pages, layout pages, and partial pages. - The model to associate with the view data. - - - Gets a reference to the current object that is associated with a page. - The current page context object. - - - Gets the model that is associated with a page. - An object that represents a model that is associated with the view data for a page. - - - Gets the object that is associated with a page. - The object that renders the page. - - - Gets the page data that is shared between pages, layout pages, and partial pages. - A dictionary that contains page data. - - - Provides objects and methods that are used to execute and render ASP.NET pages that include Razor syntax. - - - Initializes a new instance of the class. This constructor can only be called by an inherited class. - - - - - - - - - When overridden in a derived class, gets or sets the object that is associated with a page. - The current context data. - - - - - - - - Returns the text writer instance that is used to render the page. - The text writer. - - - - - - - - Writes the string representation of the specified object as an HTML-encoded string. - The object to encode and write. - - - Writes the specified object as an HTML-encoded string. - The helper result to encode and write. - - - - - - Writes the specified object without HTML encoding. - The object to write. - - - Writes the specified object to the specified instance without HTML encoding. - The text writer. - The object to write. - - - Writes the specified object as an HTML-encoded string to the specified text writer. - The text writer. - The object to encode and write. - - - Writes the specified object as an HTML-encoded string to the specified text writer. - The text writer. - The helper result to encode and write. - - - Provides methods and properties that are used to process specific URL extensions. - - - Initializes a new instance of the class by using the specified web page. - The web page to process. - - is null. - - - Creates a new handler object from the specified virtual path. - A object for the specified virtual path. - The virtual path to use to create the handler. - - - Gets or sets a value that indicates whether web page response headers are disabled. - true if web page response headers are disabled; otherwise, false. - - - Returns a list of file name extensions that the current instance can process. - A read-only list of file name extensions that are processed by the current instance. - - - Gets a value that indicates whether another request can use the instance. - true if the instance is reusable; otherwise, false. - - - Processes the web page by using the specified context. - The context to use when processing the web page. - - - Adds a file name extension to the list of extensions that are processed by the current instance. - The extension to add, without a leading period. - - - The HTML tag name (X-AspNetWebPages-Version) for the version of the ASP.NET Web Pages specification that is used by this web page. - - - Provides methods and properties that are used to render pages that use the Razor view engine. - - - Initializes a new instance of the class. - - - - - - When overridden in a derived class, calls the methods that are used to initialize the page. - - - - - When overridden in a derived class, gets or sets the path of a layout page. - The path of a layout page. - - - When overridden in a derived class, provides property-like access to page data that is shared between pages, layout pages, and partial pages. - An object that contains page data. - - - - When overridden in a derived class, provides array-like access to page data that is shared between pages, layout pages, and partial pages. - An object that provides array-like access to page data. - - - - When overridden in a derived class, renders a web page. - The markup that represents the web page. - The path of the page to render. - Additional data that is used to render the page. - - - - - - - - - - - Provides support for rendering HTML form controls and performing form validation in a web page. - - - Creates a dictionary of HTML attributes from the input object, translating underscores to dashes. - A dictionary that represents HTML attributes. - Anonymous object describing HTML attributes. - - - Returns an HTML-encoded string that represents the specified object by using a minimal encoding that is suitable only for HTML attributes that are enclosed in quotation marks. - An HTML-encoded string that represents the object. - The object to encode. - - - Returns an HTML-encoded string that represents the specified string by using a minimal encoding that is suitable only for HTML attributes that are enclosed in quotation marks. - An HTML-encoded string that represents the original string. - The string to encode. - - - Returns an HTML check box control that has the specified name. - The HTML markup that represents the check box control. - The value to assign to the name attribute of the HTML control element. - - is null or empty. - - - Returns an HTML check box control that has the specified name and default checked status. - The HTML markup that represents the check box control. - The value to assign to the name attribute of the HTML control element. - true to indicate that the checked attribute is set to checked; otherwise, false. - - is null or empty. - - - Returns an HTML check box control that has the specified name, default checked status, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the check box control. - The value to assign to the name attribute of the HTML control element. - true to indicate that the checked attribute is set to checked; otherwise, false. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML check box control that has the specified name, default checked status, and custom attributes defined by an attribute object. - The HTML markup that represents the check box control. - The value to assign to the name attribute of the HTML control element. - true to indicate that the checked attribute is set to checked; otherwise, false. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML check box control that has the specified name and custom attributes defined by an attribute dictionary. - The HTML markup that represents the check box control. - The value to assign to the name attribute of the HTML control element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML check box control that has the specified name and custom attributes defined by an attribute object. - The HTML markup that represents the check box control. - The value to assign to the name attribute of the HTML control element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name and that contains the specified list items. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name, and that contains the specified list items and default item. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items and default item. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items and default item. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name, custom attributes defined by an attribute dictionary, and default selection, and that contains the specified list items and default item. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - The value that specifies the item in the list that is selected by default. The selected item is the first item in the list whose value matches the parameter (or whose text matches, if there is no value.) - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name, custom attributes defined by an attribute object, and default selection, and that contains the specified list items and default item. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - The value that specifies the item in the list that is selected by default. The item that is selected is the first item in the list that has a matching value, or that matches the items displayed text if the item has no value. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML-encoded string that represents the specified object by using a full encoding that is suitable for arbitrary HTML. - An HTML-encoded string that represents the object. - The object to encode. - - - Returns an HTML-encoded string that represents the specified string by using a full encoding that is suitable for arbitrary HTML. - An HTML-encoded string that represents the original string. - The string to encode. - - - Returns an HTML hidden control that has the specified name. - The HTML markup that represents the hidden control. - The value to assign to the name attribute of the HTML control element. - - is null or empty. - - - Returns an HTML hidden control that has the specified name and value. - The HTML markup that represents the hidden control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - - is null or empty. - - - Returns an HTML hidden control that has the specified name, value, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the hidden control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML hidden control that has the specified name, value, and custom attributes defined by an attribute object. - The HTML markup that represents the hidden control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Gets or sets the character that is used to replace the dot (.) in the id attribute of rendered form controls. - The character that is used to replace the dot in the id attribute of rendered form controls. The default is an underscore (_). - - - Returns an HTML label that displays the specified text. - The HTML markup that represents the label. - The text to display. - - is null or empty. - - - Returns an HTML label that displays the specified text and that has the specified custom attributes. - The HTML markup that represents the label. - The text to display. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML label that displays the specified text and that has the specified for attribute. - The HTML markup that represents the label. - The text to display. - The value to assign to the for attribute of the HTML control element. - - is null or empty. - - - Returns an HTML label that displays the specified text, and that has the specified for attribute and custom attributes defined by an attribute dictionary. - The HTML markup that represents the label. - The text to display. - The value to assign to the for attribute of the HTML control element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML label that displays the specified text, and that has the specified for attribute and custom attributes defined by an attribute object. - The HTML markup that represents the label. - The text to display. - The value to assign to the for attribute of the HTML control element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML list box control that has the specified name and that contains the specified list items. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - - is null or empty. - - - Returns an HTML list box control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML list box control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML list box control that has the specified name, size, list items, and default selections, and that specifies whether multiple selections are enabled. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. - The value to assign to the size attribute of the element. - true to indicate that the multiple selections are enabled; otherwise, false. - - is null or empty. - - - Returns an HTML list box control that has the specified name, and that contains the specified list items and default item. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list box. - - is null or empty. - - - Returns an HTML list box control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items and default item. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML list box control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items and default item. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list box. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML list box control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items, default item, and selections. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML list box control that has the specified name, size, items, default item, and selections, and that specifies whether multiple selections are enabled. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. - The value to assign to the size attribute of the element. - true to indicate that multiple selections are enabled; otherwise, false. - - is null or empty. - - - Returns an HTML list box control that has the specified name, size, custom attributes defined by an attribute dictionary, items, default item, and selections, and that specifies whether multiple selections are enabled. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. - The value to assign to the size attribute of the element. - true to indicate that multiple selections are enabled; otherwise, false. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML list box control that has the specified name, size, custom attributes defined by an attribute object, items, default item, and selections, and that specifies whether multiple selections are enabled. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. - The value to assign to the size attribute of the element. - true to indicate that multiple selections are enabled; otherwise, false. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML list box control that has the specified name, items, default item, and custom attributes defined by an attribute object, and selections. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Creates a dictionary from an object, by adding each public instance property as a key with its associated value to the dictionary. It will expose public properties from derived types as well. This is typically used with objects of an anonymous type. - The created dictionary of property names and property values. - The object to be converted. - - - Returns an HTML password control that has the specified name. - The HTML markup that represents the password control. - The value to assign to the name attribute of the HTML control element. - - is null or empty. - - - Returns an HTML password control that has the specified name and value. - The HTML markup that represents the password control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - - is null or empty. - - - Returns an HTML password control that has the specified name, value, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the password control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML password control that has the specified name, value, and custom attributes defined by an attribute object. - The HTML markup that represents the password control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML radio button control that has the specified name and value. - The HTML markup that represents the radio button control. - The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. - The value to assign to the value attribute of the element. - - is null or empty. - - - Returns an HTML radio button control that has the specified name, value, and default selected status. - The HTML markup that represents the radio button control. - The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. - The value to assign to the value attribute of the element. - true to indicate that the control is selected; otherwise, false. - - is null or empty. - - - Returns an HTML radio button control that has the specified name, value, default selected status, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the radio button control. - The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. - The value to assign to the value attribute of the element. - true to indicate that the control is selected; otherwise, false. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML radio button control that has the specified name, value, default selected status, and custom attributes defined by an attribute object. - The HTML markup that represents the radio button control. - The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. - The value to assign to the value attribute of the element. - true to indicate that the control is selected; otherwise, false. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML radio button control that has the specified name, value, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the radio button control. - The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. - The value to assign to the value attribute of the element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML radio button control that has the specified name, value, and custom attributes defined by an attribute object. - The HTML markup that represents the radio button control. - The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. - The value to assign to the value attribute of the element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Wraps HTML markup in an instance so that it is interpreted as HTML markup. - The unencoded HTML. - The object to render HTML for. - - - Wraps HTML markup in an instance so that it is interpreted as HTML markup. - The unencoded HTML. - The string to interpret as HTML markup instead of being HTML-encoded. - - - Returns an HTML multi-line text input (text area) control that has the specified name. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name and custom attributes defined by an attribute dictionary. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name and custom attributes defined by an attribute object. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name and value. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textrarea element. - The text to display. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name, value, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - The text to display. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name, value, row attribute, col attribute, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - The text to display. - The value to assign to the rows attribute of the element. - The value to assign to the cols attribute of the element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name, value, row attribute, col attribute, and custom attributes defined by an attribute object. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - The text to display. - The value to assign to the rows attribute of the element. - The value to assign to the cols attribute of the element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name, value, and custom attributes defined by an attribute object. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - The text to display. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML text control that has the specified name. - The HTML markup that represents the text control. - The value to assign to the name attribute of the HTML control element. - - is null or empty. - - - Returns an HTML text control that has the specified name and value. - The HTML markup that represents the text control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - - is null or empty. - - - Returns an HTML text control that has the specified name, value, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the text control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML text control that has the specified name, value, and custom attributes defined by an attribute object. - The HTML markup that represents the text control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Gets or sets a value that indicates whether the page uses unobtrusive JavaScript for Ajax functionality. - true if the page uses unobtrusive JavaScript; otherwise, false. - - - Gets or sets the name of the CSS class that defines the appearance of input elements when validation fails. - The name of the CSS class. The default is field-validation-error. - - - Gets or sets the name of the CSS class that defines the appearance of input elements when validation passes. - The name of the CSS class. The default is input-validation-valid. - - - Returns an HTML span element that contains the first validation error message for the specified form field. - If the value in the specified field is valid, null; otherwise, the HTML markup that represents the validation error message that is associated with the specified field. - The name of the form field that was validated. - - is null or empty. - - - Returns an HTML span element that has the specified custom attributes defined by an attribute dictionary, and that contains the first validation error message for the specified form field. - If the value in the specified field is valid, null; otherwise, the HTML markup that represents the validation error message that is associated with the specified field. - The name of the form field that was validated. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML span element that has the specified custom attributes defined by an attribute object, and that contains the first validation error message for the specified form field. - If the value in the specified field is valid, null; otherwise, the HTML markup that represents the validation error message that is associated with the specified field. - The name of the form field that was validated. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML span element that contains a validation error message for the specified form field. - If the value in the specified field is valid, null; otherwise, the HTML markup that represents the validation error message that is associated with the specified field. - The name of the form field that was validated. - The validation error message to display. If null, the first validation error message that is associated with the specified form field is displayed. - - is null or empty. - - - Returns an HTML span element that has the specified custom attributes defined by an attribute dictionary, and that contains a validation error message for the specified form field. - If the specified field is valid, null; otherwise, the HTML markup that represents a validation error message that is associated with the specified field. - The name of the form field that was validated. - The validation error message to display. If null, the first validation error message that is associated with the specified form field is displayed. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML span element that has the specified custom attributes defined by an attribute object, and that contains a validation error message for the specified form field. - If the specified field is valid, null; otherwise, the HTML markup that represents a validation error message that is associated with the specified field. - The name of the form field that was validated. - The validation error message to display. If null, the first validation error message that is associated with the specified form field is displayed. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Gets or sets the name of the CSS class that defines the appearance of validation error messages when validation fails. - The name of the CSS class. The default is field-validation-error. - - - Gets or sets the name of the CSS class that defines the appearance of validation error messages when validation passes. - The name of the CSS class. The default is field-validation-valid. - - - Returns an HTML div element that contains an unordered list of all validation error messages from the model-state dictionary. - The HTML markup that represents the validation error messages. - - - Returns an HTML div element that contains an unordered list of validation error message from the model-state dictionary, optionally excluding field-level errors. - The HTML markup that represents the validation error messages. - true to exclude field-level validation error messages from the list; false to include both model-level and field-level validation error messages. - - - Returns an HTML div element that has the specified custom attributes defined by an attribute dictionary, and that contains an unordered list of all validation error messages that are in the model-state dictionary. - The HTML markup that represents the validation error messages. - The names and values of custom attributes for the element. - - - Returns an HTML div element that has the specified custom attributes defined by an attribute object, and that contains an unordered list of all validation error messages that are in the model-state dictionary. - The HTML markup that represents the validation error messages. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - - Returns an HTML div element that contains a summary message and an unordered list of all validation error messages that are in the model-state dictionary. - The HTML markup that represents the validation error messages. - The message that comes before the list of validation error messages. - - - Returns an HTML div element that has the specified custom attributes defined by an attribute dictionary, and that contains a summary message and an unordered list of validation error message from the model-state dictionary, optionally excluding field-level errors. - The HTML markup that represents the validation error messages. - The summary message that comes before the list of validation error messages. - true to exclude field-level validation error messages from the results; false to include both model-level and field-level validation error messages. - The names and values of custom attributes for the element. - - - Returns an HTML div element that has the specified custom attributes defined by an attribute object, and that contains a summary message and an unordered list of validation error message from the model-state dictionary, optionally excluding field-level errors. - The HTML markup that represents the validation error messages. - The summary message that comes before the list of validation error messages. - true to exclude field-level validation error messages from the results; false to include and field-level validation error messages. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - - Returns an HTML div element that has the specified custom attributes defined by an attribute dictionary, and that contains a summary message and an unordered list of all validation error message from the model-state dictionary. - The HTML markup that represents the validation error messages. - The message that comes before the list of validation error messages. - The names and values of custom attributes for the element. - - - Returns an HTML div element that has the specified custom attributes defined by an attribute object, and that contains a summary message and an unordered list of all validation error message from the model-state dictionary. - The HTML markup that represents the validation error messages. - The summary message that comes before the list of validation error messages. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - - Gets or sets the name of the CSS class that defines the appearance of a validation summary when validation fails. - The name of the CSS class. The default is validation-summary-errors. - - - Gets or sets the name of the CSS class that defines the appearance of a validation summary when validation passes. - The name of the CSS class. The default is validation-summary-valid. - - - Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself. - - - Initializes a new instance of the class. - - - Returns a list of strings that contains any errors that occurred during model binding. - The errors that occurred during model binding. - - - Returns an object that encapsulates the value that was bound during model binding. - The value that was bound. - - - Represents the result of binding a posted form to an action method, which includes information such as validation status and validation error messages. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using values that are copied from the specified model-state dictionary. - The model-state dictionary that values are copied from. - - - Adds the specified item to the model-state dictionary. - The item to add to the model-state dictionary. - - - Adds an item that has the specified key and value to the model-state dictionary. - The key. - The value. - - - Adds an error message to the model state that is associated with the specified key. - The key that is associated with the model state that the error message is added to. - The error message. - - - Adds an error message to the model state that is associated with the entire form. - The error message. - - - Removes all items from the model-state dictionary. - - - Determines whether the model-state dictionary contains the specified item. - true if the model-state dictionary contains the specified item; otherwise, false. - The item to look for. - - - Determines whether the model-state dictionary contains the specified key. - true if the model-state dictionary contains the specified key; otherwise, false. - The key to look for. - - - Copies the elements of the model-state dictionary to an array, starting at the specified index. - The one-dimensional instance where the elements will be copied to. - The index in at which copying begins. - - - Gets the number of model states that the model-state dictionary contains. - The number of model states in the model-state dictionary. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the model-state dictionary is read-only. - true if the model-state dictionary is read-only; otherwise, false. - - - Gets a value that indicates whether any error messages are associated with any model state in the model-state dictionary. - true if any error messages are associated with any model state in the dictionary; otherwise, false. - - - Determines whether any error messages are associated with the specified key. - true if no error messages are associated with the specified key, or the specified key does not exist; otherwise, false. - The key. - - is null. - - - Gets or sets the model state that is associated with the specified key in the model-state dictionary. - The model state that is associated with the specified key in the dictionary. - - - Gets a list that contains the keys in the model-state dictionary. - The list of keys in the dictionary. - - - Copies the values from the specified model-state dictionary into this instance, overwriting existing values when the keys are the same. - The model-state dictionary that values are copied from. - - - Removes the first occurrence of the specified item from the model-state dictionary. - true if the item was successfully removed from the model-state dictionary; false if the item was not removed or if the item does not exist in the model-state dictionary. - The item to remove. - - - Removes the item that has the specified key from the model-state dictionary. - true if the item was successfully removed from the model-state dictionary; false if the item was not removed or does not exist in the model-state dictionary. - The key of the element to remove. - - - Sets the value of the model state that is associated with the specified key. - The key to set the value of. - The value to set the key to. - - - Returns an enumerator that can be used to iterate through the model-state dictionary. - An enumerator that can be used to iterate through the model-state dictionary. - - - Gets the model-state value that is associated with the specified key. - true if the model-state dictionary contains an element that has the specified key; otherwise, false. - The key to get the value of. - When this method returns, if the key is found, contains the model-state value that is associated with the specified key; otherwise, contains the default value for the type. This parameter is passed uninitialized. - - - Gets a list that contains the values in the model-state dictionary. - The list of values in the dictionary. - - - Represents an item in an HTML select list. - - - Initializes a new instance of the class using the default settings. - - - Initializes a new instance of the class by copying the specified select list item. - The select list item to copy. - - - Gets or sets a value that indicates whether the instance is selected. - true if the select list item is selected; otherwise, false. - - - Gets or sets the text that is used to display the instance on a web page. - The text that is used to display the select list item. - - - Gets or sets the value of the HTML value attribute of the HTML option element that is associated with the instance. - The value of the HTML value attribute that is associated with the select list item. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a web pages instrumentation service. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Called before it renders the output for the specified context. - The context. - The virtual path. - The writer. - The start position. - The length of the context. - Determines whether the context is literal. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Called after it renders the output for the specified context. - The context. - The virtual path. - The writer. - The start position. - The length of the context. - Determines whether the context is literal. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the service is available. - true if the service is available; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a position tagged. - The type of the position.. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The value of this current instance. - The offset. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the hash code of the current instance. - The hash code of the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two objects are equal. - true if the two objects are equal; otherwise, false. - The first object. - The second object. - - - Converts the specified object to a object. - The that represents the converted . - The object to convert. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Converts the to a object. - The that represents the converted . - The object to convert. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two objects are not equal. - true if the two objects are not equal; otherwise, false. - The first object. - The second object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position associated with the . - The position associated with the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the object. - A string that represents the object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the value of the current instance. - The value of the current instance. - - - Defines an ASP.NET request scope storage provider. - - - Initializes a new instance of the class. - - - Gets the dictionary to store data in the application scope. - The dictionary that stores application scope data. - - - Gets or sets the dictionary to store data in the current scope. - The dictionary that stores current scope data. - - - Gets the dictionary to store data in the global scope. - The dictionary that stores global scope data. - - - Gets the dictionary to store data in the request scope. - The dictionary that stores request scope data. - - - Defines a dictionary that provides scoped access to data. - - - Gets and sets the dictionary that is used to store data in the current scope. - The dictionary that stores current scope data. - - - Gets the dictionary that is used to store data in the global scope. - The dictionary that stores global scope data. - - - Defines a class that is used to contain storage for a transient scope. - - - Returns a dictionary that is used to store data in a transient scope, based on the scope in the property. - The dictionary that stores transient scope data. - - - Returns a dictionary that is used to store data in a transient scope. - The dictionary that stores transient scope data. - The context. - - - Gets or sets the current scope provider. - The current scope provider. - - - Gets the dictionary that is used to store data in the current scope. - The dictionary that stores current scope data. - - - Gets the dictionary that is used to store data in the global scope. - The dictionary that stores global scope data. - - - Represents a collection of keys and values that are used to store data at different scope levels (local, global, and so on). - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified base scope. - The base scope. - - - Adds a key/value pair to the object using the specified generic collection. - The key/value pair. - - - Adds the specified key and specified value to the object. - The key. - The value. - - - Gets the dictionary that stores the object data. - - - Gets the base scope for the object. - The base scope for the object. - - - Removes all keys and values from the concatenated and objects. - - - Returns a value that indicates whether the specified key/value pair exists in either the object or in the object. - true if the object or the object contains an element that has the specified key/value pair; otherwise, false. - The key/value pair. - - - Returns a value that indicates whether the specified key exists in the object or in the object. - true if the object or the object contains an element that has the specified key; otherwise, false. - The key. - - - Copies all of the elements in the object and the object to an object, starting at the specified index. - The array. - The zero-based index in . - - - Gets the number of key/value pairs that are in the concatenated and objects. - The number of key/value pairs. - - - Returns an enumerator that can be used to iterate through concatenated and objects. - An object. - - - Returns an enumerator that can be used to iterate through the distinct elements of concatenated and objects. - An enumerator that contains distinct elements from the concatenated dictionary objects. - - - Gets a value that indicates whether the object is read-only. - true if the object is read-only; otherwise, false. - - - Gets or sets the element that is associated with the specified key. - The element that has the specified key. - - - Gets a object that contains the keys from the concatenated and objects. - An object that contains that contains the keys. - - - Removes the specified key/value pair from the concatenated and objects. - true if the key/value pair is removed, or false if is not found in the concatenated and objects. - The key/value pair. - - - Removes the value that has the specified key from the concatenated and objects. - true if the key/value pair is removed, or false if is not found in the concatenated and objects. - The key. - - - Sets a value using the specified key in the concatenated and objects. - The key. - The value. - - - Returns an enumerator for the concatenated and objects. - The enumerator. - - - Gets the value that is associated with the specified key from the concatenated and objects. - true if the concatenated and objects contain an element that has the specified key; otherwise, false. - The key. - When this method returns, if the key is found, contains the value that is associated with the specified key; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - - Gets a object that contains the values from the concatenated and objects. - The object that contains the values. - - - Provides scoped access to static data. - - - Initializes a new instance of the class. - - - Gets or sets a dictionary that stores current data under a static context. - The dictionary that provides current scoped data. - - - Gets a dictionary that stores global data under a static context. - The dictionary that provides global scoped data. - - - \ No newline at end of file diff --git a/lib/aspnetwebapi/License-Stable.rtf b/lib/aspnetwebapi/License-Stable.rtf deleted file mode 100644 index 3aec6b65437..00000000000 --- a/lib/aspnetwebapi/License-Stable.rtf +++ /dev/null @@ -1,118 +0,0 @@ -{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Tahoma;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fswiss\fprq2\fcharset0 Calibri;}{\f3\fnil\fcharset0 Calibri;}{\f4\fnil\fcharset2 Symbol;}} -{\colortbl ;\red31\green73\blue125;\red0\green0\blue255;} -{\*\listtable -{\list\listhybrid -{\listlevel\levelnfc0\leveljc0\levelstartat1{\leveltext\'02\'00.;}{\levelnumbers\'01;}\jclisttab\tx360} -{\listlevel\levelnfc4\leveljc0\levelstartat1{\leveltext\'02\'01.;}{\levelnumbers\'01;}\jclisttab\tx363} -{\listlevel\levelnfc2\leveljc0\levelstartat1{\leveltext\'02\'02.;}{\levelnumbers\'01;}\jclisttab\tx720}\listid1 } -{\list\listhybrid -{\listlevel\levelnfc0\leveljc0\levelstartat1{\leveltext\'02\'00.;}{\levelnumbers\'01;}\jclisttab\tx363} -{\listlevel\levelnfc4\leveljc0\levelstartat1{\leveltext\'02\'01.;}{\levelnumbers\'01;}\jclisttab\tx363}\listid2 }} -{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}} -{\stylesheet{ Normal;}{\s1 heading 1;}{\s2 heading 2;}{\s3 heading 3;}} -{\*\generator Riched20 6.2.9200}\viewkind4\uc1 -\pard\nowidctlpar\sb120\sa120\b\f0\fs24 MICROSOFT SOFTWARE LICENSE TERMS\par - -\pard\brdrb\brdrs\brdrw10\brsp20 \nowidctlpar\sb120\sa120 MICROSOFT .NET LIBRARY \par - -\pard\nowidctlpar\sb120\sa120\fs19 These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft\par - -\pard{\pntext\f4\'B7\tab}{\*\pn\pnlvlblt\pnf4\pnindent363{\pntxtb\'B7}}\nowidctlpar\fi-363\li720\sb120\sa120\b0 updates,\par -{\pntext\f4\'B7\tab}supplements,\par -{\pntext\f4\'B7\tab}Internet-based services, and\par -{\pntext\f4\'B7\tab}support services\par - -\pard\nowidctlpar\sb120\sa120\b for this software, unless other terms accompany those items. If so, those terms apply.\par -BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.\par - -\pard\brdrt\brdrs\brdrw10\brsp20 \nowidctlpar\sb120\sa120 IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE PERPETUAL RIGHTS BELOW.\par - -\pard -{\listtext\f0 1.\tab}\jclisttab\tx360\ls1\nowidctlpar\s1\fi-357\li357\sb120\sa120 INSTALLATION AND USE RIGHTS. \par - -\pard -{\listtext\f0 a.\tab}\jclisttab\tx363\ls1\ilvl1\nowidctlpar\s2\fi-363\li720\sb120\sa120 Installation and Use.\b0\fs20 You may install and use any number of copies of the software to design, develop and test your programs.\par -{\listtext\f0 b.\tab}\b\fs19 Third Party Programs.\b0\fs20 The software may include third party programs that Microsoft, not the third party, licenses to you under this agreement. Notices, if any, for the third party program are included for your information only.\b\fs19\par - -\pard -{\listtext\f0 2.\tab}\jclisttab\tx360\ls1\nowidctlpar\s1\fi-357\li357\sb120\sa120\fs20 ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.\par - -\pard -{\listtext\f0 a.\tab}\jclisttab\tx363\ls1\ilvl1\nowidctlpar\s2\fi-363\li720\sb120\sa120 DISTRIBUTABLE CODE.\~ \b0 The software is comprised of Distributable Code. \f1\ldblquote\f0 Distributable Code\f1\rdblquote\f0 is code that you are permitted to distribute in programs you develop if you comply with the terms below.\b\par - -\pard -{\listtext\f0 i.\tab}\jclisttab\tx720\ls1\ilvl2\nowidctlpar\s3\fi-357\li1077\sb120\sa120\tx1077 Right to Use and Distribute. \par - -\pard{\pntext\f4\'B7\tab}{\*\pn\pnlvlblt\pnf4\pnindent360{\pntxtb\'B7}}\nowidctlpar\fi-357\li1434\sb120\sa120\b0 You may copy and distribute the object code form of the software.\par -{\pntext\f4\'B7\tab}Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.\par - -\pard\nowidctlpar\s3\fi-357\li1077\sb120\sa120\tx1077\b ii.\tab Distribution Requirements.\b0 \b For any Distributable Code you distribute, you must\par - -\pard{\pntext\f4\'B7\tab}{\*\pn\pnlvlblt\pnf4\pnindent360{\pntxtb\'B7}}\nowidctlpar\fi-357\li1434\sb120\sa120\b0 add significant primary functionality to it in your programs;\par -{\pntext\f4\'B7\tab}require distributors and external end users to agree to terms that protect it at least as much as this agreement;\par -{\pntext\f4\'B7\tab}display your valid copyright notice on your programs; and\par -{\pntext\f4\'B7\tab}indemnify, defend, and hold harmless Microsoft from any claims, including attorneys\rquote fees, related to the distribution or use of your programs.\par - -\pard\nowidctlpar\s3\fi-357\li1077\sb120\sa120\tx1077\b iii.\tab Distribution Restrictions.\b0 \b You may not\par - -\pard{\pntext\f4\'B7\tab}{\*\pn\pnlvlblt\pnf4\pnindent360{\pntxtb\'B7}}\nowidctlpar\fi-357\li1434\sb120\sa120\b0 alter any copyright, trademark or patent notice in the Distributable Code;\par -{\pntext\f4\'B7\tab}use Microsoft\rquote s trademarks in your programs\rquote names or in a way that suggests your programs come from or are endorsed by Microsoft;\par -{\pntext\f4\'B7\tab}include Distributable Code in malicious, deceptive or unlawful programs; or\par -{\pntext\f4\'B7\tab}modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that\par - -\pard{\pntext\f4\'B7\tab}{\*\pn\pnlvlblt\pnf4\pnindent360{\pntxtb\'B7}}\nowidctlpar\fi-358\li1792\sb120\sa120 the code be disclosed or distributed in source code form; or\cf1\f2\par -{\pntext\f4\'B7\tab}\cf0\f0 others have the right to modify it.\cf1\f2\par - -\pard\nowidctlpar\s1\fi-357\li357\sb120\sa120\cf0\b\f0 3.\tab\fs19 SCOPE OF LICENSE. \b0 The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not\par - -\pard{\pntext\f4\'B7\tab}{\*\pn\pnlvlblt\pnf4\pnindent363{\pntxtb\'B7}}\nowidctlpar\fi-363\li720\sb120\sa120 work around any technical limitations in the software;\par -{\pntext\f4\'B7\tab}reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;\par -{\pntext\f4\'B7\tab}publish the software for others to copy;\par -{\pntext\f4\'B7\tab}rent, lease or lend the software;\par -{\pntext\f4\'B7\tab}transfer the software or this agreement to any third party; or\par -{\pntext\f4\'B7\tab}use the software for commercial software hosting services.\par - -\pard\nowidctlpar\s1\fi-357\li357\sb120\sa120\b\fs20 4.\tab\fs19 BACKUP COPY. \b0 You may make one backup copy of the software. You may use it only to reinstall the software.\par -\b\fs20 5.\tab\fs19 DOCUMENTATION. \b0 Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.\par -\b\fs20 6.\tab\fs19 EXPORT RESTRICTIONS. \b0 The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see {\cf2\ul\fs20{\field{\*\fldinst{HYPERLINK www.microsoft.com/exporting }}{\fldrslt{www.microsoft.com/exporting}}}}\f0\fs19 .\cf2\ul\fs20\par -\cf0\ulnone\b 7.\tab\fs19 SUPPORT SERVICES. \b0 Because this software is \ldblquote as is,\rdblquote we may not provide support services for it.\par -\b\fs20 8.\tab\fs19 ENTIRE AGREEMENT. \b0 This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.\par -\b\fs20 9.\tab\fs19 APPLICABLE LAW.\par - -\pard -{\listtext\f0 a.\tab}\jclisttab\tx363\ls2\ilvl1\nowidctlpar\s2\fi-363\li720\sb120\sa120 United States. \b0 If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.\par -{\listtext\f0 b.\tab}\b Outside the United States. If you acquired the software in any other country, the laws of that country apply.\par - -\pard\nowidctlpar\s1\fi-357\li357\sb120\sa120\fs20 10.\tab\fs19 LEGAL EFFECT. \b0 This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.\par -\b\fs20 11.\tab\fs19 DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED \ldblquote AS-IS.\rdblquote YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS OR STATUTORY GUARANTEES UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.\par - -\pard\nowidctlpar\li357\sb120\sa120 FOR AUSTRALIA \endash YOU HAVE STATUTORY GUARANTEES UNDER THE AUSTRALIAN CONSUMER LAW AND NOTHING IN THESE TERMS IS INTENDED TO AFFECT THOSE RIGHTS.\par - -\pard\nowidctlpar\s1\fi-357\li357\sb120\sa120\fs20 12.\tab\fs19 LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.\par - -\pard\nowidctlpar\li357\sb120\sa120\b0 This limitation applies to\par - -\pard{\pntext\f4\'B7\tab}{\*\pn\pnlvlblt\pnf4\pnindent363{\pntxtb\'B7}}\nowidctlpar\fi-363\li720\sb120\sa120 anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and\par -{\pntext\f4\'B7\tab}claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.\par - -\pard\nowidctlpar\sb120\sa120 It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.\par -\lang9 Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.\par -Remarque : Ce logiciel \'e9tant distribu\'e9 au Qu\'e9bec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en fran\'e7ais.\par - -\pard\nowidctlpar\s1\sb120\sa120\b\lang1033 EXON\'c9RATION DE GARANTIE. \b0 Le logiciel vis\'e9 par une licence est offert \'ab tel quel \'bb. Toute utilisation de ce logiciel est \'e0 votre seule risque et p\'e9ril. Microsoft n\rquote accorde aucune autre garantie expresse. Vous pouvez b\'e9n\'e9ficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualit\'e9 marchande, d\rquote ad\'e9quation \'e0 un usage particulier et d\rquote absence de contrefa\'e7on sont exclues.\par -\b LIMITATION DES DOMMAGES-INT\'c9R\'caTS ET EXCLUSION DE RESPONSABILIT\'c9 POUR LES DOMMAGES. \b0 Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement \'e0 hauteur de 5,00 $ US. Vous ne pouvez pr\'e9tendre \'e0 aucune indemnisation pour les autres dommages, y compris les dommages sp\'e9ciaux, indirects ou accessoires et pertes de b\'e9n\'e9fices.\par - -\pard\nowidctlpar\sb120\sa120\lang9 Cette limitation concerne :\par - -\pard{\pntext\f4\'B7\tab}{\*\pn\pnlvlblt\pnf4\pnindent360{\pntxtb\'B7}}\nowidctlpar\li720\sb120\sa120 tout ce qui est reli\'e9 au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et\par -{\pntext\f4\'B7\tab}les r\'e9clamations au titre de violation de contrat ou de garantie, ou au titre de responsabilit\'e9 stricte, de n\'e9gligence ou d\rquote une autre faute dans la limite autoris\'e9e par la loi en vigueur.\par - -\pard\nowidctlpar\sb120\sa120 Elle s\rquote applique \'e9galement, m\'eame si Microsoft connaissait ou devrait conna\'eetre l\rquote\'e9ventualit\'e9 d\rquote un tel dommage. Si votre pays n\rquote autorise pas l\rquote exclusion ou la limitation de responsabilit\'e9 pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l\rquote exclusion ci-dessus ne s\rquote appliquera pas \'e0 votre \'e9gard.\par - -\pard\nowidctlpar\s1\sb120\sa120\b\lang1033 EFFET JURIDIQUE. \b0 Le pr\'e9sent contrat d\'e9crit certains droits juridiques. Vous pourriez avoir d\rquote autres droits pr\'e9vus par les lois de votre pays. Le pr\'e9sent contrat ne modifie pas les droits que vous conf\'e8rent les lois de votre pays si celles-ci ne le permettent pas.\par - -\pard\nowidctlpar\sb120\sa120\b\fs20\lang1036\par - -\pard\sa200\sl276\slmult1\b0\f3\fs22\lang9\par -} - \ No newline at end of file diff --git a/lib/aspnetwebapi/System.Net.Http.Extensions.XML b/lib/aspnetwebapi/System.Net.Http.Extensions.XML deleted file mode 100644 index 1190940f3ef..00000000000 --- a/lib/aspnetwebapi/System.Net.Http.Extensions.XML +++ /dev/null @@ -1,50 +0,0 @@ - - - - System.Net.Http.Extensions - - - - - Extension methods for which expose differences in platform specific capabilities. - - - - - Gets a value that indicates if HttpClientHandler.AllowAutoRedirect is supported by the handler. - When this property is true and HttpClientHandler.SupportsRedirectConfiguration is false, setting HttpClientHandler.AllowAutoRedirect to true will cause the system default to be used for HttpClientHandler.MaximumAutomaticRedirections. - - The to check. - Returns .true if the if the handler supports configuration settings for the property; otherwise false. - - - - Gets a value that indicates if is supported by the handler. - - The to check. - Returns .true if the if the handler supports configuration settings for the property; otherwise false. - - - - Gets a value that indicates if , HttpRequestMessage.ProtocolVersion, and HttpResponseMessage.ProtocolVersion are supported by the handler. - - The to check. - Returns .true if the if the handler supports configuration settings for the , HttpRequestMessage.ProtocolVersion, and HttpResponseMessage.ProtocolVersion properties; otherwise false. - - - - Gets a value that indicates if HttpRequestMessage.Headers with or header value of 'chunked' is supported by the handler. - - The to check. - Returns .true if the if the handler supports setting HttpRequestMessage.Headers with or header value of 'chunked'; otherwise false. - - - - Gets a value that indicates if is supported by the handler. - When this property is true and HttpClientHandler.SupportsProxy is false, setting HttpClientHandler.UseProxy to true will cause the system default to be used for HttpClientHandler.Proxy. - - The to check. - Returns .true if the if the handler supports configuration settings for the property; otherwise false. - - - diff --git a/lib/aspnetwebapi/System.Net.Http.Extensions.dll b/lib/aspnetwebapi/System.Net.Http.Extensions.dll deleted file mode 100644 index 1aef22e84db..00000000000 Binary files a/lib/aspnetwebapi/System.Net.Http.Extensions.dll and /dev/null differ diff --git a/lib/aspnetwebapi/System.Net.Http.Formatting.dll b/lib/aspnetwebapi/System.Net.Http.Formatting.dll deleted file mode 100644 index 3b76acd6bea..00000000000 Binary files a/lib/aspnetwebapi/System.Net.Http.Formatting.dll and /dev/null differ diff --git a/lib/aspnetwebapi/System.Net.Http.Formatting.xml b/lib/aspnetwebapi/System.Net.Http.Formatting.xml deleted file mode 100644 index 3fb65976cf3..00000000000 --- a/lib/aspnetwebapi/System.Net.Http.Formatting.xml +++ /dev/null @@ -1,2094 +0,0 @@ - - - - System.Net.Http.Formatting - - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. The supports one or more byte ranges regardless of whether the ranges are consecutive or not. If there is only one range then a single partial response body containing a Content-Range header is generated. If there are more than one ranges then a multipart/byteranges response is generated where each body part contains a range indicated by the associated Content-Range header field. - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. - The stream over which to generate a byte range view. - The range or ranges, typically obtained from the Range HTTP request header field. - The media type of the content stream. - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. - The stream over which to generate a byte range view. - The range or ranges, typically obtained from the Range HTTP request header field. - The media type of the content stream. - The buffer size used when copying the content stream. - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. - The stream over which to generate a byte range view. - The range or ranges, typically obtained from the Range HTTP request header field. - The media type of the content stream. - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. - The stream over which to generate a byte range view. - The range or ranges, typically obtained from the Range HTTP request header field. - The media type of the content stream. - The buffer size used when copying the content stream. - - - Releases the resources used by the current instance of the class. - true to release managed and unmanaged resources; false to release only unmanaged resources. - - - Asynchronously serialize and write the byte range to an HTTP content stream. - The task object representing the asynchronous operation. - The target stream. - Information about the transport. - - - Determines whether a byte array has a valid length in bytes. - true if length is a valid length; otherwise, false. - The length in bytes of the byte array. - - - Extension methods that aid in making formatted requests using . - - - - - - - - - Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as JSON. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as JSON. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as XML. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as XML. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - - - - - - - - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as JSON. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as JSON. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as XML. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as XML. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - - - - - - - - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Represents the factory for creating new instance of . - - - Creates a new instance of the . - A new instance of the . - The list of HTTP handler that delegates the processing of HTTP response messages to another handler. - - - Creates a new instance of the . - A new instance of the . - The inner handler which is responsible for processing the HTTP response messages. - The list of HTTP handler that delegates the processing of HTTP response messages to another handler. - - - Creates a new instance of the which should be pipelined. - A new instance of the which should be pipelined. - The inner handler which is responsible for processing the HTTP response messages. - The list of HTTP handler that delegates the processing of HTTP response messages to another handler. - - - Specifies extension methods to allow strongly typed objects to be read from HttpContent instances. - - - Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The collection of MediaTyepFormatter instances to use. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The collection of MediaTypeFormatter instances to use. - The IFormatterLogger to log events to. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The collection of MediaTypeFormatter instances to use. - The IFormatterLogger to log events to. - The token to cancel the operation. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The collection of MediaTypeFormatter instances to use. - The token to cancel the operation. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The token to cancel the operation. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance. - A Task that will yield an object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The collection of MediaTypeFormatter instances to use. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The collection of MediaTypeFormatter instances to use. - The IFormatterLogger to log events to. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The collection of MediaTypeFormatter instances to use. - The IFormatterLogger to log events to. - The token to cancel the operation. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The collection of MediaTypeFormatter instances to use. - The token to cancel the operation. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The token to cancel the operation. - - - Extension methods to read HTML form URL-encoded datafrom instances. - - - Determines whether the specified content is HTML form URL-encoded data. - true if the specified content is HTML form URL-encoded data; otherwise, false. - The content. - - - Asynchronously reads HTML form URL-encoded from an instance and stores the results in a object. - A task object representing the asynchronous operation. - The content. - - - Asynchronously reads HTML form URL-encoded from an instance and stores the results in a object. - A task object representing the asynchronous operation. - The content. - The token to cancel the operation. - - - Provides extension methods to read and entities from instances. - - - Determines whether the specified content is HTTP request message content. - true if the specified content is HTTP message content; otherwise, false. - The content to check. - - - Determines whether the specified content is HTTP response message content. - true if the specified content is HTTP message content; otherwise, false. - The content to check. - - - Reads the as an . - The parsed instance. - The content to read. - - - Reads the as an . - The parsed instance. - The content to read. - The URI scheme to use for the request URI. - - - Reads the as an . - The parsed instance. - The content to read. - The URI scheme to use for the request URI. - The size of the buffer. - - - Reads the as an . - The parsed instance. - The content to read. - The URI scheme to use for the request URI. - The size of the buffer. - The maximum length of the HTTP header. - - - - - - - Reads the as an . - The parsed instance. - The content to read. - - - Reads the as an . - The parsed instance. - The content to read. - The size of the buffer. - - - Reads the as an . - The parsed instance. - The content to read. - The size of the buffer. - The maximum length of the HTTP header. - - - - - - Extension methods to read MIME multipart entities from instances. - - - Determines whether the specified content is MIME multipart content. - true if the specified content is MIME multipart content; otherwise, false. - The content. - - - Determines whether the specified content is MIME multipart content with the specified subtype. - true if the specified content is MIME multipart content with the specified subtype; otherwise, false. - The content. - The MIME multipart subtype to match. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - The token to cancel the operation. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - A stream provider providing output streams for where to write body parts as they are parsed. - The type of the MIME multipart. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written and bufferSize as read buffer size. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - A stream provider providing output streams for where to write body parts as they are parsed. - Size of the buffer used to read the contents. - The type of the MIME multipart. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written and bufferSize as read buffer size. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - A stream provider providing output streams for where to write body parts as they are parsed. - Size of the buffer used to read the contents. - The token to cancel the operation. - The type of the MIME multipart. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - A stream provider providing output streams for where to write body parts as they are parsed. - The token to cancel the operation. - The type of the MIME multipart. - - - Derived class which can encapsulate an or an as an entity with media type "application/http". - - - Initializes a new instance of the class encapsulating an . - The instance to encapsulate. - - - Initializes a new instance of the class encapsulating an . - The instance to encapsulate. - - - Releases unmanaged and - optionally - managed resources - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets the HTTP request message. - - - Gets the HTTP response message. - - - Asynchronously serializes the object's content to the given stream. - A instance that is asynchronously serializing the object's content. - The to which to write. - The associated . - - - Computes the length of the stream if possible. - true if the length has been computed; otherwise false. - The computed length of the stream. - - - Provides extension methods for the class. - - - Gets any cookie headers present in the request. - A collection of instances. - The request headers. - - - Gets any cookie headers present in the request that contain a cookie state whose name that matches the specified value. - A collection of instances. - The request headers. - The cookie state name to match. - - - - - Provides extension methods for the class. - - - Adds cookies to a response. Each Set-Cookie header is represented as one instance. A contains information about the domain, path, and other cookie information as well as one or more instances. Each instance contains a cookie name and whatever cookie state is associate with that name. The state is in the form of a which on the wire is encoded as HTML Form URL-encoded data. This representation allows for multiple related "cookies" to be carried within the same Cookie header while still providing separation between each cookie state. A sample Cookie header is shown below. In this example, there are two with names state1 and state2 respectively. Further, each cookie state contains two name/value pairs (name1/value1 and name2/value2) and (name3/value3 and name4/value4). <code> Set-Cookie: state1:name1=value1&amp;name2=value2; state2:name3=value3&amp;name4=value4; domain=domain1; path=path1; </code> - The response headers - The cookie values to add to the response. - - - An exception thrown by in case none of the requested ranges overlap with the current extend of the selected resource. The current extend of the resource is indicated in the ContentRange property. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - - - The current extend of the resource indicated in terms of a ContentRange header field. - - - Represents a multipart file data. - - - Initializes a new instance of the class. - The headers of the multipart file data. - The name of the local file for the multipart file data. - - - Gets or sets the headers of the multipart file data. - The headers of the multipart file data. - - - Gets or sets the name of the local file for the multipart file data. - The name of the local file for the multipart file data. - - - Represents an suited for writing each MIME body parts of the MIME multipart message to a file using a . - - - Initializes a new instance of the class. - The root path where the content of MIME multipart body parts are written to. - - - Initializes a new instance of the class. - The root path where the content of MIME multipart body parts are written to. - The number of bytes buffered for writes to the file. - - - Gets or sets the number of bytes buffered for writes to the file. - The number of bytes buffered for writes to the file. - - - Gets or sets the multipart file data. - The multipart file data. - - - Gets the name of the local file which will be combined with the root path to create an absolute file name where the contents of the current MIME body part will be stored. - A relative filename with no path component. - The headers for the current MIME body part. - - - Gets the stream instance where the message body part is written to. - The instance where the message body part is written to. - The content of HTTP. - The header fields describing the body part. - - - Gets or sets the root path where the content of MIME multipart body parts are written to. - The root path where the content of MIME multipart body parts are written to. - - - A implementation suited for use with HTML file uploads for writing file content to a remote storage . The stream provider looks at the Content-Disposition header field and determines an output remote based on the presence of a filename parameter. If a filename parameter is present in the Content-Disposition header field, then the body part is written to a remote provided by . Otherwise it is written to a . - - - Initializes a new instance of the class. - - - Read the non-file contents as form data. - A representing the post processing. - - - Read the non-file contents as form data. - A representing the post processing. - The token to monitor for cancellation requests. - - - Gets a collection of file data passed as part of the multipart form data. - - - Gets a of form data passed as part of the multipart form data. - - - Provides a for . Override this method to provide a remote stream to which the data should be written. - A result specifying a remote stream where the file will be written to and a location where the file can be accessed. It cannot be null and the stream must be writable. - The parent MIME multipart instance. - The header fields describing the body part's content. - - - - Represents an suited for use with HTML file uploads for writing file content to a . - - - Initializes a new instance of the class. - The root path where the content of MIME multipart body parts are written to. - - - Initializes a new instance of the class. - The root path where the content of MIME multipart body parts are written to. - The number of bytes buffered for writes to the file. - - - Reads the non-file contents as form data. - A task that represents the asynchronous operation. - - - - Gets a of form data passed as part of the multipart form data. - The of form data. - - - Gets the streaming instance where the message body part is written. - The instance where the message body part is written. - The HTTP content that contains this body part. - Header fields describing the body part. - - - Represents a multipart memory stream provider. - - - Initializes a new instance of the class. - - - Returns the for the . - The for the . - A object. - The HTTP content headers. - - - Represents the provider for the multipart related multistream. - - - Initializes a new instance of the class. - - - Gets the related stream for the provider. - The content headers. - The parent content. - The http content headers. - - - Gets the root content of the . - The root content of the . - - - Represents a multipart file data for remote storage. - - - Initializes a new instance of the class. - The headers of the multipart file data. - The remote file's location. - The remote file's name. - - - Gets the remote file's name. - - - Gets the headers of the multipart file data. - - - Gets the remote file's location. - - - Represents a stream provider that examines the headers provided by the MIME multipart parser as part of the MIME multipart extension methods (see ) and decides what kind of stream to return for the body part to be written to. - - - Initializes a new instance of the class. - - - Gets or sets the contents for this . - The contents for this . - - - Executes the post processing operation for this . - The asynchronous task for this operation. - - - Executes the post processing operation for this . - The asynchronous task for this operation. - The token to cancel the operation. - - - Gets the stream where to write the body part to. This method is called when a MIME multipart body part has been parsed. - The instance where the message body part is written to. - The content of the HTTP. - The header fields describing the body part. - - - Contains a value as well as an associated that will be used to serialize the value when writing this content. - - - Initializes a new instance of the class. - The type of object this instance will contain. - The value of the object this instance will contain. - The formatter to use when serializing the value. - - - Initializes a new instance of the class. - The type of object this instance will contain. - The value of the object this instance will contain. - The formatter to use when serializing the value. - The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. - - - Initializes a new instance of the class. - The type of object this instance will contain. - The value of the object this instance will contain. - The formatter to use when serializing the value. - The authoritative value of the Content-Type header. - - - Gets the media-type formatter associated with this content instance. - The media type formatter associated with this content instance. - - - Gets the type of object managed by this instance. - The object type. - - - Asynchronously serializes the object's content to the given stream. - The task object representing the asynchronous operation. - The stream to write to. - The associated . - - - Computes the length of the stream if possible. - true if the length has been computed; otherwise, false. - Receives the computed length of the stream. - - - Gets or sets the value of the content. - The content value. - - - Generic form of . - The type of object this class will contain. - - - Initializes a new instance of the class. - The value of the object this instance will contain. - The formatter to use when serializing the value. - - - Initializes a new instance of the <see cref="T:System.Net.Http.ObjectContent`1" /> class. - The value of the object this instance will contain. - The formatter to use when serializing the value. - The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. - - - Initializes a new instance of the class. - The value of the object this instance will contain. - The formatter to use when serializing the value. - The authoritative value of the Content-Type header. - - - Enables scenarios where a data producer wants to write directly (either synchronously or asynchronously) using a stream. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - The media type. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - The media type. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - The media type. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - The media type. - - - Asynchronously serializes the push content into stream. - The serialized push content. - The stream where the push content will be serialized. - The context. - - - Determines whether the stream content has a valid length in bytes. - true if length is a valid length; otherwise, false. - The length in bytes of the stream content. - - - Represents the result for . - - - Initializes a new instance of the class. - The remote stream instance where the file will be written to. - The remote file's location. - The remote file's name. - - - Gets the remote file's location. - - - Gets the remote file's location. - - - Gets the remote stream instance where the file will be written to. - - - Defines an exception type for signalling that a request's media type was not supported. - - - Initializes a new instance of the class. - The message that describes the error. - The unsupported media type. - - - Gets or sets the media type. - The media type. - - - Contains extension methods to allow strongly typed objects to be read from the query component of instances. - - - Parses the query portion of the specified URI. - A that contains the query parameters. - The URI to parse. - - - Reads HTML form URL encoded data provided in the URI query string as an object of a specified type. - true if the query component of the URI can be read as the specified type; otherwise, false. - The URI to read. - The type of object to read. - When this method returns, contains an object that is initialized from the query component of the URI. This parameter is treated as uninitialized. - - - Reads HTML form URL encoded data provided in the URI query string as an object of a specified type. - true if the query component of the URI can be read as the specified type; otherwise, false. - The URI to read. - When this method returns, contains an object that is initialized from the query component of the URI. This parameter is treated as uninitialized. - The type of object to read. - - - Reads HTML form URL encoded data provided in the query component as a object. - true if the query component can be read as ; otherwise false. - The instance from which to read. - An object to be initialized with this instance or null if the conversion cannot be performed. - - - Abstract media type formatter class to support Bson and Json. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Determines whether this formatter can read objects of the specified type. - true if objects of this type can be read, otherwise false. - The type of object that will be read. - - - Determines whether this formatter can write objects of the specified type. - true if objects of this type can be written, otherwise false. - The type of object to write. - - - Creates a instance with the default settings used by the . - Returns . - - - Called during deserialization to get the . - The reader to use during deserialization. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - - - Called during serialization and deserialization to get the . - The JsonSerializer used during serialization and deserialization. - - - Called during serialization to get the . - The writer to use during serialization. - The type of the object to write. - The stream to write to. - The encoding to use when writing. - - - Gets or sets the maximum depth allowed by this formatter. - The maximum depth allowed by this formatter. - - - Called during deserialization to read an object of the specified type from the specified stream. - The object that has been read. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - The logger to log events to. - - - Called during deserialization to read an object of the specified type from the specified stream. - A task whose result will be the object instance that has been read. - The type of the object to read. - The stream from which to read. - The for the content being read. - The logger to log events to. - - - Gets or sets the JsonSerializerSettings used to configure the JsonSerializer. - The JsonSerializerSettings used to configure the JsonSerializer. - - - Called during serialization to write an object of the specified type to the specified stream. - The type of the object to write. - The object to write. - The stream to write to. - The encoding to use when writing. - - - Called during serialization to write an object of the specified type to the specified stream. - Returns . - The type of the object to write. - The object to write. - The stream to write to. - The for the content being written. - The transport context. - The token to monitor for cancellation. - - - Represents a media type formatter to handle Bson. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The formatter to copy settings from. - - - Called during deserialization to get the . - The reader to use during deserialization. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - - - Called during serialization to get the . - The writer to use during serialization. - The type of the object to write. - The stream to write to. - The encoding to use when writing. - - - Gets the default media type for Json, namely "application/bson". - The default media type for Json, namely "application/bson". - - - Gets or sets the maximum depth allowed by this formatter. - The maximum depth allowed by this formatter. - - - Called during deserialization to read an object of the specified type from the specified stream. - The object that has been read. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - The logger to log events to. - - - Called during deserialization to read an object of the specified type from the specified stream. - A task whose result will be the object instance that has been read. - The type of the object to read. - The stream from which to read. - The for the content being read. - The logger to log events to. - - - Called during serialization to write an object of the specified type to the specified stream. - The type of the object to write. - The object to write. - The stream to write to. - The encoding to use when writing. - - - Represents a helper class to allow a synchronous formatter on top of the asynchronous formatter infrastructure. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Gets or sets the suggested size of buffer to use with streams in bytes. - The suggested size of buffer to use with streams in bytes. - - - Reads synchronously from the buffered stream. - An object of the given . - The type of the object to deserialize. - The stream from which to read. - The , if available. Can be null. - The to log events to. - - - Reads synchronously from the buffered stream. - An object of the given . - The type of the object to deserialize. - The stream from which to read. - The , if available. Can be null. - The to log events to. - The token to cancel the operation. - - - Reads asynchronously from the buffered stream. - A task object representing the asynchronous operation. - The type of the object to deserialize. - The stream from which to read. - The , if available. Can be null. - The to log events to. - - - Reads asynchronously from the buffered stream. - A task object representing the asynchronous operation. - The type of the object to deserialize. - The stream from which to read. - The , if available. Can be null. - The to log events to. - The token to cancel the operation. - - - Writes synchronously to the buffered stream. - The type of the object to serialize. - The object value to write. Can be null. - The stream to which to write. - The , if available. Can be null. - - - Writes synchronously to the buffered stream. - The type of the object to serialize. - The object value to write. Can be null. - The stream to which to write. - The , if available. Can be null. - The token to cancel the operation. - - - Writes asynchronously to the buffered stream. - A task object representing the asynchronous operation. - The type of the object to serialize. - The object value to write. It may be null. - The stream to which to write. - The , if available. Can be null. - The transport context. - - - Writes asynchronously to the buffered stream. - A task object representing the asynchronous operation. - The type of the object to serialize. - The object value to write. It may be null. - The stream to which to write. - The , if available. Can be null. - The transport context. - The token to cancel the operation. - - - Represents the result of content negotiation performed using <see cref="M:System.Net.Http.Formatting.IContentNegotiator.Negotiate(System.Type,System.Net.Http.HttpRequestMessage,System.Collections.Generic.IEnumerable{System.Net.Http.Formatting.MediaTypeFormatter})" /> - - - Create the content negotiation result object. - The formatter. - The preferred media type. Can be null. - - - The formatter chosen for serialization. - - - The media type that is associated with the formatter chosen for serialization. Can be null. - - - The default implementation of , which is used to select a for an or . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - true to exclude formatters that match only on the object type; otherwise, false. - - - Determines how well each formatter matches an HTTP request. - Returns a collection of objects that represent all of the matches. - The type to be serialized. - The request. - The set of objects from which to choose. - - - If true, exclude formatters that match only on the object type; otherwise, false. - Returns a . - - - Matches a set of Accept header fields against the media types that a formatter supports. - Returns a object that indicates the quality of the match, or null if there is no match. - A list of Accept header values, sorted in descending order of q factor. You can create this list by calling the method. - The formatter to match against. - - - Matches a request against the objects in a media-type formatter. - Returns a object that indicates the quality of the match, or null if there is no match. - The request to match. - The media-type formatter. - - - Match the content type of a request against the media types that a formatter supports. - Returns a object that indicates the quality of the match, or null if there is no match. - The request to match. - The formatter to match against. - - - Selects the first supported media type of a formatter. - Returns a with set to MatchOnCanWriteType, or null if there is no match. A indicating the quality of the match or null is no match. - The type to match. - The formatter to match against. - - - Performs content negotiating by selecting the most appropriate out of the passed in for the given that can serialize an object of the given . - The result of the negotiation containing the most appropriate instance, or null if there is no appropriate formatter. - The type to be serialized. - The request. - The set of objects from which to choose. - - - Determines the best character encoding for writing the response. - Returns the that is the best match. - The request. - The selected media formatter. - - - Select the best match among the candidate matches found. - Returns the object that represents the best match. - The collection of matches. - - - Determine whether to match on type or not. This is used to determine whether to generate a 406 response or use the default media type formatter in case there is no match against anything in the request. If ExcludeMatchOnTypeOnly is true then we don't match on type unless there are no accept headers. - True if not ExcludeMatchOnTypeOnly and accept headers with a q-factor bigger than 0.0 are present. - The sorted accept header values to match. - - - Sorts Accept header values in descending order of q factor. - Returns the sorted list of MediaTypeWithQualityHeaderValue objects. - A collection of StringWithQualityHeaderValue objects, representing the header fields. - - - Sorts a list of Accept-Charset, Accept-Encoding, Accept-Language or related header values in descending order or q factor. - Returns the sorted list of StringWithQualityHeaderValue objects. - A collection of StringWithQualityHeaderValue objects, representing the header fields. - - - Evaluates whether a match is better than the current match. - Returns whichever object is a better match. - The current match. - The match to evaluate against the current match. - - - Helper class to serialize <see cref="T:System.Collections.Generic.IEnumerable`1" /> types by delegating them through a concrete implementation."/&gt;. - The interface implementing to proxy. - - - Initialize a DelegatingEnumerable. This constructor is necessary for to work. - - - Initialize a DelegatingEnumerable with an <see cref="T:System.Collections.Generic.IEnumerable`1" />. This is a helper class to proxy <see cref="T:System.Collections.Generic.IEnumerable`1" /> interfaces for . - The <see cref="T:System.Collections.Generic.IEnumerable`1" /> instance to get the enumerator from. - - - This method is not implemented but is required method for serialization to work. Do not use. - The item to add. Unused. - - - Get the enumerator of the associated <see cref="T:System.Collections.Generic.IEnumerable`1" />. - The enumerator of the <see cref="T:System.Collections.Generic.IEnumerable`1" /> source. - - - Get the enumerator of the associated <see cref="T:System.Collections.Generic.IEnumerable`1" />. - The enumerator of the <see cref="T:System.Collections.Generic.IEnumerable`1" /> source. - - - Represent the collection of form data. - - - Initializes a new instance of class. - The pairs. - - - Initializes a new instance of class. - The query. - - - Initializes a new instance of class. - The URI - - - Gets the collection of form data. - The collection of form data. - The key. - - - Gets an enumerable that iterates through the collection. - The enumerable that iterates through the collection. - - - Gets the values of the collection of form data. - The values of the collection of form data. - The key. - - - Gets values associated with a given key. If there are multiple values, they're concatenated. - Values associated with a given key. If there are multiple values, they're concatenated. - - - Reads the collection of form data as a collection of name value. - The collection of form data as a collection of name value. - - - Gets an enumerable that iterates through the collection. - The enumerable that iterates through the collection. - - - - class for handling HTML form URL-ended data, also known as application/x-www-form-urlencoded. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Queries whether the can deserializean object of the specified type. - true if the can deserialize the type; otherwise, false. - The type to deserialize. - - - Queries whether the can serializean object of the specified type. - true if the can serialize the type; otherwise, false. - The type to serialize. - - - Gets the default media type for HTML form-URL-encoded data, which is application/x-www-form-urlencoded. - The default media type for HTML form-URL-encoded data - - - Gets or sets the maximum depth allowed by this formatter. - The maximum depth. - - - Gets or sets the size of the buffer when reading the incoming stream. - The buffer size. - - - Asynchronously deserializes an object of the specified type. - A whose result will be the object instance that has been read. - The type of object to deserialize. - The to read. - The for the content being read. - The to log events to. - - - Performs content negotiation. This is the process of selecting a response writer (formatter) in compliance with header values in the request. - - - Performs content negotiating by selecting the most appropriate out of the passed in formatters for the given request that can serialize an object of the given type. - The result of the negotiation containing the most appropriate instance, or null if there is no appropriate formatter. - The type to be serialized. - Request message, which contains the header values used to perform negotiation. - The set of objects from which to choose. - - - Specifies a callback interface that a formatter can use to log errors while reading. - - - Logs an error. - The path to the member for which the error is being logged. - The error message. - - - Logs an error. - The path to the member for which the error is being logged. - The error message to be logged. - - - Defines method that determines whether a given member is required on deserialization. - - - Determines whether a given member is required on deserialization. - true if should be treated as a required member; otherwise false. - The to be deserialized. - - - Represents the default used by . It uses the formatter's to select required members and recognizes the type annotation. - - - Initializes a new instance of the class. - The formatter to use for resolving required members. - - - Creates a property on the specified class by using the specified parameters. - A to create on the specified class by using the specified parameters. - The member info. - The member serialization. - - - Represents the class to handle JSON. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Determines whether this can read objects of the specified . - true if objects of this can be read, otherwise false. - The type of object that will be read. - - - Determines whether this can write objects of the specified . - true if objects of this can be written, otherwise false. - The type of object that will be written. - - - Called during deserialization to get the . - The object used for serialization. - The type of object that will be serialized or deserialized. - - - Called during deserialization to get the . - The reader to use during deserialization. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - - - Called during serialization to get the . - The writer to use during serialization. - The type of the object to write. - The stream to write to. - The encoding to use when writing. - - - Gets the default media type for JSON, namely "application/json". - The for JSON. - - - Gets or sets a value indicating whether to indent elements when writing data. - true if to indent elements when writing data; otherwise, false. - - - Gets or sets the maximum depth allowed by this formatter. - The maximum depth allowed by this formatter. - - - Called during deserialization to read an object of the specified type from the specified stream. - The object that has been read. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - The logger to log events to. - - - Gets or sets a value indicating whether to use by default. - true if to by default; otherwise, false. - - - Called during serialization to write an object of the specified type to the specified stream. - The type of the object to write. - The object to write. - The stream to write to. - The encoding to use when writing. - - - Called during serialization to write an object of the specified type to the specified stream. - Returns . - The type of the object to write. - The object to write. - The stream to write to. - The for the content being written. - The transport context. - The token to monitor for cancellation. - - - Base class to handle serializing and deserializing strongly-typed objects using . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Queries whether this can deserializean object of the specified type. - true if the can deserialize the type; otherwise, false. - The type to deserialize. - - - Queries whether this can serializean object of the specified type. - true if the can serialize the type; otherwise, false. - The type to serialize. - - - Gets the default value for the specified type. - The default value. - The type for which to get the default value. - - - Returns a specialized instance of the that can format a response for the given parameters. - Returns . - The type to format. - The request. - The media type. - - - Gets or sets the maximum number of keys stored in a T: . - The maximum number of keys. - - - Gets the mutable collection of objects that match HTTP requests to media types. - The collection. - - - Asynchronously deserializes an object of the specified type. - A whose result will be an object of the given type. - The type of the object to deserialize. - The to read. - The , if available. It may be null. - The to log events to. - Derived types need to support reading. - - - Asynchronously deserializes an object of the specified type. - A whose result will be an object of the given type. - The type of the object to deserialize. - The to read. - The , if available. It may be null. - The to log events to. - The token to cancel the operation. - - - Gets or sets the instance used to determine required members. - The instance. - - - Determines the best character encoding for reading or writing an HTTP entity body, given a set of content headers. - The encoding that is the best match. - The content headers. - - - Sets the default headers for content that will be formatted using this formatter. This method is called from the constructor. This implementation sets the Content-Type header to the value of mediaType if it is not null. If it is null it sets the Content-Type to the default media type of this formatter. If the Content-Type does not specify a charset it will set it using this formatters configured . - The type of the object being serialized. See . - The content headers that should be configured. - The authoritative media type. Can be null. - - - Gets the mutable collection of character encodings supported bythis . - The collection of objects. - - - Gets the mutable collection of media types supported bythis . - The collection of objects. - - - Asynchronously writes an object of the specified type. - A that will perform the write. - The type of the object to write. - The object value to write. It may be null. - The to which to write. - The if available. It may be null. - The if available. It may be null. - Derived types need to support writing. - - - Asynchronously writes an object of the specified type. - A that will perform the write. - The type of the object to write. - The object value to write. It may be null. - The to which to write. - The if available. It may be null. - The if available. It may be null. - The token to cancel the operation. - Derived types need to support writing. - - - Collection class that contains instances. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - A collection of instances to place in the collection. - - - Adds the elements of the specified collection to the end of the . - The items that should be added to the end of the . The items collection itself cannot be , but it can contain elements that are . - - - Removes all items in the collection. - - - Helper to search a collection for a formatter that can read the .NET type in the given mediaType. - The formatter that can read the type. Null if no formatter found. - The .NET type to read - The media type to match on. - - - Helper to search a collection for a formatter that can write the .NET type in the given mediaType. - The formatter that can write the type. Null if no formatter found. - The .NET type to read - The media type to match on. - - - Gets the to use for application/x-www-form-urlencoded data. - The to use for application/x-www-form-urlencoded data. - - - Inserts the specified item at the specified index in the collection. - The index to insert at. - The item to insert. - - - Inserts the elements of a collection into the at the specified index. - The zero-based index at which the new elements should be inserted. - The items that should be inserted into the . The items collection itself cannot be , but it can contain elements that are . - - - Returns true if the type is one of those loosely defined types that should be excluded from validation. - true if the type should be excluded; otherwise, false. - The .NET to validate. - - - Gets the to use for JSON. - The to use for JSON. - - - Removes the item at the specified index. - The index of the item to remove. - - - Assigns the item at the specified index in the collection. - The index to insert at. - The item to assign. - - - Gets the to use for XML. - The to use for XML. - - - - - - - This class describes how well a particular matches a request. - - - Initializes a new instance of the class. - The matching formatter. - The media type. Can be null in which case the media type application/octet-stream is used. - The quality of the match. Can be null in which case it is considered a full match with a value of 1.0 - The kind of match. - - - Gets the media type formatter. - - - Gets the matched media type. - - - Gets the quality of the match - - - Gets the kind of match that occurred. - - - Contains information about the degree to which a matches the explicit or implicit preferences found in an incoming request. - - - Matched on a type, meaning that the formatter is able to serialize the type. - - - Matched on an explicit “*/*” range in the Accept header. - - - Matched on an explicit literal accept header, such as “application/json”. - - - Matched on an explicit subtype range in an Accept header, such as “application/*”. - - - Matched on the media type of the entity body in the HTTP request message. - - - Matched on after having applied the various s. - - - No match was found - - - An abstract base class used to create an association between or instances that have certain characteristics and a specific . - - - Initializes a new instance of a with the given mediaType value. - The that is associated with or instances that have the given characteristics of the . - - - Initializes a new instance of a with the given mediaType value. - The that is associated with or instances that have the given characteristics of the . - - - Gets the that is associated with or instances that have the given characteristics of the . - - - Returns the quality of the match of the associated with request. - The quality of the match. It must be between 0.0 and 1.0. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match. - The to evaluate for the characteristics associated with the of the . - - - Class that provides s from query strings. - - - Initializes a new instance of the class. - The name of the query string parameter to match, if present. - The value of the query string parameter specified by queryStringParameterName. - The to use if the query parameter specified by queryStringParameterName is present and assigned the value specified by queryStringParameterValue. - - - Initializes a new instance of the class. - The name of the query string parameter to match, if present. - The value of the query string parameter specified by queryStringParameterName. - The media type to use if the query parameter specified by queryStringParameterName is present and assigned the value specified by queryStringParameterValue. - - - Gets the query string parameter name. - - - Gets the query string parameter value. - - - Returns a value indicating whether the current instance can return a from request. - If this instance can produce a from request it returns 1.0 otherwise 0.0. - The to check. - - - This class provides a mapping from an arbitrary HTTP request header field to a used to select instances for handling the entity body of an or . <remarks>This class only checks header fields associated with for a match. It does not check header fields associated with or instances.</remarks> - - - Initializes a new instance of the class. - Name of the header to match. - The header value to match. - The to use when matching headerValue. - if set to true then headerValue is considered a match if it matches a substring of the actual header value. - The to use if headerName and headerValue is considered a match. - - - Initializes a new instance of the class. - Name of the header to match. - The header value to match. - The value comparison to use when matching headerValue. - if set to true then headerValue is considered a match if it matches a substring of the actual header value. - The media type to use if headerName and headerValue is considered a match. - - - Gets the name of the header to match. - - - Gets the header value to match. - - - Gets the to use when matching . - - - Gets a value indicating whether is a matched as a substring of the actual header value. this instance is value substring. - truefalse - - - Returns a value indicating whether the current instance can return a from request. - The quality of the match. It must be between 0.0 and 1.0. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match. - The to check. - - - A that maps the X-Requested-With http header field set by AJAX XmlHttpRequest (XHR) to the media type application/json if no explicit Accept header fields are present in the request. - - - Initializes a new instance of class - - - Returns a value indicating whether the current instance can return a from request. - The quality of the match. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match and that the request was made using XmlHttpRequest without an Accept header. - The to check. - - - - class to handle Xml. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Queries whether the can deserializean object of the specified type. - true if the can deserialize the type; otherwise, false. - The type to deserialize. - - - Queries whether the can serializean object of the specified type. - true if the can serialize the type; otherwise, false. - The type to serialize. - - - Called during deserialization to get the DataContractSerializer serializer. - The object used for serialization. - The type of object that will be serialized or deserialized. - - - Called during deserialization to get the XML reader to use for reading objects from the stream. - The to use for reading objects. - The to read from. - The for the content being read. - - - Called during deserialization to get the XML serializer. - The object used for serialization. - The type of object that will be serialized or deserialized. - - - Called during serialization to get the XML writer to use for writing objects to the stream. - The to use for writing objects. - The to write to. - The for the content being written. - - - Gets the default media type for the XML formatter. - The default media type, which is “application/xml”. - - - Called during deserialization to get the XML serializer to use for deserializing objects. - An instance of or to use for deserializing the object. - The type of object to deserialize. - The for the content being read. - - - Called during serialization to get the XML serializer to use for serializing objects. - An instance of or to use for serializing the object. - The type of object to serialize. - The object to serialize. - The for the content being written. - - - Gets or sets a value indicating whether to indent elements when writing data. - true to indent elements; otherwise, false. - - - This method is to support infrastructure and is not intended to be used directly from your code. - Returns . - - - This method is to support infrastructure and is not intended to be used directly from your code. - Returns . - - - This method is to support infrastructure and is not intended to be used directly from your code. - Returns . - - - This method is to support infrastructure and is not intended to be used directly from your code. - Returns . - - - Gets and sets the maximum nested node depth. - The maximum nested node depth. - - - Called during deserialization to read an object of the specified type from the specified readStream. - A whose result will be the object instance that has been read. - The type of object to read. - The from which to read. - The for the content being read. - The to log events to. - - - Unregisters the serializer currently associated with the given type. - true if a serializer was previously registered for the type; otherwise, false. - The type of object whose serializer should be removed. - - - Registers an to read or write objects of a specified type. - The instance. - The type of object that will be serialized or deserialized with. - - - Registers an to read or write objects of a specified type. - The type of object that will be serialized or deserialized with. - The instance. - - - Registers an to read or write objects of a specified type. - The type of object that will be serialized or deserialized with. - The instance. - - - Registers an to read or write objects of a specified type. - The instance. - The type of object that will be serialized or deserialized with. - - - Gets or sets a value indicating whether the XML formatter uses the as the default serializer, instead of using the . - If true, the formatter uses the by default; otherwise, it uses the by default. - - - Gets the settings to be used while writing. - The settings to be used while writing. - - - Called during serialization to write an object of the specified type to the specified writeStream. - A that will write the value to the stream. - The type of object to write. - The object to write. - The to which to write. - The for the content being written. - The . - The token to monitor cancellation. - - - Represents the event arguments for the HTTP progress. - - - Initializes a new instance of the class. - The percentage of the progress. - The user token. - The number of bytes transferred. - The total number of bytes transferred. - - - - - Generates progress notification for both request entities being uploaded and response entities being downloaded. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The inner message handler. - - - Occurs when event entities are being downloaded. - - - Occurs when event entities are being uploaded. - - - Raises the event that handles the request of the progress. - The request. - The event handler for the request. - - - Raises the event that handles the response of the progress. - The request. - The event handler for the request. - - - Sends the specified progress message to an HTTP server for delivery. - The sent progress message. - The request. - The cancellation token. - - - Provides value for the cookie header. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The value of the name. - The values. - - - Initializes a new instance of the class. - The value of the name. - The value. - - - Creates a shallow copy of the cookie value. - A shallow copy of the cookie value. - - - Gets a collection of cookies sent by the client. - A collection object representing the client’s cookie variables. - - - Gets or sets the domain to associate the cookie with. - The name of the domain to associate the cookie with. - - - Gets or sets the expiration date and time for the cookie. - The time of day (on the client) at which the cookie expires. - - - Gets or sets a value that specifies whether a cookie is accessible by client-side script. - true if the cookie has the HttpOnly attribute and cannot be accessed through a client-side script; otherwise, false. - - - Gets a shortcut to the cookie property. - The cookie value. - - - Gets or sets the maximum age permitted for a resource. - The maximum age permitted for a resource. - - - Gets or sets the virtual path to transmit with the current cookie. - The virtual path to transmit with the cookie. - - - Gets or sets a value indicating whether to transmit the cookie using Secure Sockets Layer (SSL)—that is, over HTTPS only. - true to transmit the cookie over an SSL connection (HTTPS); otherwise, false. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Indicates a value whether the string representation will be converted. - true if the string representation will be converted; otherwise, false. - The input value. - The parsed value to convert. - - - Contains cookie name and its associated cookie state. - - - Initializes a new instance of the class. - The name of the cookie. - - - Initializes a new instance of the class. - The name of the cookie. - The collection of name-value pair for the cookie. - - - Initializes a new instance of the class. - The name of the cookie. - The value of the cookie. - - - Returns a new object that is a copy of the current instance. - A new object that is a copy of the current instance. - - - Gets or sets the cookie value with the specified cookie name, if the cookie data is structured. - The cookie value with the specified cookie name. - - - Gets or sets the name of the cookie. - The name of the cookie. - - - Returns the string representation the current object. - The string representation the current object. - - - Gets or sets the cookie value, if cookie data is a simple string value. - The value of the cookie. - - - Gets or sets the collection of name-value pair, if the cookie data is structured. - The collection of name-value pair for the cookie. - - - \ No newline at end of file diff --git a/lib/aspnetwebapi/System.Net.Http.Primitives.dll b/lib/aspnetwebapi/System.Net.Http.Primitives.dll deleted file mode 100644 index 48679fad49a..00000000000 Binary files a/lib/aspnetwebapi/System.Net.Http.Primitives.dll and /dev/null differ diff --git a/lib/aspnetwebapi/System.Net.Http.Primitives.xml b/lib/aspnetwebapi/System.Net.Http.Primitives.xml deleted file mode 100644 index 53640c6fee1..00000000000 --- a/lib/aspnetwebapi/System.Net.Http.Primitives.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - System.Net.Http.Primitives - - - - diff --git a/lib/aspnetwebapi/System.Web.Http.WebHost.dll b/lib/aspnetwebapi/System.Web.Http.WebHost.dll deleted file mode 100644 index 4f2b581e49a..00000000000 Binary files a/lib/aspnetwebapi/System.Web.Http.WebHost.dll and /dev/null differ diff --git a/lib/aspnetwebapi/System.Web.Http.WebHost.xml b/lib/aspnetwebapi/System.Web.Http.WebHost.xml deleted file mode 100644 index 89aabcce6da..00000000000 --- a/lib/aspnetwebapi/System.Web.Http.WebHost.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - System.Web.Http.WebHost - - - - Provides a global for ASP.NET applications. - - - - - - Gets the global . - - - Extension methods for - - - Maps the specified route template. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - - - Maps the specified route template and sets default route. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - - - Maps the specified route template and sets default route values and constraints. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - A set of expressions that specify values for routeTemplate. - - - Maps the specified route template and sets default route values, constraints, and end-point message handler. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - A set of expressions that specify values for routeTemplate. - The handler to which the request will be dispatched. - - - A that passes ASP.NET requests into the pipeline and write the result back. - - - Initializes a new instance of the class. - The route data. - - - Initializes a new instance of the class. - The route data. - The message handler to dispatch requests to. - - - Provides code that handles an asynchronous task - The asynchronous task. - The HTTP context. - - - A that returns instances of that can pass requests to a given instance. - - - Initializes a new instance of the class. - - - Provides the object that processes the request. - An object that processes the request. - An object that encapsulates information about the request. - - - Gets the singleton instance. - - - Provides the object that processes the request. - An object that processes the request. - An object that encapsulates information about the request. - - - Provides a registration point for the simple membership pre-application start code. - - - Registers the simple membership pre-application start code. - - - Represents the web host buffer policy selector. - - - Initializes a new instance of the class. - - - Gets a value that indicates whether the host should buffer the entity body of the HTTP request. - true if buffering should be used; otherwise a streamed request should be used. - The host context. - - - Uses a buffered output stream for the web host. - A buffered output stream. - The response. - - - Provides the catch blocks used within this assembly. - - - Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteBufferedResponseContentAsync. - The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteBufferedResponseContentAsync. - - - Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteErrorResponseContentAsync. - The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteErrorResponseContentAsync. - - - Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.ComputeContentLength. - The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.ComputeContentLength. - - - Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteStreamedResponseContentAsync. - The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteStreamedResponseContentAsync. - - - Gets the label for the catch block in System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpWebRoute.GetRouteData. - The catch block in System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpWebRoute.GetRouteData. - - - \ No newline at end of file diff --git a/lib/aspnetwebapi/System.Web.Http.dll b/lib/aspnetwebapi/System.Web.Http.dll deleted file mode 100644 index e1dbdd18250..00000000000 Binary files a/lib/aspnetwebapi/System.Web.Http.dll and /dev/null differ diff --git a/lib/aspnetwebapi/System.Web.Http.xml b/lib/aspnetwebapi/System.Web.Http.xml deleted file mode 100644 index 365dd7b93ad..00000000000 --- a/lib/aspnetwebapi/System.Web.Http.xml +++ /dev/null @@ -1,6664 +0,0 @@ - - - - System.Web.Http - - - - - Creates an that represents an exception. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The exception. - - - Creates an that represents an error message. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The error message. - - - Creates an that represents an exception with an error message. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The error message. - The exception. - - - Creates an that represents an error. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The HTTP error. - - - Creates an that represents an error in the model state. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The model state. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type formatter. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type formatter. - The media type header value. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type formatter. - The media type. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type header value. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The HTTP configuration which contains the dependency resolver used to resolve services. - The type of the HTTP response message. - - - - - - Disposes of all tracked resources associated with the which were added via the method. - The HTTP request. - - - - Gets the current X.509 certificate from the given HTTP request. - The current , or null if a certificate is not available. - The HTTP request. - - - Retrieves the for the given request. - The for the given request. - The HTTP request. - - - Retrieves the which has been assigned as the correlation ID associated with the given . The value will be created and set the first time this method is called. - The object that represents the correlation ID associated with the request. - The HTTP request. - - - Retrieves the for the given request or null if not available. - The for the given request or null if not available. - The HTTP request. - - - Gets the parsed query string as a collection of key-value pairs. - The query string as a collection of key-value pairs. - The HTTP request. - - - - - Retrieves the for the given request or null if not available. - The for the given request or null if not available. - The HTTP request. - - - Retrieves the for the given request or null if not available. - The for the given request or null if not available. - The HTTP request. - - - Gets a instance for an HTTP request. - A instance that is initialized for the specified HTTP request. - The HTTP request. - - - - - - Adds the given to a list of resources that will be disposed by a host once the is disposed. - The HTTP request controlling the lifecycle of . - The resource to dispose when is being disposed. - - - - - - - Represents the message extensions for the HTTP response from an ASP.NET operation. - - - Attempts to retrieve the value of the content for the . - The result of the retrieval of value of the content. - The response of the operation. - The value of the content. - The type of the value to retrieve. - - - Represents extensions for adding items to a . - - - - - Provides s from path extensions appearing in a . - - - Initializes a new instance of the class. - The extension corresponding to mediaType. This value should not include a dot or wildcards. - The that will be returned if uriPathExtension is matched. - - - Initializes a new instance of the class. - The extension corresponding to mediaType. This value should not include a dot or wildcards. - The media type that will be returned if uriPathExtension is matched. - - - Returns a value indicating whether this instance can provide a for the of request. - If this instance can match a file extension in request it returns 1.0 otherwise 0.0. - The to check. - - - Gets the path extension. - The path extension. - - - The path extension key. - - - Represents an attribute that specifies which HTTP methods an action method will respond to. - - - Initializes a new instance of the class by using the action method it will respond to. - The HTTP method that the action method will respond to. - - - Initializes a new instance of the class by using a list of HTTP methods that the action method will respond to. - The HTTP methods that the action method will respond to. - - - Gets or sets the list of HTTP methods that the action method will respond to. - Gets or sets the list of HTTP methods that the action method will respond to. - - - Represents an attribute that is used for the name of an action. - - - Initializes a new instance of the class. - The name of the action. - - - Gets or sets the name of the action. - The name of the action. - - - Specifies that actions and controllers are skipped by during authorization. - - - Initializes a new instance of the class. - - - Defines properties and methods for API controller. - - - - Gets the action context. - The action context. - - - Creates a . - A . - - - Creates an (400 Bad Request) with the specified error message. - An with the specified model state. - The user-visible error message. - - - Creates an with the specified model state. - An with the specified model state. - The model state to include in the error. - - - Gets the of the current . - The of the current . - - - Creates a (409 Conflict). - A . - - - Creates a <see cref="T:System.Web.Http.NegotiatedContentResult`1" /> with the specified values. - A <see cref="T:System.Web.Http.NegotiatedContentResult`1" /> with the specified values. - The HTTP status code for the response message. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The type of content in the entity body. - - - Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The value for the Content-Type header, or <see langword="null" /> to have the formatter pick a default value. - The type of content in the entity body. - - - Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The value for the Content-Type header. - The type of content in the entity body. - - - Gets the of the current . - The of the current . - - - Creates a (201 Created) with the specified values. - A with the specified values. - The location at which the content has been created. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a (201 Created) with the specified values. - A with the specified values. - The location at which the content has been created. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a (201 Created) with the specified values. - A with the specified values. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a (201 Created) with the specified values. - A with the specified values. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Executes asynchronously a single HTTP operation. - The newly started task. - The controller context for a single HTTP operation. - The cancellation token assigned for the HTTP operation. - - - Initializes the instance with the specified controllerContext. - The object that is used for the initialization. - - - Creates an (500 Internal Server Error). - A . - - - Creates an (500 Internal Server Error) with the specified exception. - An with the specified exception. - The exception to include in the error. - - - Creates a (200 OK) with the specified value. - A with the specified value. - The content value to serialize in the entity body. - The type of content in the entity body. - - - Creates a (200 OK) with the specified values. - A with the specified values. - The content value to serialize in the entity body. - The serializer settings. - The type of content in the entity body. - - - Creates a (200 OK) with the specified values. - A with the specified values. - The content value to serialize in the entity body. - The serializer settings. - The content encoding. - The type of content in the entity body. - - - Gets the model state after the model binding process. - The model state after the model binding process. - - - Creates a . - A . - - - Creates an (200 OK). - An . - - - Creates an with the specified values. - An with the specified values. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a redirect result (302 Found) with the specified value. - A redirect result (302 Found) with the specified value. - The location to redirect to. - - - Creates a redirect result (302 Found) with the specified value. - A redirect result (302 Found) with the specified value. - The location to redirect to. - - - Creates a redirect to route result (302 Found) with the specified values. - A redirect to route result (302 Found) with the specified values. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - - - Creates a redirect to route result (302 Found) with the specified values. - A redirect to route result (302 Found) with the specified values. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - - - Gets or sets the HttpRequestMessage of the current . - The HttpRequestMessage of the current . - - - Gets the request context. - The request context. - - - Creates a with the specified response. - A for the specified response. - The HTTP response message. - - - Creates a with the specified status code. - A with the specified status code. - The HTTP status code for the response message - - - Creates an (401 Unauthorized) with the specified values. - An with the specified values. - The WWW-Authenticate challenges. - - - Creates an (401 Unauthorized) with the specified values. - An with the specified values. - The WWW-Authenticate challenges. - - - Gets an instance of a , which is used to generate URLs to other APIs. - A , which is used to generate URLs to other APIs. - - - Returns the current principal associated with this request. - The current principal associated with this request. - - - Validates the given entity and adds the validation errors to the model state under the empty prefix, if any. - The entity being validated. - The type of the entity to be validated. - - - Validates the given entity and adds the validation errors to the model state, if any. - The entity being validated. - The key prefix under which the model state errors would be added in the model state. - The type of the entity to be validated. - - - Specifies the authorization filter that verifies the request's . - - - Initializes a new instance of the class. - - - Processes requests that fail authorization. - The context. - - - Indicates whether the specified control is authorized. - true if the control is authorized; otherwise, false. - The context. - - - Calls when an action is being authorized. - The context. - The context parameter is null. - - - Gets or sets the authorized roles. - The roles string. - - - Gets a unique identifier for this attribute. - A unique identifier for this attribute. - - - Gets or sets the authorized users. - The users string. - - - An attribute that specifies that an action parameter comes only from the entity body of the incoming . - - - Initializes a new instance of the class. - - - Gets a parameter binding. - The parameter binding. - The parameter description. - - - An attribute that specifies that an action parameter comes from the URI of the incoming . - - - Initializes a new instance of the class. - - - Gets the value provider factories for the model binder. - A collection of objects. - The configuration. - - - Represents attributes that specifies that HTTP binding should exclude a property. - - - Initializes a new instance of the class. - - - Represents the required attribute for http binding. - - - Initializes a new instance of the class. - - - Represents a configuration of instances. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with an HTTP route collection. - The HTTP route collection to associate with this instance. - - - Gets or sets the dependency resolver associated with thisinstance. - The dependency resolver. - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Invoke the Intializer hook. It is considered immutable from this point forward. It's safe to call this multiple times. - - - Gets the list of filters that apply to all requests served using this instance. - The list of filters. - - - Gets the media-type formatters for this instance. - A collection of objects. - - - Gets or sets a value indicating whether error details should be included in error messages. - The value that indicates that error detail policy. - - - Gets or sets the action that will perform final initialization of the instance before it is used to process requests. - The action that will perform final initialization of the instance. - - - Gets an ordered list of instances to be invoked as an travels up the stack and an travels down in stack in return. - The message handler collection. - - - Gets the collection of rules for how parameters should be bound. - A collection of functions that can produce a parameter binding for a given parameter. - - - Gets the properties associated with this instance. - The that contains the properties. - - - Gets the associated with this instance. - The . - - - Gets the container of default services associated with this instance. - The that contains the default services for this instance. - - - Gets the root virtual path. - The root virtual path. - - - Contains extension methods for the class. - - - - - Maps the attribute-defined routes for the application. - The server configuration. - The to use for discovering and building routes. - - - Maps the attribute-defined routes for the application. - The server configuration. - The constraint resolver. - - - Maps the attribute-defined routes for the application. - The server configuration. - The to use for resolving inline constraints. - The to use for discovering and building routes. - - - - Specifies that an action supports the DELETE HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Defines a serializable container for storing error information. This information is stored as key/value pairs. The dictionary keys to look up standard error information are available on the type. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class for . - The exception to use for error information. - true to include the exception information in the error; false otherwise - - - Initializes a new instance of the class containing error message . - The error message to associate with this instance. - - - Initializes a new instance of the class for . - The invalid model state to use for error information. - true to include exception messages in the error; false otherwise - - - Gets or sets the message of the if available. - The message of the if available. - - - Gets or sets the type of the if available. - The type of the if available. - - - Gets a particular property value from this error instance. - A particular property value from this error instance. - The name of the error property. - The type of the property. - - - Gets the inner associated with this instance if available. - The inner associated with this instance if available. - - - Gets or sets the high-level, user-visible message explaining the cause of the error. Information carried in this field should be considered public in that it will go over the wire regardless of the . As a result care should be taken not to disclose sensitive information about the server or the application. - The high-level, user-visible message explaining the cause of the error. Information carried in this field should be considered public in that it will go over the wire regardless of the . As a result care should be taken not to disclose sensitive information about the server or the application. - - - Gets or sets a detailed description of the error intended for the developer to understand exactly what failed. - A detailed description of the error intended for the developer to understand exactly what failed. - - - Gets the containing information about the errors that occurred during model binding. - The containing information about the errors that occurred during model binding. - - - Gets or sets the stack trace information associated with this instance if available. - The stack trace information associated with this instance if available. - - - This method is reserved and should not be used. - Always returns null. - - - Generates an instance from its XML representation. - The XmlReader stream from which the object is deserialized. - - - Converts an instance into its XML representation. - The XmlWriter stream to which the object is serialized. - - - Provides keys to look up error information stored in the dictionary. - - - Provides a key for the ErrorCode. - - - Provides a key for the ExceptionMessage. - - - Provides a key for the ExceptionType. - - - Provides a key for the InnerException. - - - Provides a key for the MessageDetail. - - - Provides a key for the Message. - - - Provides a key for the MessageLanguage. - - - Provides a key for the ModelState. - - - Provides a key for the StackTrace. - - - Specifies that an action supports the GET HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Specifies that an action supports the HEAD HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Represents an attribute that is used to restrict an HTTP method so that the method handles only HTTP OPTIONS requests. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Specifies that an action supports the PATCH HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Specifies that an action supports the POST HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Represents an attribute that is used to restrict an HTTP method so that the method handles only HTTP PUT requests. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - An exception that allows for a given to be returned to the client. - - - Initializes a new instance of the class. - The HTTP response to return to the client. - - - Initializes a new instance of the class. - The status code of the response. - - - Gets the HTTP response to return to the client. - The that represents the HTTP response. - - - A collection of instances. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The virtual path root. - - - Adds an instance to the collection. - The name of the route. - The instance to add to the collection. - - - Removes all items from the collection. - - - Determines whether the collection contains a specific . - true if the is found in the collection; otherwise, false. - The object to locate in the collection. - - - Determines whether the collection contains an element with the specified key. - true if the collection contains an element with the key; otherwise, false. - The key to locate in the collection. - - - Copies the instances of the collection to an array, starting at a particular array index. - The array that is the destination of the elements copied from the collection. - The zero-based index in at which copying begins. - - - Copies the route names and instances of the collection to an array, starting at a particular array index. - The array that is the destination of the elements copied from the collection. - The zero-based index in at which copying begins. - - - Gets the number of items in the collection. - The number of items in the collection. - - - Creates an instance. - The new instance. - The route template. - An object that contains the default route parameters. - An object that contains the route constraints. - The route data tokens. - - - Creates an instance. - The new instance. - The route template. - An object that contains the default route parameters. - An object that contains the route constraints. - The route data tokens. - The message handler for the route. - - - Creates an instance. - The new instance. - The route template. - An object that contains the default route parameters. - An object that contains the route constraints. - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Returns an enumerator that iterates through the collection. - An that can be used to iterate through the collection. - - - Gets the route data for a specified HTTP request. - An instance that represents the route data. - The HTTP request. - - - Gets a virtual path. - An instance that represents the virtual path. - The HTTP request. - The route name. - The route values. - - - Inserts an instance into the collection. - The zero-based index at which should be inserted. - The route name. - The to insert. The value cannot be null. - - - Gets a value indicating whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets the element at the specified index. - The at the specified index. - The index. - - - Gets or sets the element with the specified route name. - The at the specified index. - The route name. - - - Called internally to get the enumerator for the collection. - An that can be used to iterate through the collection. - - - Removes an instance from the collection. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the collection. - The name of the route to remove. - - - Adds an item to the collection. - The object to add to the collection. - - - Removes the first occurrence of a specific object from the collection. - true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the original collection. - The object to remove from the collection. - - - Returns an enumerator that iterates through the collection. - An object that can be used to iterate through the collection. - - - Gets the with the specified route name. - true if the collection contains an element with the specified name; otherwise, false. - The route name. - When this method returns, contains the instance, if the route name is found; otherwise, null. This parameter is passed uninitialized. - - - Validates that a constraint is valid for an created by a call to the method. - The route template. - The constraint name. - The constraint object. - - - Gets the virtual path root. - The virtual path root. - - - Extension methods for - - - Ignores the specified route. - Returns . - A collection of routes for the application. - The name of the route to ignore. - The route template for the route. - - - Ignores the specified route. - Returns . - A collection of routes for the application. - The name of the route to ignore. - The route template for the route. - A set of expressions that specify values for the route template. - - - Maps the specified route for handling HTTP batch requests. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - The for handling batch requests. - - - Maps the specified route template. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - - - Maps the specified route template and sets default route values. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - - - Maps the specified route template and sets default route values and constraints. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - A set of expressions that specify values for . - - - Maps the specified route template and sets default route values, constraints, and end-point message handler. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - A set of expressions that specify values for . - The handler to which the request will be dispatched. - - - Defines an implementation of an which dispatches an incoming and creates an as a result. - - - Initializes a new instance of the class, using the default configuration and dispatcher. - - - Initializes a new instance of the class with a specified dispatcher. - The HTTP dispatcher that will handle incoming requests. - - - Initializes a new instance of the class with a specified configuration. - The used to configure this instance. - - - Initializes a new instance of the class with a specified configuration and dispatcher. - The used to configure this instance. - The HTTP dispatcher that will handle incoming requests. - - - Gets the used to configure this instance. - The used to configure this instance. - - - Gets the HTTP dispatcher that handles incoming requests. - The HTTP dispatcher that handles incoming requests. - - - Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Prepares the server for operation. - - - Dispatches an incoming . - A task representing the asynchronous operation. - The request to dispatch. - The token to monitor for cancellation requests. - - - Defines a command that asynchronously creates an . - - - Creates an asynchronously. - A task that, when completed, contains the . - The token to monitor for cancellation requests. - - - Specifies whether error details, such as exception messages and stack traces, should be included in error messages. - - - Always include error details. - - - Use the default behavior for the host environment. For ASP.NET hosting, use the value from the customErrors element in the Web.config file. For self-hosting, use the value . - - - Only include error details when responding to a local request. - - - Never include error details. - - - Represents an attribute that is used to indicate that a controller method is not an action method. - - - Initializes a new instance of the class. - - - Represents a filter attribute that overrides action filters defined at a higher level. - - - Initializes a new instance of the class. - - - Gets a value indicating whether the action filter allows multiple attribute. - true if the action filter allows multiple attribute; otherwise, false. - - - Gets the type of filters to override. - The type of filters to override. - - - Represents a filter attribute that overrides authentication filters defined at a higher level. - - - - - - Represents a filter attribute that overrides authorization filters defined at a higher level. - - - Initializes a new instance of the class. - - - Gets or sets a Boolean value indicating whether more than one instance of the indicated attribute can be specified for a single program element. - true if more than one instance is allowed to be specified; otherwise, false. - - - Gets the type to filters override attributes. - The type to filters override attributes. - - - Represents a filter attribute that overrides exception filters defined at a higher level. - - - - - - Attribute on a parameter or type that produces a . If the attribute is on a type-declaration, then it's as if that attribute is present on all action parameters of that type. - - - Initializes a new instance of the class. - - - Gets the parameter binding. - The parameter binding. - The parameter description. - - - Place on an action to expose it directly via a route. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The route template describing the URI pattern to match against. - - - Returns . - - - Returns . - - - - Returns . - - - The class can be used to indicate properties about a route parameter (the literals and placeholders located within segments of a ). It can for example be used to indicate that a route parameter is optional. - - - An optional parameter. - - - Returns a that represents this instance. - A that represents this instance. - - - Annotates a controller with a route prefix that applies to all actions within the controller. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The route prefix for the controller. - - - Gets the route prefix. - - - Provides type-safe accessors for services obtained from a object. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Returns the registered unhandled exception handler, if any. - The registered unhandled exception hander, if present; otherwise, null. - The services container. - - - Returns the collection of registered unhandled exception loggers. - The collection of registered unhandled exception loggers. - The services container. - - - Gets the collection. - Returns a collection of objects. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance, or null if no instance was registered. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the collection. - Returns a collection of objects. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the collection. - Returns a collection ofobjects. - The services container. - - - Gets the service. - Returns aninstance. - The services container. - - - Gets the service. - Returns aninstance. - The services container. - - - Gets the collection. - Returns a collection of objects. - The services container. - - - Represents an containing zero or one entities. Use together with an [EnableQuery] from the System.Web.Http.OData or System.Web.OData namespace. - - - Initializes a new instance of the class. - The containing zero or one entities. - - - Creates a from an . A helper method to instantiate a object without having to explicitly specify the type . - The created . - The containing zero or one entities. - The type of the data in the data source. - - - The containing zero or one entities. - - - Represents an containing zero or one entities. Use together with an [EnableQuery] from the System.Web.Http.OData or System.Web.OData namespace. - The type of the data in the data source. - - - Initializes a new instance of the class. - The containing zero or one entities. - - - The containing zero or one entities. - - - Defines the order of execution for batch requests. - - - Executes the batch requests non-sequentially. - - - Executes the batch requests sequentially. - - - Provides extension methods for the class. - - - Copies the properties from another . - The sub-request. - The batch request that contains the properties to copy. - - - Represents the default implementation of that encodes the HTTP request/response messages as MIME multipart. - - - Initializes a new instance of the class. - The for handling the individual batch requests. - - - Creates the batch response message. - The batch response message. - The responses for the batch requests. - The original request containing all the batch requests. - The cancellation token. - - - Executes the batch request messages. - A collection of for the batch requests. - The collection of batch request messages. - The cancellation token. - - - Gets or sets the execution order for the batch requests. The default execution order is sequential. - The execution order for the batch requests. The default execution order is sequential. - - - Converts the incoming batch request into a collection of request messages. - A collection of . - The request containing the batch request messages. - The cancellation token. - - - Processes the batch requests. - The result of the operation. - The batch request. - The cancellation token. - - - Gets the supported content types for the batch request. - The supported content types for the batch request. - - - Validates the incoming request that contains the batch request messages. - The request containing the batch request messages. - - - Defines the abstraction for handling HTTP batch requests. - - - Initializes a new instance of the class. - The for handling the individual batch requests. - - - Gets the invoker to send the batch requests to the . - The invoker to send the batch requests to the . - - - Processes the incoming batch request as a single . - The batch response. - The batch request. - The cancellation token. - - - Sends the batch handler asynchronously. - The result of the operation. - the send request. - The cancelation token. - - - Invokes the action methods of a controller. - - - Initializes a new instance of the class. - - - Asynchronously invokes the specified action by using the specified controller context. - The invoked action. - The controller context. - The cancellation token. - - - Represents a reflection based action selector. - - - Initializes a new instance of the class. - - - Gets the action mappings for the . - The action mappings. - The information that describes a controller. - - - Selects an action for the . - The selected action. - The controller context. - - - Represents a container for services that can be specific to a controller. This shadows the services from its parent . A controller can either set a service here, or fall through to the more global set of services. - - - Initializes a new instance of the class. - The parent services container. - - - Removes a single-instance service from the default services. - The type of service. - - - Gets a service of the specified type. - The first instance of the service, or null if the service is not found. - The type of service. - - - Gets the list of service objects for a given service type, and validates the service type. - The list of service objects of the specified type. - The service type. - - - Gets the list of service objects for a given service type. - The list of service objects of the specified type, or an empty list if the service is not found. - The type of service. - - - Queries whether a service type is single-instance. - true if the service type has at most one instance, or false if the service type supports multiple instances. - The service type. - - - Replaces a single-instance service object. - The service type. - The service object that replaces the previous instance. - - - Describes *how* the binding will happen and does not actually bind. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The back pointer to the action this binding is for. - The synchronous bindings for each parameter. - - - Gets or sets the back pointer to the action this binding is for. - The back pointer to the action this binding is for. - - - Executes asynchronously the binding for the given request context. - Task that is signaled when the binding is complete. - The action context for the binding. This contains the parameter dictionary that will get populated. - The cancellation token for cancelling the binding operation. Or a binder can also bind a parameter to this. - - - Gets or sets the synchronous bindings for each parameter. - The synchronous bindings for each parameter. - - - Contains information for the executing action. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The controller context. - The action descriptor. - - - Gets a list of action arguments. - A list of action arguments. - - - Gets or sets the action descriptor for the action context. - The action descriptor. - - - Gets or sets the controller context. - The controller context. - - - Gets the model state dictionary for the context. - The model state dictionary. - - - Gets the request message for the action context. - The request message for the action context. - - - Gets the current request context. - The current request context. - - - Gets or sets the response message for the action context. - The response message for the action context. - - - Contains extension methods for . - - - - - - - - - - - Provides information about the action methods. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with specified information that describes the controller of the action.. - The information that describes the controller of the action. - - - Gets or sets the binding that describes the action. - The binding that describes the action. - - - Gets the name of the action. - The name of the action. - - - Gets or sets the action configuration. - The action configuration. - - - Gets the information that describes the controller of the action. - The information that describes the controller of the action. - - - Executes the described action and returns a that once completed will contain the return value of the action. - A that once completed will contain the return value of the action. - The controller context. - A list of arguments. - The cancellation token. - - - Returns the custom attributes associated with the action descriptor. - The custom attributes associated with the action descriptor. - The action descriptor. - - - Gets the custom attributes for the action. - The collection of custom attributes applied to this action. - true to search this action's inheritance chain to find the attributes; otherwise, false. - The type of attribute to search for. - - - Retrieves the filters for the given configuration and action. - The filters for the given configuration and action. - - - Retrieves the filters for the action descriptor. - The filters for the action descriptor. - - - Retrieves the parameters for the action descriptor. - The parameters for the action descriptor. - - - Gets the properties associated with this instance. - The properties associated with this instance. - - - Gets the converter for correctly transforming the result of calling ExecuteAsync(HttpControllerContext, IDictionaryString, Object)" into an instance of . - The action result converter. - - - Gets the return type of the descriptor. - The return type of the descriptor. - - - Gets the collection of supported HTTP methods for the descriptor. - The collection of supported HTTP methods for the descriptor. - - - Contains information for a single HTTP operation. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The request context. - The HTTP request. - The controller descriptor. - The controller. - - - Initializes a new instance of the class. - The configuration. - The route data. - The request. - - - Gets or sets the configuration. - The configuration. - - - Gets or sets the HTTP controller. - The HTTP controller. - - - Gets or sets the controller descriptor. - The controller descriptor. - - - Gets or sets the request. - The request. - - - Gets or sets the request context. - - - Gets or sets the route data. - The route data. - - - Represents information that describes the HTTP controller. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The configuration. - The controller name. - The controller type. - - - Gets or sets the configurations associated with the controller. - The configurations associated with the controller. - - - Gets or sets the name of the controller. - The name of the controller. - - - Gets or sets the type of the controller. - The type of the controller. - - - Creates a controller instance for the given . - The created controller instance. - The request message. - - - Retrieves a collection of custom attributes of the controller. - A collection of custom attributes. - The type of the object. - - - Returns a collection of attributes that can be assigned to <typeparamref name="T" /> for this descriptor's controller. - A collection of attributes associated with this controller. - true to search this controller's inheritance chain to find the attributes; otherwise, false. - Used to filter the collection of attributes. Use a value of to retrieve all attributes. - - - Returns a collection of filters associated with the controller. - A collection of filters associated with the controller. - - - Gets the properties associated with this instance. - The properties associated with this instance. - - - Contains settings for an HTTP controller. - - - Initializes a new instance of the class. - A configuration object that is used to initialize the instance. - - - Gets the collection of instances for the controller. - The collection of instances. - - - Gets the collection of parameter bindingfunctions for for the controller. - The collection of parameter binding functions. - - - Gets the collection of service instances for the controller. - The collection of service instances. - - - Describes how a parameter is bound. The binding should be static (based purely on the descriptor) and can be shared across requests. - - - Initializes a new instance of the class. - An that describes the parameters. - - - Gets the that was used to initialize this instance. - The instance. - - - If the binding is invalid, gets an error message that describes the binding error. - An error message. If the binding was successful, the value is null. - - - Asynchronously executes the binding for the given request. - A task object representing the asynchronous operation. - Metadata provider to use for validation. - The action context for the binding. The action context contains the parameter dictionary that will get populated with the parameter. - Cancellation token for cancelling the binding operation. - - - Gets the parameter value from argument dictionary of the action context. - The value for this parameter in the given action context, or null if the parameter has not yet been set. - The action context. - - - Gets a value that indicates whether the binding was successful. - true if the binding was successful; otherwise, false. - - - Sets the result of this parameter binding in the argument dictionary of the action context. - The action context. - The parameter value. - - - Returns a value indicating whether this instance will read the entity body of the HTTP message. - true if this will read the entity body; otherwise, false. - - - Represents the HTTP parameter descriptor. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The action descriptor. - - - Gets or sets the action descriptor. - The action descriptor. - - - Gets or sets the for the . - The for the . - - - Gets the default value of the parameter. - The default value of the parameter. - - - Retrieves a collection of the custom attributes from the parameter. - A collection of the custom attributes from the parameter. - The type of the custom attributes. - - - Gets a value that indicates whether the parameter is optional. - true if the parameter is optional; otherwise, false. - - - Gets or sets the parameter binding attribute. - The parameter binding attribute. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Gets the prefix of this parameter. - The prefix of this parameter. - - - Gets the properties of this parameter. - The properties of this parameter. - - - Represents the context associated with a request. - - - Initializes a new instance of the class. - - - Gets or sets the client certificate. - Returns . - - - Gets or sets the configuration. - Returns . - - - Gets or sets a value indicating whether error details, such as exception messages and stack traces, should be included in the response for this request. - Returns . - - - Gets or sets a value indicating whether the request originates from a local address. - Returns . - - - .Gets or sets the principal - Returns . - - - Gets or sets the route data. - Returns . - - - Gets or sets the factory used to generate URLs to other APIs. - Returns . - - - Gets or sets the virtual path root. - Returns . - - - - - A contract for a conversion routine that can take the result of an action returned from <see cref="M:System.Web.Http.Controllers.HttpActionDescriptor.ExecuteAsync(System.Web.Http.Controllers.HttpControllerContext,System.Collections.Generic.IDictionary{System.String,System.Object})" /> and convert it to an instance of . - - - Converts the specified object to another object. - The converted object. - The controller context. - The action result. - - - Defines the method for retrieval of action binding associated with parameter value. - - - Gets the . - A object. - The action descriptor. - - - If a controller is decorated with an attribute with this interface, then it gets invoked to initialize the controller settings. - - - Callback invoked to set per-controller overrides for this controllerDescriptor. - The controller settings to initialize. - The controller descriptor. Note that the can be associated with the derived controller type given that is inherited. - - - Contains method that is used to invoke HTTP operation. - - - Executes asynchronously the HTTP operation. - The newly started task. - The execution context. - The cancellation token assigned for the HTTP operation. - - - Contains the logic for selecting an action method. - - - Returns a map, keyed by action string, of all that the selector can select. This is primarily called by to discover all the possible actions in the controller. - A map of that the selector can select, or null if the selector does not have a well-defined mapping of . - The controller descriptor. - - - Selects the action for the controller. - The action for the controller. - The context of the controller. - - - Represents an HTTP controller. - - - Executes the controller for synchronization. - The controller. - The current context for a test controller. - The notification that cancels the operation. - - - Defines extension methods for . - - - Binds parameter that results as an error. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The error message that describes the reason for fail bind. - - - Bind the parameter as if it had the given attribute on the declaration. - The HTTP parameter binding object. - The parameter to provide binding for. - The attribute that describes the binding. - - - Binds parameter by parsing the HTTP body content. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - - - Binds parameter by parsing the HTTP body content. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object. - - - Binds parameter by parsing the HTTP body content. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object. - The body model validator used to validate the parameter. - - - Binds parameter by parsing the HTTP body content. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The value provider factories which provide query string parameter data. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The model binder used to assemble the parameter into an object. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The model binder used to assemble the parameter into an object. - The value provider factories which provide query string parameter data. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The value provider factories which provide query string parameter data. - - - Represents a reflected synchronous or asynchronous action method. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified descriptor and method details.. - The controller descriptor. - The action-method information. - - - Gets the name of the action. - The name of the action. - - - - Executes the described action and returns a that once completed will contain the return value of the action. - A [T:System.Threading.Tasks.Task`1"] that once completed will contain the return value of the action. - The context. - The arguments. - A cancellation token to cancel the action. - - - Returns an array of custom attributes defined for this member, identified by type. - An array of custom attributes or an empty array if no custom attributes exist. - true to search this action's inheritance chain to find the attributes; otherwise, false. - The type of the custom attributes. - - - Retrieves information about action filters. - The filter information. - - - - Retrieves the parameters of the action method. - The parameters of the action method. - - - Gets or sets the action-method information. - The action-method information. - - - Gets the return type of this method. - The return type of this method. - - - Gets or sets the supported http methods. - The supported http methods. - - - Represents the reflected HTTP parameter descriptor. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The action descriptor. - The parameter information. - - - Gets the default value for the parameter. - The default value for the parameter. - - - Retrieves a collection of the custom attributes from the parameter. - A collection of the custom attributes from the parameter. - The type of the custom attributes. - - - Gets a value that indicates whether the parameter is optional. - true if the parameter is optional; otherwise false. - - - Gets or sets the parameter information. - The parameter information. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Represents a converter for actions with a return type of . - - - Initializes a new instance of the class. - - - Converts a object to another object. - The converted object. - The controller context. - The action result. - - - An abstract class that provides a container for services used by ASP.NET Web API. - - - Initializes a new instance of the class. - - - Adds a service to the end of services list for the given service type. - The service type. - The service instance. - - - Adds the services of the specified collection to the end of the services list for the given service type. - The service type. - The services to add. - - - Removes all the service instances of the given service type. - The service type to clear from the services list. - - - Removes all instances of a multi-instance service type. - The service type to remove. - - - Removes a single-instance service type. - The service type to remove. - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - Searches for a service that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence. - The zero-based index of the first occurrence, if found; otherwise, -1. - The service type. - The delegate that defines the conditions of the element to search for. - - - Gets a service instance of a specified type. - The service type. - - - Gets a mutable list of service instances of a specified type. - A mutable list of service instances. - The service type. - - - Gets a collection of service instanes of a specified type. - A collection of service instances. - The service type. - - - Inserts a service into the collection at the specified index. - The service type. - The zero-based index at which the service should be inserted. If is passed, ensures the element is added to the end. - The service to insert. - - - Inserts the elements of the collection into the service list at the specified index. - The service type. - The zero-based index at which the new elements should be inserted. If is passed, ensures the elements are added to the end. - The collection of services to insert. - - - Determine whether the service type should be fetched with GetService or GetServices. - true iff the service is singular. - type of service to query - - - Removes the first occurrence of the given service from the service list for the given service type. - true if the item is successfully removed; otherwise, false. - The service type. - The service instance to remove. - - - Removes all the elements that match the conditions defined by the specified predicate. - The number of elements removed from the list. - The service type. - The delegate that defines the conditions of the elements to remove. - - - Removes the service at the specified index. - The service type. - The zero-based index of the service to remove. - - - Replaces all existing services for the given service type with the given service instance. This works for both singular and plural services. - The service type. - The service instance. - - - Replaces all instances of a multi-instance service with a new instance. - The type of service. - The service instance that will replace the current services of this type. - - - Replaces all existing services for the given service type with the given service instances. - The service type. - The service instances. - - - Replaces a single-instance service of a specified type. - The service type. - The service instance. - - - Removes the cached values for a single service type. - The service type. - - - A converter for creating responses from actions that return an arbitrary value. - The declared return type of an action. - - - Initializes a new instance of the class. - - - Converts the result of an action with arbitrary return type to an instance of . - The newly created object. - The action controller context. - The execution result. - - - Represents a converter for creating a response from actions that do not return a value. - - - Initializes a new instance of the class. - - - Converts the created response from actions that do not return a value. - The converted response. - The context of the controller. - The result of the action. - - - Represents a dependency injection container. - - - Starts a resolution scope. - The dependency scope. - - - Represents an interface for the range of the dependencies. - - - Retrieves a service from the scope. - The retrieved service. - The service to be retrieved. - - - Retrieves a collection of services from the scope. - The retrieved collection of services. - The collection of services to be retrieved. - - - Describes an API defined by relative URI path and HTTP method. - - - Initializes a new instance of the class. - - - Gets or sets the action descriptor that will handle the API. - The action descriptor. - - - Gets or sets the documentation of the API. - The documentation. - - - Gets or sets the HTTP method. - The HTTP method. - - - Gets the ID. The ID is unique within . - The ID. - - - Gets the parameter descriptions. - The parameter descriptions. - - - Gets or sets the relative path. - The relative path. - - - Gets or sets the response description. - The response description. - - - Gets or sets the registered route for the API. - The route. - - - Gets the supported request body formatters. - The supported request body formatters. - - - Gets the supported response formatters. - The supported response formatters. - - - Explores the URI space of the service based on routes, controllers and actions available in the system. - - - Initializes a new instance of the class. - The configuration. - - - Gets the API descriptions. The descriptions are initialized on the first access. - - - Gets or sets the documentation provider. The provider will be responsible for documenting the API. - The documentation provider. - - - Gets a collection of HttpMethods supported by the action. Called when initializing the . - A collection of HttpMethods supported by the action. - The route. - The action descriptor. - - - Determines whether the action should be considered for generation. Called when initializing the . - true if the action should be considered for generation, false otherwise. - The action variable value from the route. - The action descriptor. - The route. - - - Determines whether the controller should be considered for generation. Called when initializing the . - true if the controller should be considered for generation, false otherwise. - The controller variable value from the route. - The controller descriptor. - The route. - - - This attribute can be used on the controllers and actions to influence the behavior of . - - - Initializes a new instance of the class. - - - Gets or sets a value indicating whether to exclude the controller or action from the instances generated by . - true if the controller or action should be ignored; otherwise, false. - - - Describes a parameter on the API defined by relative URI path and HTTP method. - - - Initializes a new instance of the class. - - - Gets or sets the documentation. - The documentation. - - - Gets or sets the name. - The name. - - - Gets or sets the parameter descriptor. - The parameter descriptor. - - - Gets or sets the source of the parameter. It may come from the request URI, request body or other places. - The source. - - - Describes where the parameter come from. - - - The parameter come from Body. - - - The parameter come from Uri. - - - The location is unknown. - - - Defines the interface for getting a collection of . - - - Gets the API descriptions. - - - Defines the provider responsible for documenting the service. - - - Gets the documentation based on . - The documentation for the controller. - The action descriptor. - - - - Gets the documentation based on . - The documentation for the controller. - The parameter descriptor. - - - - Describes the API response. - - - Initializes a new instance of the class. - - - Gets or sets the declared response type. - The declared response type. - - - Gets or sets the response documentation. - The response documentation. - - - Gets or sets the actual response type. - The actual response type. - - - Use this to specify the entity type returned by an action when the declared return type is or . The will be read by when generating . - - - Initializes a new instance of the class. - The response type. - - - Gets the response type. - - - Provides an implementation of with no external dependencies. - - - Initializes a new instance of the class. - - - Returns a list of assemblies available for the application. - A <see cref="T:System.Collections.ObjectModel.Collection`1" /> of assemblies. - - - Represents a default implementation of an . A different implementation can be registered via the . We optimize for the case where we have an instance per instance but can support cases where there are many instances for one as well. In the latter case the lookup is slightly slower because it goes through the dictionary. - - - Initializes a new instance of the class. - - - Creates the specified by using the given . - An instance of type . - The request message. - The controller descriptor. - The type of the controller. - - - Represents a default instance for choosing a given a . A different implementation can be registered via the . - - - Initializes a new instance of the class. - The configuration. - - - Specifies the suffix string in the controller name. - - - Returns a map, keyed by controller string, of all that the selector can select. - A map of all that the selector can select, or null if the selector does not have a well-defined mapping of . - - - Gets the name of the controller for the specified . - The name of the controller for the specified . - The HTTP request message. - - - Selects a for the given . - The instance for the given . - The HTTP request message. - - - Provides an implementation of with no external dependencies. - - - Initializes a new instance of the class. - - - Initializes a new instance using a predicate to filter controller types. - The predicate. - - - Returns a list of controllers available for the application. - An <see cref="T:System.Collections.Generic.ICollection`1" /> of controllers. - The assemblies resolver. - - - Gets a value whether the resolver type is a controller type predicate. - true if the resolver type is a controller type predicate; otherwise, false. - - - Dispatches an incoming to an implementation for processing. - - - Initializes a new instance of the class with the specified configuration. - The http configuration. - - - Gets the HTTP configuration. - The HTTP configuration. - - - Dispatches an incoming to an . - A representing the ongoing operation. - The request to dispatch - The cancellation token. - - - This class is the default endpoint message handler which examines the of the matched route, and chooses which message handler to call. If is null, then it delegates to . - - - Initializes a new instance of the class, using the provided and as the default handler. - The server configuration. - - - Initializes a new instance of the class, using the provided and . - The server configuration. - The default handler to use when the has no . - - - Sends an HTTP request as an asynchronous operation. - The task object representing the asynchronous operation. - The HTTP request message to send. - The cancellation token to cancel operation. - - - Provides an abstraction for managing the assemblies of an application. A different implementation can be registered via the . - - - Returns a list of assemblies available for the application. - An <see cref="T:System.Collections.Generic.ICollection`1" /> of assemblies. - - - Defines the methods that are required for an . - - - Creates an object. - An object. - The message request. - The HTTP controller descriptor. - The type of the controller. - - - Defines the methods that are required for an factory. - - - Returns a map, keyed by controller string, of all that the selector can select. This is primarily called by to discover all the possible controllers in the system. - A map of all that the selector can select, or null if the selector does not have a well-defined mapping of . - - - Selects a for the given . - An instance. - The request message. - - - Provides an abstraction for managing the controller types of an application. A different implementation can be registered via the DependencyResolver. - - - Returns a list of controllers available for the application. - An <see cref="T:System.Collections.Generic.ICollection`1" /> of controllers. - The resolver for failed assemblies. - - - Provides the catch blocks used within this assembly. - - - Gets the catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpBatchHandler.SendAsync. - The catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpBatchHandler.SendAsync. - - - Gets the catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpControllerDispatcher.SendAsync. - The catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpControllerDispatcher.SendAsync. - - - Gets the catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpServer.SendAsync. - The catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpServer.SendAsync. - - - Gets the catch block in System.Web.Http.ApiController.ExecuteAsync when using . - The catch block in System.Web.Http.ApiController.ExecuteAsync when using . - - - Represents an exception and the contextual data associated with it when it was caught. - - - Initializes a new instance of the class. - The caught exception. - The catch block where the exception was caught. - - - Initializes a new instance of the class. - The caught exception. - The catch block where the exception was caught. - The request being processed when the exception was caught. - - - Initializes a new instance of the class. - The caught exception. - The catch block where the exception was caught. - The request being processed when the exception was caught. - The repsonse being returned when the exception was caught. - - - Initializes a new instance of the class. - The caught exception. - The catch block where the exception was caught. - The action context in which the exception occurred. - - - Gets the action context in which the exception occurred, if available. - The action context in which the exception occurred, if available. - - - Gets the catch block in which the exception was caught. - The catch block in which the exception was caught. - - - Gets the controller context in which the exception occurred, if available. - The controller context in which the exception occurred, if available. - - - Gets the caught exception. - The caught exception. - - - Gets the request being processed when the exception was caught. - The request being processed when the exception was caught. - - - Gets the request context in which the exception occurred. - The request context in which the exception occurred. - - - Gets the response being sent when the exception was caught. - The response being sent when the exception was caught. - - - Represents the catch block location for an exception context. - - - Initializes a new instance of the class. - The label for the catch block where the exception was caught. - A value indicating whether the catch block where the exception was caught is the last one before the host. - A value indicating whether exceptions in the catch block can be handled after they are logged. - - - Gets a value indicating whether exceptions in the catch block can be handled after they are logged. - A value indicating whether exceptions in the catch block can be handled after they are logged. - - - Gets a value indicating whether the catch block where the exception was caught is the last one before the host. - A value indicating whether the catch block where the exception was caught is the last one before the host. - - - Gets a label for the catch block in which the exception was caught. - A label for the catch block in which the exception was caught. - - - Returns . - - - Represents an unhandled exception handler. - - - Initializes a new instance of the class. - - - When overridden in a derived class, handles the exception synchronously. - The exception handler context. - - - When overridden in a derived class, handles the exception asynchronously. - A task representing the asynchronous exception handling operation. - The exception handler context. - The token to monitor for cancellation requests. - - - Determines whether the exception should be handled. - true if the exception should be handled; otherwise, false. - The exception handler context. - - - Returns . - - - Represents the context within which unhandled exception handling occurs. - - - Initializes a new instance of the class. - The exception context. - - - Gets the catch block in which the exception was caught. - The catch block in which the exception was caught. - - - Gets the caught exception. - The caught exception. - - - Gets the exception context providing the exception and related data. - The exception context providing the exception and related data. - - - Gets the request being processed when the exception was caught. - The request being processed when the exception was caught. - - - Gets the request context in which the exception occurred. - The request context in which the exception occurred. - - - Gets or sets the result providing the response message when the exception is handled. - The result providing the response message when the exception is handled. - - - Provides extension methods for . - - - Calls an exception handler and determines the response handling it, if any. - A task that, when completed, contains the response message to return when the exception is handled, or null when the exception remains unhandled. - The unhandled exception handler. - The exception context. - The token to monitor for cancellation requests. - - - Represents an unhandled exception logger. - - - Initializes a new instance of the class. - - - When overridden in a derived class, logs the exception synchronously. - The exception logger context. - - - When overridden in a derived class, logs the exception asynchronously. - A task representing the asynchronous exception logging operation. - The exception logger context. - The token to monitor for cancellation requests. - - - Determines whether the exception should be logged. - true if the exception should be logged; otherwise, false. - The exception logger context. - - - Returns . - - - Represents the context within which unhandled exception logging occurs. - - - Initializes a new instance of the class. - The exception context. - - - Gets or sets a value indicating whether the exception can subsequently be handled by an to produce a new response message. - A value indicating whether the exception can subsequently be handled by an to produce a new response message. - - - Gets the catch block in which the exception was caught. - The catch block in which the exception was caught. - - - Gets the caught exception. - The caught exception. - - - Gets the exception context providing the exception and related data. - The exception context providing the exception and related data. - - - Gets the request being processed when the exception was caught. - The request being processed when the exception was caught. - - - Gets the request context in which the exception occurred. - The request context in which the exception occurred. - - - Provides extension methods for . - - - Calls an exception logger. - A task representing the asynchronous exception logging operation. - The unhandled exception logger. - The exception context. - The token to monitor for cancellation requests. - - - Creates exception services to call logging and handling from catch blocks. - - - Gets an exception handler that calls the registered handler service, if any, and ensures exceptions do not accidentally propagate to the host. - An exception handler that calls any registered handler and ensures exceptions do not accidentally propagate to the host. - The services container. - - - Gets an exception handler that calls the registered handler service, if any, and ensures exceptions do not accidentally propagate to the host. - An exception handler that calls any registered handler and ensures exceptions do not accidentally propagate to the host. - The configuration. - - - Gets an exception logger that calls all registered logger services. - A composite logger. - The services container. - - - Gets an exception logger that calls all registered logger services. - A composite logger. - The configuration. - - - Defines an unhandled exception handler. - - - Process an unhandled exception, either allowing it to propagate or handling it by providing a response message to return instead. - A task representing the asynchronous exception handling operation. - The exception handler context. - The token to monitor for cancellation requests. - - - Defines an unhandled exception logger. - - - Logs an unhandled exception. - A task representing the asynchronous exception logging operation. - The exception logger context. - The token to monitor for cancellation requests. - - - Provides information about an action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - - - Returns the filters that are associated with this action method. - The filters that are associated with this action method. - The configuration. - The action descriptor. - - - Represents the base class for all action-filter attributes. - - - Initializes a new instance of the class. - - - Occurs after the action method is invoked. - The action executed context. - - - - Occurs before the action method is invoked. - The action context. - - - - Executes the filter action asynchronously. - The newly created task for this operation. - The action context. - The cancellation token assigned for this task. - The delegate function to continue after the action method is invoked. - - - Provides details for authorization filter. - - - Initializes a new instance of the class. - - - Calls when a process requests authorization. - The action context, which encapsulates information for using . - - - - Executes the authorization filter during synchronization. - The authorization filter during synchronization. - The action context, which encapsulates information for using . - The cancellation token that cancels the operation. - A continuation of the operation. - - - Represents the configuration filter provider. - - - Initializes a new instance of the class. - - - Returns the filters that are associated with this configuration method. - The filters that are associated with this configuration method. - The configuration. - The action descriptor. - - - Represents the attributes for the exception filter. - - - Initializes a new instance of the class. - - - Raises the exception event. - The context for the action. - - - - Asynchronously executes the exception filter. - The result of the execution. - The context for the action. - The cancellation context. - - - Represents the base class for action-filter attributes. - - - Initializes a new instance of the class. - - - Gets a value that indicates whether multiple filters are allowed. - true if multiple filters are allowed; otherwise, false. - - - Provides information about the available action filters. - - - Initializes a new instance of the class. - The instance of this class. - The scope of this class. - - - Gets or sets an instance of the . - A . - - - Gets or sets the scope . - The scope of the FilterInfo. - - - Defines values that specify the order in which filters run within the same filter type and filter order. - - - Specifies an order after Controller. - - - Specifies an order before Action and after Global. - - - Specifies an action before Controller. - - - Represents the action of the HTTP executed context. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The action context. - The exception. - - - Gets or sets the HTTP action context. - The HTTP action context. - - - Gets or sets the exception that was raised during the execution. - The exception that was raised during the execution. - - - Gets the object for the context. - The object for the context. - - - Gets or sets the for the context. - The for the context. - - - Represents an authentication challenge context containing information for executing an authentication challenge. - - - Initializes a new instance of the class. - The action context. - The current action result. - - - Gets the action context. - - - Gets the request message. - - - Gets or sets the action result to execute. - - - Represents an authentication context containing information for performing authentication. - - - Initializes a new instance of the class. - The action context. - The current principal. - - - Gets the action context. - The action context. - - - Gets or sets an action result that will produce an error response (if authentication failed; otherwise, null). - An action result that will produce an error response. - - - Gets or sets the authenticated principal. - The authenticated principal. - - - Gets the request message. - The request message. - - - Represents a collection of HTTP filters. - - - Initializes a new instance of the class. - - - Adds an item at the end of the collection. - The item to add to the collection. - - - - Removes all item in the collection. - - - Determines whether the collection contains the specified item. - true if the collection contains the specified item; otherwise, false. - The item to check. - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Gets an enumerator that iterates through the collection. - An enumerator object that can be used to iterate through the collection. - - - Removes the specified item from the collection. - The item to remove in the collection. - - - Gets an enumerator that iterates through the collection. - An enumerator object that can be used to iterate through the collection. - - - Defines the methods that are used in an action filter. - - - Executes the filter action asynchronously. - The newly created task for this operation. - The action context. - The cancellation token assigned for this task. - The delegate function to continue after the action method is invoked. - - - Defines a filter that performs authentication. - - - Authenticates the request. - A Task that will perform authentication. - The authentication context. - The token to monitor for cancellation requests. - - - - Defines the methods that are required for an authorization filter. - - - Executes the authorization filter to synchronize. - The authorization filter to synchronize. - The action context. - The cancellation token associated with the filter. - The continuation. - - - Defines the methods that are required for an exception filter. - - - Executes an asynchronous exception filter. - An asynchronous exception filter. - The action executed context. - The cancellation token. - - - Defines the methods that are used in a filter. - - - Gets or sets a value indicating whether more than one instance of the indicated attribute can be specified for a single program element. - true if more than one instance is allowed to be specified; otherwise, false. The default is false. - - - Provides filter information. - - - Returns an enumeration of filters. - An enumeration of filters. - The HTTP configuration. - The action descriptor. - - - - - Provides common keys for properties stored in the - - - Provides a key for the client certificate for this request. - - - Provides a key for the associated with this request. - - - Provides a key for the collection of resources that should be disposed when a request is disposed. - - - Provides a key for the associated with this request. - - - Provides a key for the associated with this request. - - - Provides a key for the associated with this request. - - - Provides a key that indicates whether error details are to be included in the response for this HTTP request. - - - Provides a key that indicates whether the request is a batch request. - - - Provides a key that indicates whether the request originates from a local address. - - - Provides a key that indicates whether the request failed to match a route. - - - Provides a key for the for this request. - - - Provides a key for the stored in . This is the correlation ID for that request. - - - Provides a key for the parsed query string stored in . - - - Provides a key for a delegate which can retrieve the client certificate for this request. - - - Provides a key for the current stored in Properties(). If Current() is null then no context is stored. - - - Interface for controlling the use of buffering requests and responses in the host. If a host provides support for buffering requests and/or responses then it can use this interface to determine the policy for when buffering is to be used. - - - Determines whether the host should buffer the entity body. - true if buffering should be used; otherwise a streamed request should be used. - The host context. - - - Determines whether the host should buffer the entity body. - true if buffering should be used; otherwise a streamed response should be used. - The HTTP response message. - - - Represents a message handler that suppresses host authentication results. - - - Initializes a new instance of the class. - - - Asynchronously sends a request message. - That task that completes the asynchronous operation. - The request message to send. - The cancellation token. - - - Represents the metadata class of the ModelMetadata. - - - Initializes a new instance of the class. - The provider. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - - - Gets a dictionary that contains additional metadata about the model. - A dictionary that contains additional metadata about the model. - - - Gets or sets the type of the container for the model. - The type of the container for the model. - - - Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. - true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. - - - Gets or sets the description of the model. - The description of the model. The default value is null. - - - Gets the display name for the model. - The display name for the model. - - - Gets a list of validators for the model. - A list of validators for the model. - The validator providers for the model. - - - Gets or sets a value that indicates whether the model is a complex type. - A value that indicates whether the model is considered a complex. - - - Gets a value that indicates whether the type is nullable. - true if the type is nullable; otherwise, false. - - - Gets or sets a value that indicates whether the model is read-only. - true if the model is read-only; otherwise, false. - - - Gets the value of the model. - The model value can be null. - - - Gets the type of the model. - The type of the model. - - - Gets a collection of model metadata objects that describe the properties of the model. - A collection of model metadata objects that describe the properties of the model. - - - Gets the property name. - The property name. - - - Gets or sets the provider. - The provider. - - - Provides an abstract base class for a custom metadata provider. - - - Initializes a new instance of the class. - - - Gets a ModelMetadata object for each property of a model. - A ModelMetadata object for each property of a model. - The container. - The type of the container. - - - Gets a metadata for the specified property. - The metadata model for the specified property. - The model accessor. - The type of the container. - The property to get the metadata model for. - - - Gets the metadata for the specified model accessor and model type. - The metadata. - The model accessor. - The type of the mode. - - - Provides an abstract class to implement a metadata provider. - The type of the model metadata. - - - Initializes a new instance of the class. - - - When overridden in a derived class, creates the model metadata for the property using the specified prototype. - The model metadata for the property. - The prototype from which to create the model metadata. - The model accessor. - - - When overridden in a derived class, creates the model metadata for the property. - The model metadata for the property. - The set of attributes. - The type of the container. - The type of the model. - The name of the property. - - - Retrieves a list of properties for the model. - A list of properties for the model. - The model container. - The type of the container. - - - Retrieves the metadata for the specified property using the container type and property name. - The metadata for the specified property. - The model accessor. - The type of the container. - The name of the property. - - - Returns the metadata for the specified property using the type of the model. - The metadata for the specified property. - The model accessor. - The type of the container. - - - Provides prototype cache data for . - - - Initializes a new instance of the class. - The attributes that provides data for the initialization. - - - Gets or sets the metadata display attribute. - The metadata display attribute. - - - Gets or sets the metadata display format attribute. - The metadata display format attribute. - - - - Gets or sets the metadata editable attribute. - The metadata editable attribute. - - - Gets or sets the metadata read-only attribute. - The metadata read-only attribute. - - - Provides a container for common metadata, for the class, for a data model. - - - Initializes a new instance of the class. - The prototype used to initialize the model metadata. - The model accessor. - - - Initializes a new instance of the class. - The metadata provider. - The type of the container. - The type of the model. - The name of the property. - The attributes that provides data for the initialization. - - - Retrieves a value that indicates whether empty strings that are posted back in forms should be converted to null. - true if empty strings that are posted back in forms should be converted to null; otherwise, false. - - - Retrieves the description of the model. - The description of the model. - - - Retrieves a value that indicates whether the model is read-only. - true if the model is read-only; otherwise, false. - - - - Provides prototype cache data for the . - The type of prototype cache. - - - Initializes a new instance of the class. - The prototype. - The model accessor. - - - Initializes a new instance of the class. - The provider. - The type of container. - The type of the model. - The name of the property. - The prototype cache. - - - Indicates whether empty strings that are posted back in forms should be computed and converted to null. - true if empty strings that are posted back in forms should be computed and converted to null; otherwise, false. - - - Indicates the computation value. - The computation value. - - - Gets a value that indicates whether the model is a complex type. - A value that indicates whether the model is considered a complex type by the Web API framework. - - - Gets a value that indicates whether the model to be computed is read-only. - true if the model to be computed is read-only; otherwise, false. - - - Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. - true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. - - - Gets or sets the description of the model. - The description of the model. - - - Gets a value that indicates whether the model is a complex type. - A value that indicates whether the model is considered a complex type by the Web API framework. - - - Gets or sets a value that indicates whether the model is read-only. - true if the model is read-only; otherwise, false. - - - Gets or sets a value that indicates whether the prototype cache is updating. - true if the prototype cache is updating; otherwise, false. - - - Implements the default model metadata provider. - - - Initializes a new instance of the class. - - - Creates the metadata from prototype for the specified property. - The metadata for the property. - The prototype. - The model accessor. - - - Creates the metadata for the specified property. - The metadata for the property. - The attributes. - The type of the container. - The type of the model. - The name of the property. - - - Represents an empty model metadata provider. - - - Initializes a new instance of the class. - - - Creates metadata from prototype. - The metadata. - The model metadata prototype. - The model accessor. - - - Creates a prototype of the metadata provider of the . - A prototype of the metadata provider. - The attributes. - The type of container. - The type of model. - The name of the property. - - - Represents the binding directly to the cancellation token. - - - Initializes a new instance of the class. - The binding descriptor. - - - Executes the binding during synchronization. - The binding during synchronization. - The metadata provider. - The action context. - The notification after the cancellation of the operations. - - - Represents an attribute that invokes a custom model binder. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - A reference to an object that implements the interface. - - - Represents the default action value of the binder. - - - Initializes a new instance of the class. - - - Default implementation of the interface. This interface is the primary entry point for binding action parameters. - The associated with the . - The action descriptor. - - - Gets the associated with the . - The associated with the . - The parameter descriptor. - - - Defines a binding error. - - - Initializes a new instance of the class. - The error descriptor. - The message. - - - Gets the error message. - The error message. - - - Executes the binding method during synchronization. - The metadata provider. - The action context. - The cancellation Token value. - - - Represents parameter binding that will read from the body and invoke the formatters. - - - Initializes a new instance of the class. - The descriptor. - The formatter. - The body model validator. - - - Gets or sets an interface for the body model validator. - An interface for the body model validator. - - - Gets the error message. - The error message. - - - Asynchronously execute the binding of . - The result of the action. - The metadata provider. - The context associated with the action. - The cancellation token. - - - Gets or sets an enumerable object that represents the formatter for the parameter binding. - An enumerable object that represents the formatter for the parameter binding. - - - Asynchronously reads the content of . - The result of the action. - The request. - The type. - The formatter. - The format logger. - - - - Gets whether the will read body. - True if the will read body; otherwise, false. - - - Represents the extensions for the collection of form data. - - - Reads the collection extensions with specified type. - The read collection extensions. - The form data. - The generic type. - - - Reads the collection extensions with specified type. - The collection extensions. - The form data. - The name of the model. - The required member selector. - The formatter logger. - The generic type. - - - - - - Reads the collection extensions with specified type. - The collection extensions with specified type. - The form data. - The type of the object. - - - Reads the collection extensions with specified type and model name. - The collection extensions. - The form data. - The type of the object. - The name of the model. - The required member selector. - The formatter logger. - - - Deserialize the form data to the given type, using model binding. - best attempt to bind the object. The best attempt may be null. - collection with parsed form url data - target type to read as - null or empty to read the entire form as a single object. This is common for body data. Or the name of a model to do a partial binding against the form data. This is common for extracting individual fields. - The used to determine required members. - The to log events to. - The configuration to pick binder from. Can be null if the config was not created already. In that case a new config is created. - - - - - - - - Enumerates the behavior of the HTTP binding. - - - Never use HTTP binding. - - - The optional binding behavior - - - HTTP binding is required. - - - Provides a base class for model-binding behavior attributes. - - - Initializes a new instance of the class. - The behavior. - - - Gets or sets the behavior category. - The behavior category. - - - Gets the unique identifier for this attribute. - The id for this attribute. - - - Parameter binds to the request. - - - Initializes a new instance of the class. - The parameter descriptor. - - - Asynchronously executes parameter binding. - The binded parameter. - The metadata provider. - The action context. - The cancellation token. - - - Defines the methods that are required for a model binder. - - - Binds the model to a value by using the specified controller context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Represents a value provider for parameter binding. - - - Gets the instances used by this parameter binding. - The instances used by this parameter binding. - - - Represents the class for handling HTML form URL-ended data, also known as application/x-www-form-urlencoded. - - - Initializes a new instance of the class. - - - - Determines whether this can read objects of the specified . - true if objects of this type can be read; otherwise false. - The type of object that will be read. - - - Reads an object of the specified from the specified stream. This method is called during deserialization. - A whose result will be the object instance that has been read. - The type of object to read. - The from which to read. - The content being read. - The to log events to. - - - Specify this parameter uses a model binder. This can optionally specify the specific model binder and value providers that drive that model binder. Derived attributes may provide convenience settings for the model binder or value provider. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The type of model binder. - - - Gets or sets the type of model binder. - The type of model binder. - - - Gets the binding for a parameter. - The that contains the binding. - The parameter to bind. - - - Get the IModelBinder for this type. - a non-null model binder. - The configuration. - model type that the binder is expected to bind. - - - Gets the model binder provider. - The instance. - The configuration object. - - - Gets the value providers that will be fed to the model binder. - A collection of instances. - The configuration object. - - - Gets or sets the name to consider as the parameter name during model binding. - The parameter name to consider. - - - Gets or sets a value that specifies whether the prefix check should be suppressed. - true if the prefix check should be suppressed; otherwise, false. - - - Provides a container for model-binder configuration. - - - Gets or sets the name of the resource file (class key) that contains localized string values. - The name of the resource file (class key). - - - Gets or sets the current provider for type-conversion error message. - The current provider for type-conversion error message. - - - Gets or sets the current provider for value-required error messages. - The error message provider. - - - Provides a container for model-binder error message provider. - - - Describes a parameter that gets bound via ModelBinding. - - - Initializes a new instance of the class. - The parameter descriptor. - The model binder. - The collection of value provider factory. - - - Gets the model binder. - The model binder. - - - Asynchronously executes the parameter binding via the model binder. - The task that is signaled when the binding is complete. - The metadata provider to use for validation. - The action context for the binding. - The cancellation token assigned for this task for cancelling the binding operation. - - - Gets the collection of value provider factory. - The collection of value provider factory. - - - Provides an abstract base class for model binder providers. - - - Initializes a new instance of the class. - - - Finds a binder for the given type. - A binder, which can attempt to bind this type. Or null if the binder knows statically that it will never be able to bind the type. - A configuration object. - The type of the model to bind against. - - - Provides the context in which a model binder functions. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The binding context. - - - Gets or sets a value that indicates whether the binder should use an empty prefix. - true if the binder should use an empty prefix; otherwise, false. - - - Gets or sets the model. - The model. - - - Gets or sets the model metadata. - The model metadata. - - - Gets or sets the name of the model. - The name of the model. - - - Gets or sets the state of the model. - The state of the model. - - - Gets or sets the type of the model. - The type of the model. - - - Gets the property metadata. - The property metadata. - - - Gets or sets the validation node. - The validation node. - - - Gets or sets the value provider. - The value provider. - - - Represents an error that occurs during model binding. - - - Initializes a new instance of the class by using the specified exception. - The exception. - - - Initializes a new instance of the class by using the specified exception and error message. - The exception. - The error message - - - Initializes a new instance of the class by using the specified error message. - The error message - - - Gets or sets the error message. - The error message. - - - Gets or sets the exception object. - The exception object. - - - Represents a collection of instances. - - - Initializes a new instance of the class. - - - Adds the specified Exception object to the model-error collection. - The exception. - - - Adds the specified error message to the model-error collection. - The error message. - - - Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself. - - - Initializes a new instance of the class. - - - Gets a object that contains any errors that occurred during model binding. - The model state errors. - - - Gets a object that encapsulates the value that was being bound during model binding. - The model state value. - - - Represents the state of an attempt to bind a posted form to an action method, which includes validation information. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using values that are copied from the specified model-state dictionary. - The dictionary. - - - Adds the specified item to the model-state dictionary. - The object to add to the model-state dictionary. - - - Adds an element that has the specified key and value to the model-state dictionary. - The key of the element to add. - The value of the element to add. - - - Adds the specified model error to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The exception. - - - Adds the specified error message to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The error message. - - - Removes all items from the model-state dictionary. - - - Determines whether the model-state dictionary contains a specific value. - true if item is found in the model-state dictionary; otherwise, false. - The object to locate in the model-state dictionary. - - - Determines whether the model-state dictionary contains the specified key. - true if the model-state dictionary contains the specified key; otherwise, false. - The key to locate in the model-state dictionary. - - - Copies the elements of the model-state dictionary to an array, starting at a specified index. - The array. The array must have zero-based indexing. - The zero-based index in array at which copying starts. - - - Gets the number of key/value pairs in the collection. - The number of key/value pairs in the collection. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets a value that indicates whether this instance of the model-state dictionary is valid. - true if this instance is valid; otherwise, false. - - - Determines whether there are any objects that are associated with or prefixed with the specified key. - true if the model-state dictionary contains a value that is associated with the specified key; otherwise, false. - The key. - - - Gets or sets the value that is associated with the specified key. - The model state item. - The key. - - - Gets a collection that contains the keys in the dictionary. - A collection that contains the keys of the model-state dictionary. - - - Copies the values from the specified object into this dictionary, overwriting existing values if keys are the same. - The dictionary. - - - Removes the first occurrence of the specified object from the model-state dictionary. - true if item was successfully removed the model-state dictionary; otherwise, false. This method also returns false if item is not found in the model-state dictionary. - The object to remove from the model-state dictionary. - - - Removes the element that has the specified key from the model-state dictionary. - true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the model-state dictionary. - The key of the element to remove. - - - Sets the value for the specified key by using the specified value provider dictionary. - The key. - The value. - - - Returns an enumerator that iterates through a collection. - An IEnumerator object that can be used to iterate through the collection. - - - Attempts to gets the value that is associated with the specified key. - true if the object contains an element that has the specified key; otherwise, false. - The key of the value to get. - The value associated with the specified key. - - - Gets a collection that contains the values in the dictionary. - A collection that contains the values of the model-state dictionary. - - - Collection of functions that can produce a parameter binding for a given parameter. - - - Initializes a new instance of the class. - - - Adds function to the end of the collection. The function added is a wrapper around funcInner that checks that parameterType matches typeMatch. - type to match against HttpParameterDescriptor.ParameterType - inner function that is invoked if type match succeeds - - - Insert a function at the specified index in the collection. /// The function added is a wrapper around funcInner that checks that parameterType matches typeMatch. - index to insert at. - type to match against HttpParameterDescriptor.ParameterType - inner function that is invoked if type match succeeds - - - Execute each binding function in order until one of them returns a non-null binding. - the first non-null binding produced for the parameter. Of null if no binding is produced. - parameter to bind. - - - Maps a browser request to an array. - The type of the array. - - - Initializes a new instance of the class. - - - Indicates whether the model is binded. - true if the specified model is binded; otherwise, false. - The action context. - The binding context. - - - Converts the collection to an array. - true in all cases. - The action context. - The binding context. - The new collection. - - - Provides a model binder for arrays. - - - Initializes a new instance of the class. - - - Returns a model binder for arrays. - A model binder object or null if the attempt to get a model binder is unsuccessful. - The configuration. - The type of model. - - - Maps a browser request to a collection. - The type of the collection. - - - Initializes a new instance of the class. - - - Binds the model by using the specified execution context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Provides a way for derived classes to manipulate the collection before returning it from the binder. - true in all cases. - The action context. - The binding context. - The new collection. - - - Provides a model binder for a collection. - - - Initializes a new instance of the class. - - - Retrieves a model binder for a collection. - The model binder. - The configuration of the model. - The type of the model. - - - Represents a data transfer object (DTO) for a complex model. - - - Initializes a new instance of the class. - The model metadata. - The collection of property metadata. - - - Gets or sets the model metadata of the . - The model metadata of the . - - - Gets or sets the collection of property metadata of the . - The collection of property metadata of the . - - - Gets or sets the results of the . - The results of the . - - - Represents a model binder for object. - - - Initializes a new instance of the class. - - - Determines whether the specified model is binded. - true if the specified model is binded; otherwise, false. - The action context. - The binding context. - - - Represents a complex model that invokes a model binder provider. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - The model binder. - The configuration. - The type of the model to retrieve. - - - Represents the result for object. - - - Initializes a new instance of the class. - The object model. - The validation node. - - - Gets or sets the model for this object. - The model for this object. - - - Gets or sets the for this object. - The for this object. - - - Represents an that delegates to one of a collection of instances. - - - Initializes a new instance of the class. - An enumeration of binders. - - - Initializes a new instance of the class. - An array of binders. - - - Indicates whether the specified model is binded. - true if the model is binded; otherwise, false. - The action context. - The binding context. - - - Represents the class for composite model binder providers. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - A collection of - - - Gets the binder for the model. - The binder for the model. - The binder configuration. - The type of the model. - - - Gets the providers for the composite model binder. - The collection of providers. - - - Maps a browser request to a dictionary data object. - The type of the key. - The type of the value. - - - Initializes a new instance of the class. - - - Converts the collection to a dictionary. - true in all cases. - The action context. - The binding context. - The new collection. - - - Provides a model binder for a dictionary. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - The associated model binder. - The configuration to use. - The type of model. - - - Maps a browser request to a key/value pair data object. - The type of the key. - The type of the value. - - - Initializes a new instance of the class. - - - Binds the model by using the specified execution context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Provides a model binder for a collection of key/value pairs. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - The associated model binder. - The configuration. - The type of model. - - - Maps a browser request to a mutable data object. - - - Initializes a new instance of the class. - - - Binds the model by using the specified action context and binding context. - true if binding is successful; otherwise, false. - The action context. - The binding context. - - - Retrieves a value that indicates whether a property can be updated. - true if the property can be updated; otherwise, false. - The metadata for the property to be evaluated. - - - Creates an instance of the model. - The newly created model object. - The action context. - The binding context. - - - Creates a model instance if an instance does not yet exist in the binding context. - The action context. - The binding context. - - - Retrieves metadata for properties of the model. - The metadata for properties of the model. - The action context. - The binding context. - - - Sets the value of a specified property. - The action context. - The binding context. - The metadata for the property to set. - The validation information about the property. - The validator for the model. - - - Provides a model binder for mutable objects. - - - Initializes a new instance of the class. - - - Retrieves the model binder for the specified type. - The model binder. - The configuration. - The type of the model to retrieve. - - - Provides a simple model binder for this model binding class. - - - Initializes a new instance of the class. - The model type. - The model binder factory. - - - Initializes a new instance of the class by using the specified model type and the model binder. - The model type. - The model binder. - - - Returns a model binder by using the specified execution context and binding context. - The model binder, or null if the attempt to get a model binder is unsuccessful. - The configuration. - The model type. - - - Gets the type of the model. - The type of the model. - - - Gets or sets a value that specifies whether the prefix check should be suppressed. - true if the prefix check should be suppressed; otherwise, false. - - - Maps a browser request to a data object. This type is used when model binding requires conversions using a .NET Framework type converter. - - - Initializes a new instance of the class. - - - Binds the model by using the specified controller context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Provides a model binder for a model that requires type conversion. - - - Initializes a new instance of the class. - - - Retrieve a model binder for a model that requires type conversion. - The model binder, or Nothing if the type cannot be converted or there is no value to convert. - The configuration of the binder. - The type of the model. - - - Maps a browser request to a data object. This class is used when model binding does not require type conversion. - - - Initializes a new instance of the class. - - - Binds the model by using the specified execution context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Provides a model binder for a model that does not require type conversion. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - The associated model binder. - The configuration. - The type of model. - - - Represents an action result that returns response and performs content negotiation on an see with . - - - Initializes a new instance of the class. - The user-visible error message. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class. - The user-visible error message. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content negotiator to handle content negotiation. - Returns . - - - Returns . - - - Gets the formatters to use to negotiate and format the content. - Returns . - - - Gets the user-visible error message. - Returns . - - - Gets the request message which led to this result. - Returns . - - - Represents an action result that returns an empty response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - Asynchronously executes the request. - The task that completes the execute operation. - The cancellation token. - - - Gets the request message which led to this result. - The request message which led to this result. - - - Represents an action result that returns an empty HttpStatusCode.Conflict response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - Executes asynchronously the operation of the conflict result. - Asynchronously executes the specified task. - The cancellation token. - - - Gets the request message which led to this result. - The HTTP request message which led to this result. - - - Represents an action result that performs route generation and content negotiation and returns a response when content negotiation succeeds. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The content value to negotiate and format in the entity body. - The controller from which to obtain the dependencies needed for execution. - - - Initializes a new instance of the class with the values provided. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The content value to negotiate and format in the entity body. - The factory to use to generate the route URL. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Gets the content value to negotiate and format in the entity body. - - - Gets the content negotiator to handle content negotiation. - - - - Gets the formatters to use to negotiate and format the content. - - - Gets the request message which led to this result. - - - Gets the name of the route to use for generating the URL. - - - Gets the route data to use for generating the URL. - - - Gets the factory to use to generate the route URL. - - - Represents an action result that performs content negotiation and returns a response when it succeeds. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The content value to negotiate and format in the entity body. - The location at which the content has been created. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class with the values provided. - The location at which the content has been created. - The content value to negotiate and format in the entity body. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to negotiate and format in the entity body. - The content value to negotiate and format in the entity body. - - - Gets the content negotiator to handle content negotiation. - The content negotiator to handle content negotiation. - - - Executes asynchronously the operation of the created negotiated content result. - Asynchronously executes a return value. - The cancellation token. - - - Gets the formatters to use to negotiate and format the content. - The formatters to use to negotiate and format the content. - - - Gets the location at which the content has been created. - The location at which the content has been created. - - - Gets the request message which led to this result. - The HTTP request message which led to this result. - - - Represents an action result that returns a response and performs content negotiation on an  based on an . - - - Initializes a new instance of the class. - The exception to include in the error. - true if the error should include exception messages; otherwise, false . - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class. - The exception to include in the error. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content negotiator to handle content negotiation. - Returns . - - - Gets the exception to include in the error. - Returns . - - - Returns . - - - Gets the formatters to use to negotiate and format the content. - Returns . - - - Gets a value indicating whether the error should include exception messages. - Returns . - - - Gets the request message which led to this result. - Returns . - - - Represents an action result that returns formatted content. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The value for the Content-Type header, or to have the formatter pick a default value. - The request message which led to this result. - - - Initializes a new instance of the class with the values provided. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The value for the Content-Type header, or to have the formatter pick a default value. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to format in the entity body. - - - - Gets the formatter to use to format the content. - - - Gets the value for the Content-Type header, or to have the formatter pick a default value. - - - Gets the request message which led to this result. - - - Gets the HTTP status code for the response message. - - - Represents an action result that returns an empty response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - Returns . - - - Gets the request message which led to this result. - Returns . - - - Represents an action result that returns a response and performs content negotiation on an based on a . - - - Initializes a new instance of the class. - The model state to include in the error. - true if the error should include exception messages; otherwise, false. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class. - The model state to include in the error. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content negotiator to handle content negotiation. - The content negotiator to handle content negotiation. - - - Creates a response message asynchronously. - A task that, when completed, contains the response message. - The token to monitor for cancellation requests. - - - Gets the formatters to use to negotiate and format the content. - The formatters to use to negotiate and format the content. - - - Gets a value indicating whether the error should include exception messages. - true if the error should include exception messages; otherwise, false. - - - Gets the model state to include in the error. - The model state to include in the error. - - - Gets the request message which led to this result. - The request message which led to this result. - - - Represents an action result that returns an response with JSON data. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The content value to serialize in the entity body. - The serializer settings. - The content encoding. - The request message which led to this result. - - - Initializes a new instance of the class with the values provided. - The content value to serialize in the entity body. - The serializer settings. - The content encoding. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to serialize in the entity body. - The content value to serialize in the entity body. - - - Gets the content encoding. - The content encoding. - - - Creates a response message asynchronously. - A task that, when completed, contains the response message. - The token to monitor for cancellation requests. - - - Gets the request message which led to this result. - The request message which led to this result. - - - Gets the serializer settings. - The serializer settings. - - - Represents an action result that performs content negotiation. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The HTTP status code for the response message. - The content value to negotiate and format in the entity body. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class with the values provided. - The HTTP status code for the response message. - The content value to negotiate and format in the entity body. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to negotiate and format in the entity body. - The content value to negotiate and format in the entity body. - - - Gets the content negotiator to handle content negotiation. - The content negotiator to handle content negotiation. - - - Executes asynchronously an HTTP negotiated content results. - Asynchronously executes an HTTP negotiated content results. - The cancellation token. - - - Gets the formatters to use to negotiate and format the content. - The formatters to use to negotiate and format the content. - - - Gets the request message which led to this result. - The HTTP request message which led to this result. - - - Gets the HTTP status code for the response message. - The HTTP status code for the response message. - - - Represents an action result that returns an empty response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - - Gets the request message which led to this result. - - - Represents an action result that performs content negotiation and returns an HttpStatusCode.OK response when it succeeds. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The content value to negotiate and format in the entity body. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class with the values provided. - The content value to negotiate and format in the entity body. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to negotiate and format in the entity body. - - - Gets the content negotiator to handle content negotiation. - - - - Gets the formatters to use to negotiate and format the content. - - - Gets the request message which led to this result. - - - Represents an action result that returns an empty HttpStatusCode.OK response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - Executes asynchronously. - Returns the task. - The cancellation token. - - - Gets a HTTP request message for the results. - A HTTP request message for the results. - - - Represents an action result for a <see cref="F:System.Net.HttpStatusCode.Redirect"/>. - - - Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectResult"/> class with the values provided. - The location to which to redirect. - The request message which led to this result. - - - Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectResult"/> class with the values provided. - The location to which to redirect. - The controller from which to obtain the dependencies needed for execution. - - - Returns . - - - Gets the location at which the content has been created. - Returns . - - - Gets the request message which led to this result. - Returns . - - - Represents an action result that performs route generation and returns a <see cref="F:System.Net.HttpStatusCode.Redirect"/> response. - - - Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectToRouteResult"/> class with the values provided. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The controller from which to obtain the dependencies needed for execution. - - - Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectToRouteResult"/> class with the values provided. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The factory to use to generate the route URL. - The request message which led to this result. - - - Returns . - - - Gets the request message which led to this result. - Returns . - - - Gets the name of the route to use for generating the URL. - Returns . - - - Gets the route data to use for generating the URL. - Returns . - - - Gets the factory to use to generate the route URL. - Returns . - - - Represents an action result that returns a specified response message. - - - Initializes a new instance of the class. - The response message. - - - - Gets the response message. - - - Represents an action result that returns a specified HTTP status code. - - - Initializes a new instance of the class. - The HTTP status code for the response message. - The request message which led to this result. - - - Initializes a new instance of the class. - The HTTP status code for the response message. - The controller from which to obtain the dependencies needed for execution. - - - Creates a response message asynchronously. - A task that, when completed, contains the response message. - The token to monitor for cancellation requests. - - - Gets the request message which led to this result. - The request message which led to this result. - - - Gets the HTTP status code for the response message. - The HTTP status code for the response message. - - - Represents an action result that returns an response. - - - Initializes a new instance of the class. - The WWW-Authenticate challenges. - The request message which led to this result. - - - Initializes a new instance of the class. - The WWW-Authenticate challenges. - The controller from which to obtain the dependencies needed for execution. - - - Gets the WWW-Authenticate challenges. - Returns . - - - Returns . - - - Gets the request message which led to this result. - Returns . - - - A default implementation of . - - - - Creates instances based on the provided factories and action. The route entries provide direct routing to the provided action. - A set of route entries. - The action descriptor. - The direct route factories. - The constraint resolver. - - - Gets a set of route factories for the given action descriptor. - A set of route factories. - The action descriptor. - - - Creates instances based on the provided factories, controller and actions. The route entries provided direct routing to the provided controller and can reach the set of provided actions. - A set of route entries. - The controller descriptor. - The action descriptors. - The direct route factories. - The constraint resolver. - - - Gets route factories for the given controller descriptor. - A set of route factories. - The controller descriptor. - - - Gets direct routes for the given controller descriptor and action descriptors based on attributes. - A set of route entries. - The controller descriptor. - The action descriptors for all actions. - The constraint resolver. - - - Gets the route prefix from the provided controller. - The route prefix or null. - The controller descriptor. - - - The default implementation of . Resolves constraints by parsing a constraint key and constraint arguments, using a map to resolve the constraint type, and calling an appropriate constructor for the constraint type. - - - Initializes a new instance of the class. - - - Gets the mutable dictionary that maps constraint keys to a particular constraint type. - The mutable dictionary that maps constraint keys to a particular constraint type. - - - Resolves the inline constraint. - The the inline constraint was resolved to. - The inline constraint to resolve. - - - Represents a context that supports creating a direct route. - - - Initializes a new instance of the class. - The route prefix, if any, defined by the controller. - The action descriptors to which to create a route. - The inline constraint resolver. - A value indicating whether the route is configured at the action or controller level. - - - Gets the action descriptors to which to create a route. - The action descriptors to which to create a route. - - - Creates a route builder that can build a route matching this context. - A route builder that can build a route matching this context. - The route template. - - - Creates a route builder that can build a route matching this context. - A route builder that can build a route matching this context. - The route template. - The inline constraint resolver to use, if any; otherwise, null. - - - Gets the inline constraint resolver. - The inline constraint resolver. - - - Gets the route prefix, if any, defined by the controller. - The route prefix, if any, defined by the controller. - - - Gets a value indicating whether the route is configured at the action or controller level. - true when the route is configured at the action level; otherwise false (if the route is configured at the controller level). - - - Enables you to define which HTTP verbs are allowed when ASP.NET routing determines whether a URL matches a route. - - - Initializes a new instance of the class by using the HTTP verbs that are allowed for the route. - The HTTP verbs that are valid for the route. - - - Gets or sets the collection of allowed HTTP verbs for the route. - A collection of allowed HTTP verbs for the route. - - - Determines whether the request was made with an HTTP verb that is one of the allowed verbs for the route. - When ASP.NET routing is processing a request, true if the request was made by using an allowed HTTP verb; otherwise, false. When ASP.NET routing is constructing a URL, true if the supplied values contain an HTTP verb that matches one of the allowed HTTP verbs; otherwise, false. The default is true. - The request that is being checked to determine whether it matches the URL. - The object that is being checked to determine whether it matches the URL. - The name of the parameter that is being checked. - An object that contains the parameters for a route. - An object that indicates whether the constraint check is being performed when an incoming request is processed or when a URL is generated. - - - Determines whether the request was made with an HTTP verb that is one of the allowed verbs for the route. - When ASP.NET routing is processing a request, true if the request was made by using an allowed HTTP verb; otherwise, false. When ASP.NET routing is constructing a URL, true if the supplied values contain an HTTP verb that matches one of the allowed HTTP verbs; otherwise, false. The default is true. - The request that is being checked to determine whether it matches the URL. - The object that is being checked to determine whether it matches the URL. - The name of the parameter that is being checked. - An object that contains the parameters for a route. - An object that indicates whether the constraint check is being performed when an incoming request is processed or when a URL is generated. - - - Represents a route class for self-host (i.e. hosted outside of ASP.NET). - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The route template. - - - Initializes a new instance of the class. - The route template. - The default values for the route parameters. - - - Initializes a new instance of the class. - The route template. - The default values for the route parameters. - The constraints for the route parameters. - - - Initializes a new instance of the class. - The route template. - The default values for the route parameters. - The constraints for the route parameters. - Any additional tokens for the route parameters. - - - Initializes a new instance of the class. - The route template. - The default values for the route parameters. - The constraints for the route parameters. - Any additional tokens for the route parameters. - The message handler that will be the recipient of the request. - - - Gets the constraints for the route parameters. - The constraints for the route parameters. - - - Gets any additional data tokens not used directly to determine whether a route matches an incoming . - Any additional data tokens not used directly to determine whether a route matches an incoming . - - - Gets the default values for route parameters if not provided by the incoming . - The default values for route parameters if not provided by the incoming . - - - Determines whether this route is a match for the incoming request by looking up the for the route. - The for a route if matches; otherwise null. - The virtual path root. - The HTTP request. - - - Attempts to generate a URI that represents the values passed in based on current values from the and new values using the specified . - A instance or null if URI cannot be generated. - The HTTP request message. - The route values. - - - Gets or sets the http route handler. - The http route handler. - - - Specifies the HTTP route key. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP request. - The constraints for the route parameters. - The name of the parameter. - The list of parameter values. - One of the enumeration values of the enumeration. - - - Gets the route template describing the URI pattern to match against. - The route template describing the URI pattern to match against. - - - Encapsulates information regarding the HTTP route. - - - Initializes a new instance of the class. - An object that defines the route. - - - Initializes a new instance of the class. - An object that defines the route. - The value. - - - Gets the object that represents the route. - the object that represents the route. - - - Gets a collection of URL parameter values and default values for the route. - An object that contains values that are parsed from the URL and from default values. - - - Removes all optional parameters that do not have a value from the route data. - - - If a route is really a union of other routes, return the set of sub routes. - Returns the set of sub routes contained within this route. - A union route data. - - - Removes all optional parameters that do not have a value from the route data. - The route data, to be mutated in-place. - - - Specifies an enumeration of route direction. - - - The UriGeneration direction. - - - The UriResolution direction. - - - Represents a route class for self-host of specified key/value pairs. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The dictionary. - - - Initializes a new instance of the class. - The key value. - - - Presents the data regarding the HTTP virtual path. - - - Initializes a new instance of the class. - The route of the virtual path. - The URL that was created from the route definition. - - - Gets or sets the route of the virtual path.. - The route of the virtual path. - - - Gets or sets the URL that was created from the route definition. - The URL that was created from the route definition. - - - Defines a builder that creates direct routes to actions (attribute routes). - - - Gets the action descriptors to which to create a route. - The action descriptors to which to create a route. - - - Creates a route entry based on the current property values. - The route entry created. - - - Gets or sets the route constraints. - The route constraints. - - - Gets or sets the route data tokens. - The route data tokens. - - - Gets or sets the route defaults. - The route defaults. - - - Gets or sets the route name, if any; otherwise null. - The route name, if any; otherwise null. - - - Gets or sets the route order. - The route order. - - - Gets or sets the route precedence. - The route precedence. - - - Gets a value indicating whether the route is configured at the action or controller level. - true when the route is configured at the action level; otherwise false (if the route is configured at the controller level). - - - Gets or sets the route template. - The route template. - - - Defines a factory that creates a route directly to a set of action descriptors (an attribute route). - - - Creates a direct route entry. - The direct route entry. - The context to use to create the route. - - - Defines a provider for routes that directly target action descriptors (attribute routes). - - - Gets the direct routes for a controller. - A set of route entries for the controller. - The controller descriptor. - The action descriptors. - The inline constraint resolver. - - - - defines the interface for a route expressing how to map an incoming to a particular controller and action. - - - Gets the constraints for the route parameters. - The constraints for the route parameters. - - - Gets any additional data tokens not used directly to determine whether a route matches an incoming . - The additional data tokens. - - - Gets the default values for route parameters if not provided by the incoming . - The default values for route parameters. - - - Determine whether this route is a match for the incoming request by looking up the <see cref="!:IRouteData" /> for the route. - The <see cref="!:RouteData" /> for a route if matches; otherwise null. - The virtual path root. - The request. - - - Gets a virtual path data based on the route and the values provided. - The virtual path data. - The request message. - The values. - - - Gets the message handler that will be the recipient of the request. - The message handler. - - - Gets the route template describing the URI pattern to match against. - The route template. - - - Represents a base class route constraint. - - - Determines whether this instance equals a specified route. - True if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Provides information about a route. - - - Gets the object that represents the route. - The object that represents the route. - - - Gets a collection of URL parameter values and default values for the route. - The values that are parsed from the URL and from default values. - - - Provides information for defining a route. - - - Gets the name of the route to generate. - - - Gets the order of the route relative to other routes. - - - Gets the route template describing the URI pattern to match against. - - - Defines the properties for HTTP route. - - - Gets the HTTP route. - The HTTP route. - - - Gets the URI that represents the virtual path of the current HTTP route. - The URI that represents the virtual path of the current HTTP route. - - - Defines an abstraction for resolving inline constraints as instances of . - - - Resolves the inline constraint. - The the inline constraint was resolved to. - The inline constraint to resolve. - - - Defines a route prefix. - - - Gets the route prefix. - The route prefix. - - - Represents a named route. - - - Initializes a new instance of the class. - The route name, if any; otherwise, null. - The route. - - - Gets the route name, if any; otherwise, null. - The route name, if any; otherwise, null. - - - Gets the route. - The route. - - - Represents an attribute route that may contain custom constraints. - - - Initializes a new instance of the class. - The route template. - - - Gets the route constraints, if any; otherwise null. - The route constraints, if any; otherwise null. - - - Creates the route entry - The created route entry. - The context. - - - Gets the route data tokens, if any; otherwise null. - The route data tokens, if any; otherwise null. - - - Gets the route defaults, if any; otherwise null. - The route defaults, if any; otherwise null. - - - Gets or sets the route name, if any; otherwise null. - The route name, if any; otherwise null. - - - Gets or sets the route order. - The route order. - - - Gets the route template. - The route template. - - - Represents a handler that specifies routing should not handle requests for a route template. When a route provides this class as a handler, requests matching against the route will be ignored. - - - Initializes a new instance of the class. - - - Represents a factory for creating URLs. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The HTTP request for this instance. - - - Creates an absolute URL using the specified path. - The generated URL. - The URL path, which may be a relative URL, a rooted URL, or a virtual path. - - - Returns a link for the specified route. - A link for the specified route. - The name of the route. - An object that contains the parameters for a route. - - - Returns a link for the specified route. - A link for the specified route. - The name of the route. - A route value. - - - Gets or sets the of the current instance. - The of the current instance. - - - Returns the route for the . - The route for the . - The name of the route. - A list of route values. - - - Returns the route for the . - The route for the . - The name of the route. - The route values. - - - Constrains a route parameter to contain only lowercase or uppercase letters A through Z in the English alphabet. - - - Initializes a new instance of the class. - - - Constrains a route parameter to represent only Boolean values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route by several child constraints. - - - Initializes a new instance of the class. - The child constraints that must match for this constraint to match. - - - Gets the child constraints that must match for this constraint to match. - The child constraints that must match for this constraint to match. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route of direction. - - - Constrains a route parameter to represent only decimal values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only 64-bit floating-point values. - - - - - Constrains a route parameter to represent only 32-bit floating-point values. - - - - - Constrains a route parameter to represent only values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only 32-bit integer values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to be a string of a given length or within a given range of lengths. - - - - Initializes a new instance of the class that constrains a route parameter to be a string of a given length. - The minimum length of the route parameter. - The maximum length of the route parameter. - - - Gets the length of the route parameter, if one is set. - - - - Gets the maximum length of the route parameter, if one is set. - - - Gets the minimum length of the route parameter, if one is set. - - - Constrains a route parameter to represent only 64-bit integer values. - - - - - Constrains a route parameter to be a string with a maximum length. - - - Initializes a new instance of the class. - The maximum length. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the maximum length of the route parameter. - The maximum length of the route parameter. - - - Constrains a route parameter to be an integer with a maximum value. - - - - - Gets the maximum value of the route parameter. - - - Constrains a route parameter to be a string with a maximum length. - - - Initializes a new instance of the class. - The minimum length. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the minimum length of the route parameter. - The minimum length of the route parameter. - - - Constrains a route parameter to be a long with a minimum value. - - - Initializes a new instance of the class. - The minimum value of the route parameter. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the minimum value of the route parameter. - The minimum value of the route parameter. - - - Constrains a route by an inner constraint that doesn't fail when an optional parameter is set to its default value. - - - Initializes a new instance of the class. - The inner constraint to match if the parameter is not an optional parameter without a value - - - Gets the inner constraint to match if the parameter is not an optional parameter without a value. - The inner constraint to match if the parameter is not an optional parameter without a value. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constraints a route parameter to be an integer within a given range of values. - - - Initializes a new instance of the class. - The minimum value. - The maximum value. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the maximum value of the route parameter. - The maximum value of the route parameter. - - - Gets the minimum value of the route parameter. - The minimum value of the route parameter. - - - Constrains a route parameter to match a regular expression. - - - Initializes a new instance of the class. - The pattern. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the regular expression pattern to match. - The regular expression pattern to match. - - - Provides a method for retrieving the innermost object of an object that might be wrapped by an <see cref="T:System.Web.Http.Services.IDecorator`1" />. - - - Gets the innermost object which does not implement <see cref="T:System.Web.Http.Services.IDecorator`1" />. - Object which needs to be unwrapped. - - - - Represents a container for service instances used by the . Note that this container only supports known types, and methods to get or set arbitrary service types will throw when called. For creation of arbitrary types, please use instead. The supported types for this container are: Passing any type which is not on this to any method on this interface will cause an to be thrown. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified object. - The object. - - - Removes a single-instance service from the default services. - The type of the service. - - - Gets a service of the specified type. - The first instance of the service, or null if the service is not found. - The type of service. - - - Gets the list of service objects for a given service type, and validates the service type. - The list of service objects of the specified type. - The service type. - - - Gets the list of service objects for a given service type. - The list of service objects of the specified type, or an empty list if the service is not found. - The type of service. - - - Queries whether a service type is single-instance. - true if the service type has at most one instance, or false if the service type supports multiple instances. - The service type. - - - Replaces a single-instance service object. - The service type. - The service object that replaces the previous instance. - - - Removes the cached values for a single service type. - The service type. - - - Defines a decorator that exposes the inner decorated object. - This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see . - - - Gets the inner object. - - - Represents a performance tracing class to log method entry/exit and duration. - - - Initializes the class with a specified configuration. - The configuration. - - - Represents the trace writer. - - - Invokes the specified traceAction to allow setting values in a new if and only if tracing is permitted at the given category and level. - The current . It may be null but doing so will prevent subsequent trace analysis from correlating the trace to a particular request. - The logical category for the trace. Users can define their own. - The at which to write this trace. - The action to invoke if tracing is enabled. The caller is expected to fill in the fields of the given in this action. - - - Represents an extension methods for . - - - Provides a set of methods and properties that help debug your code with the specified writer, request, category and exception. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - - - Provides a set of methods and properties that help debug your code with the specified writer, request, category, exception, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - The format of the message. - The message argument. - - - Provides a set of methods and properties that help debug your code with the specified writer, request, category, exception, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The message argument. - - - Displays an error message in the list with the specified writer, request, category and exception. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - - - Displays an error message in the list with the specified writer, request, category, exception, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The exception. - The format of the message. - The argument in the message. - - - Displays an error message in the list with the specified writer, request, category, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The argument in the message. - - - Displays an error message in the class with the specified writer, request, category and exception. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The exception that appears during execution. - - - Displays an error message in the class with the specified writer, request, category and exception, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The exception. - The format of the message. - The message argument. - - - Displays an error message in the class with the specified writer, request, category and message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The message argument. - - - Displays the details in the . - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - - - Displays the details in the . - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - The format of the message. - The message argument. - - - Displays the details in the . - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The message argument. - - - Indicates the trace listeners in the Listeners collection. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The trace level. - The error occurred during execution. - - - Indicates the trace listeners in the Listeners collection. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The trace level. - The error occurred during execution. - The format of the message. - The message argument. - - - Indicates the trace listeners in the Listeners collection. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The of the trace. - The format of the message. - The message argument. - - - Traces both a begin and an end trace around a specified operation. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The of the trace. - The name of the object performing the operation. It may be null. - The name of the operation being performed. It may be null. - The to invoke prior to performing the operation, allowing the given to be filled in. It may be null. - An <see cref="T:System.Func`1" /> that returns the that will perform the operation. - The to invoke after successfully performing the operation, allowing the given to be filled in. It may be null. - The to invoke if an error was encountered performing the operation, allowing the given to be filled in. It may be null. - - - Traces both a begin and an end trace around a specified operation. - The returned by the operation. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The of the trace. - The name of the object performing the operation. It may be null. - The name of the operation being performed. It may be null. - The to invoke prior to performing the operation, allowing the given to be filled in. It may be null. - An <see cref="T:System.Func`1" /> that returns the that will perform the operation. - The to invoke after successfully performing the operation, allowing the given to be filled in. The result of the completed task will also be passed to this action. This action may be null. - The to invoke if an error was encountered performing the operation, allowing the given to be filled in. It may be null. - The type of result produced by the . - - - Traces both a begin and an end trace around a specified operation. - The returned by the operation. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The of the trace. - The name of the object performing the operation. It may be null. - The name of the operation being performed. It may be null. - The to invoke prior to performing the operation, allowing the given to be filled in. It may be null. - An <see cref="T:System.Func`1" /> that returns the that will perform the operation. - The to invoke after successfully performing the operation, allowing the given to be filled in. It may be null. - The to invoke if an error was encountered performing the operation, allowing the given to be filled in. It may be null. - - - Indicates the warning level of execution. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - - - Indicates the warning level of execution. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - The format of the message. - The message argument. - - - Indicates the warning level of execution. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The message argument. - - - Specifies an enumeration of tracing categories. - - - An action category. - - - The controllers category. - - - The filters category. - - - The formatting category. - - - The message handlers category. - - - The model binding category. - - - The request category. - - - The routing category. - - - Specifies the kind of tracing operation. - - - Trace marking the beginning of some operation. - - - Trace marking the end of some operation. - - - Single trace, not part of a Begin/End trace pair. - - - Specifies an enumeration of tracing level. - - - Trace level for debugging traces. - - - Trace level for error traces. - - - Trace level for fatal traces. - - - Trace level for informational traces. - - - Tracing is disabled. - - - Trace level for warning traces. - - - Represents a trace record. - - - Initializes a new instance of the class. - The message request. - The trace category. - The trace level. - - - Gets or sets the tracing category. - The tracing category. - - - Gets or sets the exception. - The exception. - - - Gets or sets the kind of trace. - The kind of trace. - - - Gets or sets the tracing level. - The tracing level. - - - Gets or sets the message. - The message. - - - Gets or sets the logical operation name being performed. - The logical operation name being performed. - - - Gets or sets the logical name of the object performing the operation. - The logical name of the object performing the operation. - - - Gets the optional user-defined properties. - The optional user-defined properties. - - - Gets the from the record. - The from the record. - - - Gets the correlation ID from the . - The correlation ID from the . - - - Gets or sets the associated with the . - The associated with the . - - - Gets the of this trace (via ). - The of this trace (via ). - - - Represents a class used to recursively validate an object. - - - Initializes a new instance of the class. - - - Determines whether instances of a particular type should be validated. - true if the type should be validated; false otherwise. - The type to validate. - - - Determines whether the is valid and adds any validation errors to the 's . - true if model is valid, false otherwise. - The model to be validated. - The to use for validation. - The used to provide model metadata. - The within which the model is being validated. - The to append to the key for any validation errors. - - - Represents an interface for the validation of the models - - - Determines whether the model is valid and adds any validation errors to the actionContext's - trueif model is valid, false otherwise. - The model to be validated. - The to use for validation. - The used to provide the model metadata. - The within which the model is being validated. - The to append to the key for any validation errors. - - - This logs formatter errors to the provided . - - - Initializes a new instance of the class. - The model state. - The prefix. - - - Logs the specified model error. - The error path. - The error message. - - - Logs the specified model error. - The error path. - The error message. - - - Provides data for the event. - - - Initializes a new instance of the class. - The action context. - The parent node. - - - Gets or sets the context for an action. - The context for an action. - - - Gets or sets the parent of this node. - The parent of this node. - - - Provides data for the event. - - - Initializes a new instance of the class. - The action context. - The parent node. - - - Gets or sets the context for an action. - The context for an action. - - - Gets or sets the parent of this node. - The parent of this node. - - - Provides a container for model validation information. - - - Initializes a new instance of the class, using the model metadata and state key. - The model metadata. - The model state key. - - - Initializes a new instance of the class, using the model metadata, the model state key, and child model-validation nodes. - The model metadata. - The model state key. - The model child nodes. - - - Gets or sets the child nodes. - The child nodes. - - - Combines the current instance with a specified instance. - The model validation node to combine with the current instance. - - - Gets or sets the model metadata. - The model metadata. - - - Gets or sets the model state key. - The model state key. - - - Gets or sets a value that indicates whether validation should be suppressed. - true if validation should be suppressed; otherwise, false. - - - Validates the model using the specified execution context. - The action context. - - - Validates the model using the specified execution context and parent node. - The action context. - The parent node. - - - Gets or sets a value that indicates whether all properties of the model should be validated. - true if all properties of the model should be validated, or false if validation should be skipped. - - - Occurs when the model has been validated. - - - Occurs when the model is being validated. - - - Represents the selection of required members by checking for any required ModelValidators associated with the member. - - - Initializes a new instance of the class. - The metadata provider. - The validator providers. - - - Indicates whether the member is required for validation. - true if the member is required for validation; otherwise, false. - The member. - - - Provides a container for a validation result. - - - Initializes a new instance of the class. - - - Gets or sets the name of the member. - The name of the member. - - - Gets or sets the validation result message. - The validation result message. - - - Provides a base class for implementing validation logic. - - - Initializes a new instance of the class. - The validator providers. - - - Returns a composite model validator for the model. - A composite model validator for the model. - An enumeration of validator providers. - - - Gets a value that indicates whether a model property is required. - true if the model property is required; otherwise, false. - - - Validates a specified object. - A list of validation results. - The metadata. - The container. - - - Gets or sets an enumeration of validator providers. - An enumeration of validator providers. - - - Provides a list of validators for a model. - - - Initializes a new instance of the class. - - - Gets a list of validators associated with this . - The list of validators. - The metadata. - The validator providers. - - - Provides an abstract class for classes that implement a validation provider. - - - Initializes a new instance of the class. - - - Gets a type descriptor for the specified type. - A type descriptor for the specified type. - The type of the validation provider. - - - Gets the validators for the model using the metadata and validator providers. - The validators for the model. - The metadata. - An enumeration of validator providers. - - - Gets the validators for the model using the metadata, the validator providers, and a list of attributes. - The validators for the model. - The metadata. - An enumeration of validator providers. - The list of attributes. - - - Represents the method that creates a instance. - - - Represents an implementation of which providers validators for attributes which derive from . It also provides a validator for types which implement . To support client side validation, you can either register adapters through the static methods on this class, or by having your validation attributes implement . The logic to support IClientValidatable is implemented in . - - - Initializes a new instance of the class. - - - Gets the validators for the model using the specified metadata, validator provider and attributes. - The validators for the model. - The metadata. - The validator providers. - The attributes. - - - Registers an adapter to provide client-side validation. - The type of the validation attribute. - The type of the adapter. - - - Registers an adapter factory for the validation provider. - The type of the attribute. - The factory that will be used to create the object for the specified attribute. - - - Registers the default adapter. - The type of the adapter. - - - Registers the default adapter factory. - The factory that will be used to create the object for the default adapter. - - - Registers the default adapter type for objects which implement . The adapter type must derive from and it must contain a public constructor which takes two parameters of types and . - The type of the adapter. - - - Registers the default adapter factory for objects which implement . - The factory. - - - Registers an adapter type for the given modelType, which must implement . The adapter type must derive from and it must contain a public constructor which takes two parameters of types and . - The model type. - The type of the adapter. - - - Registers an adapter factory for the given modelType, which must implement . - The model type. - The factory. - - - Provides a factory for validators that are based on . - - - Represents a validator provider for data member model. - - - Initializes a new instance of the class. - - - Gets the validators for the model. - The validators for the model. - The metadata. - An enumerator of validator providers. - A list of attributes. - - - An implementation of which provides validators that throw exceptions when the model is invalid. - - - Initializes a new instance of the class. - - - Gets a list of validators associated with this . - The list of validators. - The metadata. - The validator providers. - The list of attributes. - - - Represents the provider for the required member model validator. - - - Initializes a new instance of the class. - The required member selector. - - - Gets the validator for the member model. - The validator for the member model. - The metadata. - The validator providers - - - Provides a model validator. - - - Initializes a new instance of the class. - The validator providers. - The validation attribute for the model. - - - Gets or sets the validation attribute for the model validator. - The validation attribute for the model validator. - - - Gets a value that indicates whether model validation is required. - true if model validation is required; otherwise, false. - - - Validates the model and returns the validation errors if any. - A list of validation error messages for the model, or an empty list if no errors have occurred. - The model metadata. - The container for the model. - - - A to represent an error. This validator will always throw an exception regardless of the actual model value. - - - Initializes a new instance of the class. - The list of model validator providers. - The error message for the exception. - - - Validates a specified object. - A list of validation results. - The metadata. - The container. - - - Represents the for required members. - - - Initializes a new instance of the class. - The validator providers. - - - Gets or sets a value that instructs the serialization engine that the member must be presents when validating. - true if the member is required; otherwise, false. - - - Validates the object. - A list of validation results. - The metadata. - The container. - - - Provides an object adapter that can be validated. - - - Initializes a new instance of the class. - The validation provider. - - - Validates the specified object. - A list of validation results. - The metadata. - The container. - - - Represents the base class for value providers whose values come from a collection that implements the interface. - - - Retrieves the keys from the specified . - The keys from the specified . - The prefix. - - - Represents an interface that is implemented by any that supports the creation of a to access the of an incoming . - - - Defines the methods that are required for a value provider in ASP.NET MVC. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Retrieves a value object using the specified key. - The value object for the specified key, or null if the key is not found. - The key of the value object to retrieve. - - - This attribute is used to specify a custom . - - - Initializes a new instance of the . - The type of the model binder. - - - Initializes a new instance of the . - An array of model binder types. - - - Gets the value provider factories. - A collection of value provider factories. - A configuration object. - - - Gets the types of object returned by the value provider factory. - A collection of types. - - - Represents a factory for creating value-provider objects. - - - Initializes a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - - - Represents the result of binding a value (such as from a form post or query string) to an action-method argument property, or to the argument itself. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The raw value. - The attempted value. - The culture. - - - Gets or sets the raw value that is converted to a string for display. - The raw value that is converted to a string for display. - - - Converts the value that is encapsulated by this result to the specified type. - The converted value. - The target type. - - - Converts the value that is encapsulated by this result to the specified type by using the specified culture information. - The converted value. - The target type. - The culture to use in the conversion. - - - Gets or sets the culture. - The culture. - - - Gets or set the raw value that is supplied by the value provider. - The raw value that is supplied by the value provider. - - - Represents a value provider whose values come from a list of value providers that implements the interface. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The list of value providers. - - - Determines whether the collection contains the specified . - true if the collection contains the specified ; otherwise, false. - The prefix to search for. - - - Retrieves the keys from the specified . - The keys from the specified . - The prefix from which keys are retrieved. - - - Retrieves a value object using the specified . - The value object for the specified . - The key of the value object to retrieve. - - - Inserts an element into the collection at the specified index. - The zero-based index at which should be inserted. - The object to insert. - - - Replaces the element at the specified index. - The zero-based index of the element to replace. - The new value for the element at the specified index. - - - Represents a factory for creating a list of value-provider objects. - - - Initializes a new instance of the class. - The collection of value-provider factories. - - - Retrieves a list of value-provider objects for the specified controller context. - The list of value-provider objects for the specified controller context. - An object that encapsulates information about the current HTTP request. - - - A value provider for name/value pairs. - - - - Initializes a new instance of the class. - The name/value pairs for the provider. - The culture used for the name/value pairs. - - - Initializes a new instance of the class, using a function delegate to provide the name/value pairs. - A function delegate that returns a collection of name/value pairs. - The culture used for the name/value pairs. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Gets the keys from a prefix. - The keys. - The prefix. - - - Retrieves a value object using the specified key. - The value object for the specified key. - The key of the value object to retrieve. - - - Represents a value provider for query strings that are contained in a object. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - An object that contains information about the target culture. - - - Represents a class that is responsible for creating a new instance of a query-string value-provider object. - - - Initializes a new instance of the class. - - - Retrieves a value-provider object for the specified controller context. - A query-string value-provider object. - An object that encapsulates information about the current HTTP request. - - - Represents a value provider for route data that is contained in an object that implements the IDictionary(Of TKey, TValue) interface. - - - Initializes a new instance of the class. - An object that contain information about the HTTP request. - An object that contains information about the target culture. - - - Represents a factory for creating route-data value provider objects. - - - Initializes a new instance of the class. - - - Retrieves a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - - - \ No newline at end of file diff --git a/lib/autofac/Autofac.Configuration.dll b/lib/autofac/Autofac.Configuration.dll deleted file mode 100644 index 230786aa249..00000000000 Binary files a/lib/autofac/Autofac.Configuration.dll and /dev/null differ diff --git a/lib/autofac/Autofac.Configuration.xml b/lib/autofac/Autofac.Configuration.xml deleted file mode 100644 index 6ed974b36bf..00000000000 --- a/lib/autofac/Autofac.Configuration.xml +++ /dev/null @@ -1,1273 +0,0 @@ - - - - Autofac.Configuration - - - - - Configures properties on other modules using settings from the appSettings section of - the configuration file. These can then be provided to component constructors as parameters - during registrations within the module. - - - The convention for the appSettings key is "Module.PropertyName" (e.g. Email.Pop3Host). - Modules should be named with a "Module" suffix (e.g. EmailModule). - - - - - Initializes a new instance of the class. - - The modules whose properties should be configured - using settings from the appSettings section of the configuration file. - - - - Override to add registrations to the container. - - The builder through which components can be registered. - - Note that the ContainerBuilder parameter is unique to this module. - - - - - Type converter used for converting assembly name strings to assembly and back. - - - - This type is used in configuration settings where an assembly name is provided and needs to be - handled on the back end as a strongly-typed, loaded assembly rather than a string. - - - - - - Converts an assembly name into an assembly. - - - The configuration context. - - - The configuration culture. - - - The assembly name to parse. - - - If is , empty, or whitespace this conversion - will return . Otherwise, the assembly specified by the - will be loaded and returned. - - - - - Converts an assembly into an assembly name. - - - The configuration context. - - - The configuration culture. - - - The assembly to convert. - - - The destination type to which the assembly should be converted. (Ignored for configuration converters.) - - - If is this conversion returns ; - otherwise the return value will be the full name of the assembly. - - - Thrown if is not and is not an . - - - - - Element describing a component registration. - - - - - Gets the type of the component. - - The type. - - - - Gets the service exposed by the component. For multiple-service components, - use the services element instead. - - The service. - - - - Allows the component to be added to another composite component. - - The name of the composite component. - - - - Allows the component to be added to another composite component. - - The name of the composite component. - - - - Sets the scope of the component instances. - - singleton (default,) factory or container. - - - - Sets the ownership over the component instances. - - container (default) or external. - - - - Sets up property injection for the component instances. This uses the - OnActivated event so that circular dependencies can be handled. - - never (default,) all, unset. - - - - Sets up auto activation for the component instances. - - no(default,) yes. - - - - Gets the services exposed by the component. - - The services. - - - - Gets the parameters used to construct the component. - - The parameters. - - - - Gets the properties to be explicitly set on the component. - - The explicit properties. - - - - Gets the extended properties associated with the registration. - - The extended properties. - - - - A collection of component elements. - - - - - A collection of configuration elements. - - The type of the element type. - - - - Initializes a new instance of the class. - - Name of the element. - - - - Indicates whether the specified exists in the . - - The name of the element to verify. - - true if the element exists in the collection; otherwise, false. The default is false. - - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - When overridden in a derived class, creates a new . - - - A new . - - - - - Gets the element key for a specified configuration element when overridden in a derived class. - - The to return the key for. - - An that acts as the key for the specified . - - - - - Gets the name used to identify this collection of elements in the configuration file when overridden in a derived class. - - The name of the collection; otherwise, an empty string. The default is an empty string. - - - - Gets the type of the . - - The of this collection. - - - - Initializes a new instance of the class. - - - - - Base class for a configuration parsing/execution module. - - - - Derived module classes are responsible for reading in configuration settings and populating - the property. The - value there will be used in to - convert the configuration into container registrations. - - - - - - - - Executes the conversion of configuration data into component registrations. - - - The into which registrations will be placed. - - - - This override uses the - to convert the - into component registrations in the provided . - - - If no specific - is set, the default type will be used. - - - - Thrown if is . - - - Thrown if the is . - - - - - Gets or sets the configuration registrar. - - - An that will be used as the - strategy for converting the - into component registrations. If this value is , the registrar - will be a . - - - - - Gets the section handler. - - - The that will be converted into - component registrations in a container. - - - - - Default service for adding configured registrations to a container. - - - - This default implementation of - processes contents into registrations into - a . You may derive and override to extend the functionality - or you may implement your own . - - - - - - - A service for adding configured registrations to a container. - - - - - Registers the contents of a configuration section into a container builder. - - - The that should receive the configured registrations. - - - The containing the configured registrations. - - - - - Registers the contents of a configuration section into a container builder. - - - The that should receive the configured registrations. - - - The containing the configured registrations. - - - Thrown if or is . - - - - This method is the primary entry point to configuration section registration. From here, - the various modules, components, and referenced files get registered. You may override - any of those behaviors for a custom registrar if you wish to extend registration behavior. - - - - - - Registers individual configured components into a container builder. - - - The that should receive the configured registrations. - - - The containing the configured registrations. - - - Thrown if or is . - - - Thrown if there is any issue in parsing the component configuration into registrations. - - - - This is where the individually configured component registrations get added to the . - The collection from the - get processed into individual registrations with associated lifetime scope, name, etc. - - - You may influence the process by overriding this whole method or by overriding these individual - parsing subroutines: - - - - - - - - - - - - - - - - - Registers individual configured modules into a container builder. - - - The that should receive the configured registrations. - - - The containing the configured registrations. - - - Thrown if or is . - - - Thrown if there is any issue in parsing the module configuration into registrations. - - - - This is where the individually configured component registrations get added to the . - The collection from the - get processed into individual modules which are instantiated and activated inside the . - - - - - - Registers referenced configuration files into a container builder. - - - The that should receive the configured registrations. - - - The containing the configured registrations. - - - Thrown if or is . - - - Thrown if there is any issue in processing the referenced files into registrations. - - - - This is where external files referenced in configuration get recursively loaded and added to the . - The collection from the - get processed into individual instances, each of which get - registered with the . - - - - - - Sets the property injection mode for the component. - - - The component registration on which property injection mode is being set. - - - The configuration value associated with property - injection for this component registration. - - - - By default, this implementation understands , empty, - or values (false, 0, no) - to mean "no property injection should occur" and - values (true, 1, yes) to mean "property injection - should occur." - - - You may override this method to extend the available grammar for property injection settings. - - - - Thrown if is . - - - Thrown if the value for is not part of the - recognized grammar. - - - - - Sets the auto activation mode for the component. - - - The component registration on which auto activation mode is being set. - - - The configuration value associated with auto - activate for this component registration. - - - - By default, this implementation understands , empty, - or values (false, 0, no) - to mean "no property injection should occur" and - values (true, 1, yes) to mean "auto activation - should occur." - - - You may override this method to extend the available grammar for auto activation settings. - - - - Thrown if is . - - - Thrown if the value for is not part of the - recognized grammar. - - - - - Sets the ownership model for the component. - - - The component registration on which the ownership model is being set. - - - The configuration value associated with the - ownership model for this component registration. - - - - By default, this implementation understands or empty - values to be "default ownership model"; lifetime-scope or LifetimeScope - is "owned by lifetime scope"; and external or ExternallyOwned is - "externally owned." - - - You may override this method to extend the available grammar for component ownership. - - - - Thrown if is . - - - Thrown if the value for is not part of the - recognized grammar. - - - - - Sets the lifetime scope for the component. - - - The component registration on which the lifetime scope is being set. - - - The configuration value associated with the - lifetime scope for this component registration. - - - - By default, this implementation understands or empty - values to be "default ownership model"; single-instance or SingleInstance - is singleton; instance-per-lifetime-scope, InstancePerLifetimeScope, per-lifetime-scope, - or PerLifetimeScope is one instance per nested lifetime scope; and instance-per-dependency, - InstancePerDependency, per-dependency, or PerDependency is - one instance for each resolution call. - - - You may override this method to extend the available grammar for lifetime scope. - - - - Thrown if is . - - - Thrown if the value for is not part of the - recognized grammar. - - - - - Loads a type by name. - - - Name of the to load. This may be a partial type name or a fully-qualified type name. - - - The default to use in type resolution if - is a partial type name. - - - The resolved based on the specified name. - - - Thrown if is . - - - Thrown if is empty. - - - Thrown if the specified can't be resolved as a fully-qualified type name and - isn't a partial type name for a found in the . - - - - - Configures containers based upon app.config/web.config settings. - - - - This module type uses standard .NET application configuration format files to initialize configuration - settings. By default the standard app.config/web.config is used with a configuration - section named autofac, but you can use the various constructors to override the file location - or configuration section name. - - - If you are storing your configuration settings in a raw XML file (without the additional - <configuration /> wrapper and section definitions you normally see in .NET application - configuration) you can use the module to specify - the XML file location directly. - - - - - - - - Initializes a new instance of the class - using the default application configuration file with a configuration section named autofac. - - - - - Initializes a new instance of the class - using the default application configuration file and a named section. - - - The name of the configuration section corresponding to a . - - - - - Initializes a new instance of the class - using a named configuration file and section. - - - The name of the configuration section corresponding to a . - - - The app.config/web.config format configuration file containing the - named section. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The {0} may not be empty.. - - - - - Looks up a localized string similar to Unable to find specified configuration file.. - - - - - Looks up a localized string similar to You must initialize the section handler on the module before executing the load operation.. - - - - - Looks up a localized string similar to No XML content nodes found in configuration. Check the XML reader to ensure configuration is in place.. - - - - - Looks up a localized string similar to The configuration section '{0}' could not be read.. - - - - - Looks up a localized string similar to If 'name' is specified, 'service' must also be specified (component name='{0}'.). - - - - - Looks up a localized string similar to Unable to convert object of type '{0}' to type '{1}'.. - - - - - Looks up a localized string similar to The type '{0}' specified in the TypeConverterAttribute is not a TypeConverter.. - - - - - Looks up a localized string similar to The type '{0}' could not be found. It may require assembly qualification, e.g. "MyType, MyAssembly".. - - - - - Looks up a localized string similar to The value '{0}' is not valid for the auto-activate attribute. Valid values are 'yes' and 'no'.. - - - - - Looks up a localized string similar to The value '{0}' is not valid for the inject-properties attribute. Valid values are 'yes' and 'no'.. - - - - - Looks up a localized string similar to The value '{0}' is not valid for the ownership attribute. Valid values are 'lifetime-scope' (the default) and 'external'.. - - - - - Looks up a localized string similar to The value '{0}' is not valid for the instance-scope attribute. Valid values are 'single-instance', 'per-dependency' (the default) and 'per-lifetime-scope'.. - - - - - Holds a dictionary of values for those properties/parameters that are a dictionary - - - - - Initializes a new instance of the class. - - - - - Helps convert the configuration element into an actuall generic list - - - - - Holds a list of values for those properties/parameters that are enumerable - - - - - Initializes a new instance of the class. - - - - - Helps convert the configuration element into an actual generic list - - - - - Helper methods used throughout the codebase. - - - - - Enforce that an argument is not null. Returns the - value if valid so that it can be used inline in - base initialiser syntax. - - - - - - - - - Element describing a component property. - - - - - Gets the name of the property. - - The name. - - - - Gets the value to be set (will be converted.) - - The value. - - - - Gets the type of the value. - - The type of the value. Defaults to string if not specified. - - - - Collection of extended property elements. - - - - - Base for multi-valued configuration elements. - - - - - - Initializes a new instance of the class. - - Name of the element. - The element key. - - - - Indicates whether the specified exists in the . - - The name of the element to verify. - - true if the element exists in the collection; otherwise, false. The default is false. - - - - - Creates a new . - - - A new . - - - - - Gets the element key for a specified configuration element when overridden in a derived class. - - The to return the key for. - - An that acts as the key for the specified . - - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Gets the name used to identify this collection of elements in the configuration file when overridden in a derived class. - - - The name of the collection; otherwise, an empty string. The default is an empty string. - - - - Gets the type of the . - - - The of this collection. - - - - Gets or sets the TElementType at the specified index. - - - - - - Initializes a new instance of the class. - - - - - Element describing an additional configuration file. - - - - - Gets the filename of the file. - - The filename. - - - - Gets the section name of the section in the configuration - file. - - The section name. - - - - A collection of file elements. - - - - - Initializes a new instance of the class. - - - - - Element describing a module registration. - - - - - Gets the type of the module. Must expose . - - The type. - - - - Gets the parameters used to construct the component. - - The parameters. - - - - Gets the properties to be explicitly set on the component. - - The explicit properties. - - - - A collection of module elements. - - - - - Initializes a new instance of the class. - - - - - Element describing a component constructor parameter. - - - - - Get the value of this element - - - - - - Gets the name of the parameter. - - The name. - - - - Gets the value used to set the parameter (type will be converted.) - - The value. - - - - If this parameter's value is a list of values - - - - - If this parameter's value is a dictionary - - - - - A collection of parameter elements. - - - - - Initializes a new instance of the class. - - - - - Convert to the Autofac parameter type. - - The parameters represented by this collection. - - - - Element describing a component property. - - - - - Get the value of this element - - - - - - Gets the name of the property. - - The name. - - - - Gets the value to be set (will be converted.) - - The value. - - - - If this property's value is a list of values - - - - - If this property's value is a dictionary - - - - - Collection of property elements. - - - - - Initializes a new instance of the class. - - - - - Convert to the Autofac parameter type. - - The parameters represented by this collection. - - - - Section handler for Autofac configuration. - - - - This configuration section is used for XML-based configuration of an Autofac - container. While it is primarily used from inside app.config or web.config - files, you may also use it with other arbitrary XML files via the - helper method. - - - - - - The default section name that will be searched for. - - - - - Deserializes a configuration section handler from a specific block of XML. - - - The used to read the XML configuration from the source. - - - A read/parsed based on the contents of the . - - - Thrown if is . - - - Thrown if does not contain XML configuration that can be parsed into - a . - - - - - Deserializes a configuration section handler from an XML configuration file. - - The path to the configuration file to parse. - - A read/parsed based on the contents of the . - - - Thrown if is . - - - Thrown if is empty. - - - Thrown if the file indicated by can't be found. - - - Thrown if the configuration can't properly be deserialized from the file. - - - - - Deserializes a configuration section handler from an XML configuration file. - - The path to the configuration file to parse. - - The name of the configuration section (if the is - application configuration format); or to use the default configuration - section name autofac or try the as a raw XML file. - - - A read/parsed based on the contents of the . - - - Thrown if is . - - - Thrown if is empty. - - - Thrown if the file indicated by can't be found. - - - Thrown if the configuration can't properly be deserialized from the file. - - - - - Checks the validity of a configuration file path and converts relative paths to absolute. - - - The file path to check/normalize. - - - If is an absolute path, it is returned unchanged; otherwise - it is made absolute relative to the current configuration location. - - - Thrown if is . - - - Thrown if is empty. - - - Thrown if the file indicated by can't be found. - - - - - Gets the components to be registered. - - - A with the list - of individual service components that should be registered. - - - - - Gets the default assembly to search for types in when not explicitly - provided with the type name. - - - An that should be used as the default assembly - in type searches. - - - - - Gets additional configuration files. - - - A with the list - of external/referenced configuration files. - - - - - Gets the modules to be registered. - - - A with the list - of modules that should be registered. - - - - - Element describing a service exposed by a component. - - - - - Gets the service type. - - The type. - - - - Gets the service name. - - The name. - - - - A collection of service elements. - - - - - Initializes a new instance of the class. - - - - - Some handy type conversion routines. - - - - - Does its best to convert whatever the value is into the destination - type. Null in yields null out for value types and the default(T) - for value types (this may change.) - - The value. - Type of the destination. - Reflected property or member info for the destination, if available, for retrieving custom type converter information. - An object of the destination type. - - - - Configuration for values in a list - - - - - Gets the key to be set (will be converted.) - - - - - Gets the value to be set (will be converted.) - - The value. - - - - Configures containers based upon XML configuration settings that are not stored in .NET application configuration. - - - - This module type uses raw XML files to initialize configuration settings. These files are expected to have XML - in them that can be deserialized into a . This XML is the same format - as you would see in a standard app.config/web.config for Autofac, but doesn't require the additional - configuration section definition or other .NET application configuration XML around it. - - - If you are storing your configuration settings in a .NET application configuration file - (app.config/web.config) you can use the - module to read the settings right out of the configuration file without having to manually parse the XML. - - - - - - - - Initializes a new instance of the class - using a specified XML configuration file. - - - The name of the configuration file containing XML that can deserialize into a . - - - Thrown if is . - - - Thrown if is empty. - - - - Relative paths may be specified in relation to the current application folder (where you would normally - find app.config or web.config). - - - - - - Extension methods for reflection-related types. - - - - - Maps from a property-set-value parameter to the declaring property. - - Parameter to the property setter. - The property info on which the setter is specified. - True if the parameter is a property setter. - - - diff --git a/lib/autofac/Autofac.Integration.Web.dll b/lib/autofac/Autofac.Integration.Web.dll deleted file mode 100644 index f5e6ed4c821..00000000000 Binary files a/lib/autofac/Autofac.Integration.Web.dll and /dev/null differ diff --git a/lib/autofac/Autofac.Integration.Web.xml b/lib/autofac/Autofac.Integration.Web.xml deleted file mode 100644 index 1ac914b74a0..00000000000 --- a/lib/autofac/Autofac.Integration.Web.xml +++ /dev/null @@ -1,511 +0,0 @@ - - - - Autofac.Integration.Web - - - - - Injects dependencies into request handlers and pages that have been - decorated with the [InjectProperties] or [InjectUnsetProperties] - attributes. - - - - - Assists with the construction of page injectors. - - - - - Provides dependency injection for a request handler. - - - - - Inject dependencies in the required fashion. - - The context. - The target. - - - - Inject dependencies in the required fashion. - - The context. - The target. - - - - Override to return a closure that injects properties into a target. - - The context. - The injector. - - - - Does the injection using a supplied injection function. - - The injector. - The target. - - - - Override to return a closure that injects properties into a target. - - The context. - The injector. - - - - Injects dependencies into request handlers and pages that have been - decorated with the [InjectProperties] or [InjectUnsetProperties] - attributes. - - - - - Base for classes that inject dependencies into HTTP Handlers. - - - - - Disposes of the resources (other than memory) used by the module that implements . - - - - - Initializes a module and prepares it to handle requests. - - An that provides access to the methods, properties, and events common to all application objects within an ASP.NET application - - - - Called before the request handler is executed so that dependencies - can be injected. - - The sender. - The instance containing the event data. - - - - Internal for testability outside of a web application. - - - The injection behavior. - - - - Override to customize injection behavior based on HTTP Handler type. - - Type of the handler. - The injection behavior. - - - - A behavior that does not inject dependencies. - - - - - A behavior that injects resolvable dependencies. - - - - - A behavior that injects unset, resolvable dependencies. - - - - - Override to customise injection behavior based on HTTP Handler type. - - Type of the handler. - The injection behavior. - - - - HTTP Module that disposes of Autofac-created components when processing for - a request completes. - - - - - Disposes of the resources (other than memory) used by the module that implements . - - - - - Initializes a module and prepares it to handle requests. - - An that provides access to the methods, properties, and events common to all application objects within an ASP.NET application - - - - Dispose of the per-request container. - - - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to This module requires that the HttpApplication (Global Application Class) implements IContainerProviderAccessor.. - - - - - Looks up a localized string similar to IContainerProviderAccessor.ContainerProvider returned null, which is invalid. If the container provider belongs to the HttpApplication subclass, ensure that it is a static variable.. - - - - - Provides application-wide and per-request containers. - - - - - Provides global and per-request Autofac containers in an - ASP.NET application. - - - - - Dispose of the current request's container, if it has been - instantiated. - - - - - The global, application-wide container. - - - - - The lifetime used to manage components for processing the - current request. - - - - - Initializes a new instance of the class. - - The application container. - - - - Initializes a new instance of the class. - - The application container. - An action that will be executed when building - the per-request lifetime. The components visible within the request can be - customised here. - - - - Dispose of the current request's container, if it has been - instantiated. - - - - - The global, application-wide container. - - - - - - The container used to manage components for processing the - current request. - - - - - - Provides an implementation of which uses the configured - to route calls to the current request container. - - - - - Initializes a new instance of . - - The to use to retrieve the current request container. - - - - Begin a new nested scope. Component instances created via the new scope - will be disposed along with it. - - A new lifetime scope. - - - - Begin a new nested scope. Component instances created via the new scope - will be disposed along with it. - - The tag applied to the . - A new lifetime scope. - - - - Begin a new nested scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - - The components registered in the sub-scope will be treated as though they were - registered in the root scope, i.e., SingleInstance() components will live as long - as the root scope. - - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - - - Begin a new nested scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - - The components registered in the sub-scope will be treated as though they were - registered in the root scope, i.e., SingleInstance() components will live as long - as the root scope. - - The tag applied to the . - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - - - Resolve an instance of the provided registration within the context. - - The registration. - Parameters for the instance. - - The component instance. - - - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Associates services with the components that provide them. - - - - - The disposer associated with this . - Component instances can be associated with it manually if required. - - Typical usage does not require interaction with this member- it - is used when extending the container. - - - - The tag applied to the . - - Tags allow a level in the lifetime hierarchy to be identified. - In most applications, tags are not necessary. - - - - - Fired when a new scope based on the current scope is beginning. - - - - - Fired when this scope is ending. - - - - - Fired when a resolve operation is beginning in this scope. - - - - - Base class for dependency injection attributes. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to This module requires that the HttpApplication (Global Application Class) implements IContainerProviderAccessor.. - - - - - Looks up a localized string similar to IContainerProviderAccessor.ContainerProvider returned null, which is invalid. If the container provider belongs to the HttpApplication subclass, ensure that it is a static variable.. - - - - - Implemented on a type (i.e. HttpApplication) that maintains a container provider - for injecting dependencies into web requests. - - - - - Gets the container provider. - - The container provider. - - - - Indicates that property injection should be performed on the instance when it is instantiated. - - - - - Indicates that property injection should be performed for null-valued - properties on the instance when it is instantiated. - - - - - Does not inject properties. - - - - - Inject dependencies in the required fashion. - - The context. - The target. - - - - Injects any resolvable properties. - - - - - Override to return a closure that injects properties into a target. - - The context. - The injector. - - - - Dependency injection module that will always inject any resolvable - properties. - - - - - Override to customise injection behavior based on HTTP Handler type. - - Type of the handler. - The injection behavior. - - - - Extends registration syntax for common web scenarios. - - - - - Share one instance of the component within the context of a single - HTTP request. - - Registration limit type. - Registration style. - Activator data type. - The registration to configure. - Additional tags applied for matching lifetime scopes. - A registration builder allowing further configuration of the component. - - Thrown if is . - - - - - Cache instances in the web session. This implies external ownership (disposal is not - available.) All dependencies must also have external ownership. - - - It is strongly recommended that components cached per-session do not take dependencies on - other services. - - Registration limit type. - Registration style. - Activator data type. - The registration to configure. - A registration builder allowing further configuration of the component. - - - - Injects resolvable properties that do not already have a value. - - - - - Override to return a closure that injects properties into a target. - - The context. - The injector. - - - - Dependency injection module that will always inject any resolvable - properties. - - - - - Override to customise injection behavior based on HTTP Handler type. - - Type of the handler. - The injection behavior. - - - - Constants used to tag liftime scopes within standard Autofac web applications. - - - - - Application lifetime - - - - diff --git a/lib/autofac/Autofac.XML b/lib/autofac/Autofac.XML deleted file mode 100644 index 0b2a8808a13..00000000000 --- a/lib/autofac/Autofac.XML +++ /dev/null @@ -1,6923 +0,0 @@ - - - - Autofac - - - - - Service used as a "flag" to indicate a particular component should be - automatically activated on container build. - - - - - Services are the lookup keys used to locate component instances. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Implements the operator ==. - - The left operand. - The right operand. - The result of the operator. - - - - Implements the operator !=. - - The left operand. - The right operand. - The result of the operator. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - The parameter is null. - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Gets a human-readable description of the service. - - The description. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - if the specified is not - and is an ; otherwise, . - - - - All services of this type are considered "equal." - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . Always 0 for this type. - - - - All services of this type are considered "equal" and use the same hash code. - - - - - - Gets the service description. - - - Always returns AutoActivate. - - - - - Used with the WithMetadata configuration method to - associate key-value pairs with an . - - Interface with properties whose names correspond to - the property keys. - This feature was suggested by OJ Reeves (@TheColonial). - - - - Set one of the property values. - - The type of the property. - An expression that accesses the property to set. - The property value to set. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Cannot choose between multiple constructors with equal length {0} on type '{1}'. Select the constructor explicitly, with the UsingConstructor() configuration method, when the component is registered.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to {0} ---> {1} (See inner exception for details.). - - - - - Well-known tags used in setting up matching lifetime scopes. - - - - - Tag used in setting up per-request lifetime scope registrations - (e.g., per-HTTP-request or per-API-request). - - - - - Interface providing fluent syntax for chaining module registrations. - - - - - Add a module to the container. - - The module to add. - - The to allow - additional chained module registrations. - - - - - Basic implementation of the - interface allowing registration of modules into a - in a fluent format. - - - - - The into which registrations will be made. - - - - - Initializes a new instance of the class. - - - The into which registrations will be made. - - - Thrown if is . - - - - - Add a module to the container. - - The module to add. - - The to allow - additional chained module registrations. - - - Thrown if is . - - - - - Support the System.Lazy<T, TMetadata> - types automatically whenever type T is registered with the container. - Metadata values come from the component registration's metadata. - When a dependency of a lazy type is used, the instantiation of the underlying - component will be delayed until the Value property is first accessed. - - - - - Allows registrations to be made on-the-fly when unregistered - services are requested (lazy registrations.) - - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - If the source is queried for service s, and it returns a component that implements both s and s', then it - will not be queried again for either s or s'. This means that if the source can return other implementations - of s', it should return these, plus the transitive closure of other components implementing their - additional services, along with the implementation of s. It is not an error to return components - that do not implement . - - - - - Gets whether the registrations provided by this source are 1:1 adapters on top - of other components (I.e. like Meta, Func or Owned.) - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Lazy<T, TMetadata> Support. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The type '{0}' cannot be used as a metadata view. A metadata view must be a concrete class with a parameterless or dictionary constructor.. - - - - - Looks up a localized string similar to Export metadata for '{0}' is missing and no default value was supplied.. - - - - - Provides a value along with metadata describing the value. - - The type of the value. - An interface to which metadata values can be bound. - - - - Create a new instance. - - The value described by the instance. - The metadata describing the value. - - - - The value described by . - - - - - Metadata describing the value. - - - - - Support the - types automatically whenever type T is registered with the container. - Metadata values come from the component registration's metadata. - - - - - Finds constructors that match a finder function. - - - - - Find suitable constructors from which to select. - - - - - Finds suitable constructors on the target type. - - Type to search for constructors. - Suitable constructors. - - - - Initializes a new instance of the class. - - - Default to selecting all public constructors. - - - - - Initializes a new instance of the class. - - The finder function. - - - - Finds suitable constructors on the target type. - - Type to search for constructors. - Suitable constructors. - - - - Extension methods for configuring the . - - - - - Fluent method for setting the registration configuration on . - - The registration source to configure. - A configuration action that will run on any registration provided by the source. - - The with the registration configuration set. - - - - - Extension methods for registering instances with a container. - - - - - Registers modules found in an assembly. - - The builder to register the modules with. - The assemblies from which to register modules. - - Thrown if is . - - - The to allow - additional chained module registrations. - - - - - Registers modules found in an assembly. - - The module registrar that will make the registrations into the container. - The assemblies from which to register modules. - - Thrown if is . - - - The to allow - additional chained module registrations. - - - - - Registers modules found in an assembly. - - The builder to register the modules with. - The assemblies from which to register modules. - The type of the module to add. - - Thrown if is . - - - The to allow - additional chained module registrations. - - - - - Registers modules found in an assembly. - - The module registrar that will make the registrations into the container. - The assemblies from which to register modules. - The type of the module to add. - - Thrown if is . - - - The to allow - additional chained module registrations. - - - - - Registers modules found in an assembly. - - The builder to register the modules with. - The of the module to add. - The assemblies from which to register modules. - - Thrown if or is . - - - The to allow - additional chained module registrations. - - - - - Registers modules found in an assembly. - - The module registrar that will make the registrations into the container. - The of the module to add. - The assemblies from which to register modules. - - Thrown if or is . - - - The to allow - additional chained module registrations. - - - - - Add a module to the container. - - The builder to register the module with. - The module to add. - - Thrown if is . - - - The to allow - additional chained module registrations. - - - - - Add a module to the container. - - The module registrar that will make the registration into the container. - The module to add. - - Thrown if is . - - - The to allow - additional chained module registrations. - - - - - Add a module to the container. - - The builder to register the module with. - The module to add. - - Thrown if or is . - - - The to allow - additional chained module registrations. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Module.ThisAssembly is only available in modules that inherit directly from Module.. - - - - - Support the - type automatically whenever type T is registered with the container. - When a dependency of a lazy type is used, the instantiation of the underlying - component will be delayed until the Value property is first accessed. - - - - - Generates context-bound closures that represent factories from - a set of heuristics based on delegate type signatures. - - - - - Create a factory generator. - - The service that will be activated in - order to create the products of the factory. - The delegate to provide as a factory. - The parameter mapping mode to use. - - - - Create a factory generator. - - The component that will be activated in - order to create the products of the factory. - The delegate to provide as a factory. - The parameter mapping mode to use. - - - - Generates a factory delegate that closes over the provided context. - - The context in which the factory will be used. - Parameters provided to the resolve call for the factory itself. - A factory delegate that will work within the context. - - - - Generates a factory delegate that closes over the provided context. - - The context in which the factory will be used. - Parameters provided to the resolve call for the factory itself. - A factory delegate that will work within the context. - - - - Reflection activator data for concrete types. - - - - - Builder for reflection-based activators. - - - - - Specify a reflection activator for the given type. - - Type that will be activated. - - - - Get the implementation type. - - - - - The constructor finder for the registration. - - - - - The constructor selector for the registration. - - - - - The explicitly bound constructor parameters. - - - - - The explicitly bound properties. - - - - - Activator data that can provide an IInstanceActivator instance. - - - - - The instance activator based on the provided data. - - - - - Specify a reflection activator for the given type. - - Type that will be activated. - - - - The instance activator based on the provided data. - - - - - Parameterises the construction of a container by a . - - - - - No options - the default behavior for container building. - - - - - Prevents inclusion of standard modules like support for - relationship types including etc. - - - - - Does not call on components implementing - this interface (useful for module testing.) - - - - - Data structure used to construct registrations. - - The most specific type to which instances of the registration - can be cast. - Activator builder type. - Registration style type. - - - - Configure the component so that instances are never disposed by the container. - - A registration builder allowing further configuration of the component. - - - - Configure the component so that instances that support IDisposable are - disposed by the container (default.) - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - gets a new, unique instance (default.) - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - gets the same, shared instance. - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a single ILifetimeScope gets the same, shared instance. Dependent components in - different lifetime scopes will get different instances. - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() within - a ILifetimeScope tagged with any of the provided tags value gets the same, shared instance. - Dependent components in lifetime scopes that are children of the tagged scope will - share the parent's instance. If no appropriately tagged scope can be found in the - hierarchy an is thrown. - - Tag applied to matching lifetime scopes. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - The service type provided by the component. - Key to associate with the component. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - Key to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. The generic parameter(s) to As() - will be exposed as TypedService instances. - - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. The generic parameter(s) to As() - will be exposed as TypedService instances. - - Service type. - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. The generic parameter(s) to As() - will be exposed as TypedService instances. - - Service type. - Service type. - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. - - Service types to expose. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. - - Services to expose. - A registration builder allowing further configuration of the component. - - - - Provide a textual name that can be used to retrieve the component. - - Named service to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Provide a textual name that can be used to retrieve the component. - - Named service to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Provide a key that can be used to retrieve the component. - - Key to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Provide a key that can be used to retrieve the component. - - Key to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Add a handler for the Preparing event. This event allows manipulating of the parameters - that will be provided to the component. - - The event handler. - A registration builder allowing further configuration of the component. - - - - Add a handler for the Activating event. - - The event handler. - A registration builder allowing further configuration of the component. - - - - Add a handler for the Activated event. - - The event handler. - A registration builder allowing further configuration of the component. - - - - Configure the component so that any properties whose types are registered in the - container will be wired to instances of the appropriate service. - - Set wiring options such as circular dependency wiring support. - A registration builder allowing further configuration of the component. - - - - Associates data with the component. - - Key by which the data can be located. - The data value. - A registration builder allowing further configuration of the component. - - - - Associates data with the component. - - The extended properties to associate with the component. - A registration builder allowing further configuration of the component. - - - - Associates data with the component. - - A type with properties whose names correspond to the - property names to configure. - A registration builder allowing further configuration of the component. - - - - The activator data. - - - - - The registration style. - - - - - The registration data. - - - - - Delegates registration lookups to a specified registry. When write operations are applied, - initialises a new 'writeable' registry. - - - Safe for concurrent access by multiple readers. Write operations are single-threaded. - - - - - Provides component registrations according to the services they provide. - - - - - Attempts to find a default registration for the specified service. - - The service to look up. - The default registration for the service. - True if a registration exists. - - - - Determines whether the specified service is registered. - - The service to test. - True if the service is registered. - - - - Register a component. - - The component registration. - - - - Register a component. - - The component registration. - If true, existing defaults for the services provided by the - component will not be changed. - - - - Selects from the available registrations after ensuring that any - dynamic registration sources that may provide - have been invoked. - - The service for which registrations are sought. - Registrations supporting . - - - - Add a registration source that will provide registrations on-the-fly. - - The source to register. - - - - Enumerate the registered components. - - - - - Fired whenever a component is registered - either explicitly or via a - . - - - - - Gets the registration sources that are used by the registry. - - - - - True if the registry contains its own components; false if it is forwarding - registrations from another external registry. - - This property is used when walking up the scope tree looking for - registrations for a new customised scope. (See issue 336.) - - - - Fired when an is added to the registry. - - - - - Enables contravariant Resolve() for interfaces that have a single contravariant ('in') parameter. - - - interface IHandler<in TCommand> - { - void Handle(TCommand command); - } - - class Command { } - - class DerivedCommand : Command { } - - class CommandHandler : IHandler<Command> { ... } - - var builder = new ContainerBuilder(); - builder.RegisterSource(new ContravariantRegistrationSource()); - builder.RegisterType<CommandHandler>(); - var container = builder.Build(); - // Source enables this line, even though IHandler<Command> is the - // actual registered type. - var handler = container.Resolve<IHandler<DerivedCommand>>(); - handler.Handle(new DerivedCommand()); - - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - If the source is queried for service s, and it returns a component that implements both s and s', then it - will not be queried again for either s or s'. This means that if the source can return other implementations - of s', it should return these, plus the transitive closure of other components implementing their - additional services, along with the implementation of s. It is not an error to return components - that do not implement . - - - - - Gets whether the registrations provided by this source are 1:1 adapters on top - of other components (I.e. like Meta, Func or Owned.) - - - - - Options that can be applied when autowiring properties on a component. (Multiple options can - be specified using bitwise 'or' - e.g. AllowCircularDependencies | PreserveSetValues. - - - - - Default behavior. Circular dependencies are not allowed; existing non-default - property values are overwritten. - - - - - Allows property-property and property-constructor circular dependency wiring. - This flag moves property wiring from the Activating to the Activated event. - - - - - If specified, properties that already have a non-default value will be left - unchanged in the wiring operation. - - - - - Static factory methods to simplify the creation and handling of IRegistrationBuilder{L,A,R}. - - - To create an for a specific type, use: - - var cr = RegistrationBuilder.ForType(t).CreateRegistration(); - - The full builder syntax is supported: - - var cr = RegistrationBuilder.ForType(t).Named("foo").ExternallyOwned().CreateRegistration(); - - - - - - Creates a registration builder for the provided delegate. - - Instance type returned by delegate. - Delegate to register. - A registration builder. - - - - Creates a registration builder for the provided delegate. - - Delegate to register. - Most specific type return value of delegate can be cast to. - A registration builder. - - - - Creates a registration builder for the provided type. - - Implementation type to register. - A registration builder. - - - - Creates a registration builder for the provided type. - - Implementation type to register. - A registration builder. - - - - Create an from a . - (There is no need to call - this method when registering components through a .) - - - When called on the result of one of the methods, - the returned registration will be different from the one the builder itself registers - in the container. - - - - var registration = RegistrationBuilder.ForType<Foo>().CreateRegistration(); - - - - - - The registration builder. - An IComponentRegistration. - - Thrown if is . - - - - - Create an IComponentRegistration from data. - - Id of the registration. - Registration data. - Activator. - Services provided by the registration. - An IComponentRegistration. - - - - Create an IComponentRegistration from data. - - Id of the registration. - Registration data. - Activator. - Services provided by the registration. - Optional; target registration. - An IComponentRegistration. - - Thrown if or is . - - - - - Register a component in the component registry. This helper method is necessary - in order to execute OnRegistered hooks and respect PreserveDefaults. - - Hoping to refactor this out. - - - - Component registry to make registration in. - Registration builder with data for new registration. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The type '{0}' is not assignable to service '{1}'.. - - - - - Adds registration syntax for less commonly-used features. - - - These features are in this namespace because they will remain accessible to - applications originally written against Autofac 1.4. In Autofac 2, this functionality - is implicitly provided and thus making explicit registrations is rarely necessary. - - - - - Registers a factory delegate. - - Container builder. - Factory type to generate. - Registration builder allowing the registration to be configured. - Factory delegates are provided automatically in Autofac 2, - and this method is generally not required. - - - - Registers a factory delegate. - - Container builder. - Factory type to generate. - The service that the delegate will return instances of. - Registration builder allowing the registration to be configured. - Factory delegates are provided automatically in Autofac 2, and - this method is generally not required. - - - - Registers a factory delegate. - - The type of the delegate. - Container builder. - The service that the delegate will return instances of. - Registration builder allowing the registration to be configured. - Factory delegates are provided automatically in Autofac 2, - and this method is generally not required. - - - - Registers a factory delegate. - - The type of the delegate. - Container builder. - Registration builder allowing the registration to be configured. - Factory delegates are provided automatically in Autofac 2, - and this method is generally not required. - - - - Changes the parameter mapping mode of the supplied delegate type to match - parameters by name. - - Factory delegate type - Activator data type - Registration style - Registration to change parameter mapping mode of. - Registration builder allowing the registration to be configured. - - Thrown if is . - - - - - Changes the parameter mapping mode of the supplied delegate type to match - parameters by position. - - Factory delegate type - Activator data type - Registration style - Registration to change parameter mapping mode of. - Registration builder allowing the registration to be configured. - - Thrown if is . - - - - - Changes the parameter mapping mode of the supplied delegate type to match - parameters by type. - - Factory delegate type - Activator data type - Registration style - Registration to change parameter mapping mode of. - Registration builder allowing the registration to be configured. - - Thrown if is . - - - - - Registers the type as a collection. If no services or names are specified, the - default services will be IList<T>, ICollection<T>, and IEnumerable<T> - - The type of the collection elements. - Container builder. - A unique name for the collection that can be passed to MemberOf(). - Registration builder allowing the registration to be configured. - Collections are provided automatically in Autofac 2, - and this method is generally not required. - - - - Registers the type as a collection. If no services or names are specified, the - default services will be IList<T>, ICollection<T>, and IEnumerable<T> - - The type of the collection elements. - Container builder. - A unique name for the collection that can be passed to MemberOf(). - Registration builder allowing the registration to be configured. - Collections are provided automatically in Autofac 2, - and this method is generally not required. - - - - Include the element explicitly in a collection configured using RegisterCollection. - - Registration limit type. - Registration style. - Activator data type. - Registration to export. - The collection name, as passed to RegisterCollection. - A registration builder allowing further configuration of the component. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Build() or Update() can only be called once on a ContainerBuilder.. - - - - - Looks up a localized string similar to An error occurred while attempting to automatically activate registration '{0}'. See the inner exception for information on the source of the failure.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to A delegate registered to create instances of '{0}' returned null.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Bound constructor '{0}'.. - - - - - Looks up a localized string similar to The binding cannot be instantiated.. - - - - - Looks up a localized string similar to An exception was thrown while invoking the constructor '{0}' on type '{1}'.. - - - - - Looks up a localized string similar to Cannot resolve parameter '{1}' of constructor '{0}'.. - - - - - Provides parameters that have a default value, set with an optional parameter - declaration in C# or VB. - - - - - Used in order to provide a value to a constructor parameter or property on an instance - being created by the container. - - - Not all parameters can be applied to all sites. - - - - - Returns true if the parameter is able to provide a value to a particular site. - - Constructor, method, or property-mutator parameter. - The component context in which the value is being provided. - If the result is true, the valueProvider parameter will - be set to a function that will lazily retrieve the parameter value. If the result is false, - will be set to null. - True if a value can be supplied; otherwise, false. - - - - Returns true if the parameter is able to provide a value to a particular site. - - Constructor, method, or property-mutator parameter. - The component context in which the value is being provided. - If the result is true, the valueProvider parameter will - be set to a function that will lazily retrieve the parameter value. If the result is false, - will be set to null. - True if a value can be supplied; otherwise, false. - - Thrown if is . - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The container's self-registration of context interfaces should never be activated as it is hard-wired into the LifetimeScope class.. - - - - - Marks a module as container-aware (for the purposes of attaching to diagnostic events.) - - - - - Initialise the module with the container into which it is being registered. - - The container. - - - - Fired when the activation process for a new instance is complete. - - - - - The context in which the activation occurred. - - - - - The component providing the instance. - - - - - The paramters provided when resolved. - - - - - The instance that will be used to satisfy the request. - - - - - Fired after the construction of an instance but before that instance - is shared with any other or any members are invoked on it. - - - - - The instance can be replaced if needed, e.g. by an interface proxy. - - The object to use instead of the activated instance. - - - - The context in which the activation occurred. - - - - - The component providing the instance. - - - - - The instance that will be used to satisfy the request. - - - - - The parameters supplied to the activator. - - - - - Interface supported by services that carry type information. - - - - - Return a new service of the same kind, but carrying - as the . - - The new service type. - A new service with the service type. - - - - Gets the type of the service. - - The type of the service. - - - - Identifies a service using a key in addition to its type. - - - - - Initializes a new instance of the class. - - Key of the service. - Type of the service. - - - - Indicates whether the current object is equal to another object of the same type. - - An object to compare with this object. - - true if the current object is equal to the parameter; otherwise, false. - - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - The parameter is null. - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Return a new service of the same kind, but carrying - as the . - - The new service type. - A new service with the service type. - - - - Gets or sets the key of the service. - - The key of the service. - - - - Gets the type of the service. - - The type of the service. - - - - Gets a human-readable description of the service. - - The description. - - - - Describes when a lifetime scope is beginning. - - - - - Create an instance of the class. - - The lifetime scope that is beginning. - - - - The lifetime scope that is beginning. - - - - - Describes when a lifetime scope is ending. - - - - - Create an instance of the class. - - The lifetime scope that is ending. - - - - The lifetime scope that is ending. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.. - - - - - Fired when an is added to the registry. - - - - - Construct an instance of the class. - - The registry to which the source was added. - The source that was added. - - - - - The registry to which the source was added. - - - - - The source that was added. - - - - - Represents the process of finding a component during a resolve operation. - - - - - The component for which an instance is to be looked up. - - - - - The scope in which the instance will be looked up. - - - - - The parameters provided for new instance creation. - - - - - Raised when the lookup phase of the operation is ending. - - - - - Raised when the completion phase of an instance lookup operation begins. - - - - - Raised when the completion phase of an instance lookup operation ends. - - - - - Raised when the completion phase of an instance lookup operation begins. - - - - - Create an instance of the class. - - The instance lookup that is beginning the completion phase. - - - - The instance lookup operation that is beginning the completion phase. - - - - - Raised when the completion phase of an instance lookup operation ends. - - - - - Create an instance of the class. - - The instance lookup that is ending the completion phase. - - - - The instance lookup operation that is ending the completion phase. - - - - - Fired when an instance is looked up. - - - - - Create an instance of the class. - - The instance lookup that is ending. - True if a new instance was created as part of the operation. - - - - True if a new instance was created as part of the operation. - - - - - The instance lookup operation that is ending. - - - - - Fired when instance lookup is complete. - - - - The instance lookup that is ending. - - - - The instance lookup operation that is beginning. - - - - - Describes the commencement of a new resolve operation. - - - - - Create an instance of the class. - - The resolve operation that is beginning. - - - - The resolve operation that is beginning. - - - - - Wraps a component registration, switching its lifetime. - - - - - Base class for disposable objects. - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Returns true if the current instance has been disposed; otherwise false; - - - - - Describes a logical component within the container. - - - - - Called by the container when an instance is required. - - The context in which the instance will be activated. - Parameters for activation. These may be modified by the event handler. - - - - Called by the container once an instance has been constructed. - - The context in which the instance was activated. - The parameters supplied to the activator. - The instance. - - - - Called by the container once an instance has been fully constructed, including - any requested objects that depend on the instance. - - The context in which the instance was activated. - The parameters supplied to the activator. - The instance. - - - - A unique identifier for this component (shared in all sub-contexts.) - This value also appears in Services. - - - - - The activator used to create instances. - - - - - The lifetime associated with the component. - - - - - Whether the component instances are shared or not. - - - - - Whether the instances of the component should be disposed by the container. - - - - - The services provided by the component. - - - - - Additional data associated with the component. - - - - - The component registration upon which this registration is based. - - - - - Fired when a new instance is required. The instance can be - provided in order to skip the regular activator, by setting the Instance property in - the provided event arguments. - - - - - Fired when a new instance is being activated. The instance can be - wrapped or switched at this time by setting the Instance property in - the provided event arguments. - - - - - Fired when the activation process for a new instance is complete. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Activator = {0}, Services = [{1}], Lifetime = {2}, Sharing = {3}, Ownership = {4}. - - - - - Pulls registrations from another component registry. - Excludes most auto-generated registrations - currently has issues with - collection registrations. - - - - - Create an external registry source that draws components from - . - - Component registry to pull registrations from. - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - - - In this case because the components that are adapted do not come from the same - logical scope, we must return false to avoid duplicating them. - - - - - Switches components with a RootScopeLifetime (singletons) with - decorators exposing MatchingScopeLifetime targeting the specified scope. - - - - - Maps services onto the components that provide them. - - - The component registry provides services directly from components, - and also uses to generate components - on-the-fly or as adapters for other components. A component registry - is normally used through a , and not - directly by application code. - - - - - Protects instance variables from concurrent access. - - - - - External registration sources. - - - - - All registrations. - - - - - Keeps track of the status of registered services. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Attempts to find a default registration for the specified service. - - The service to look up. - The default registration for the service. - True if a registration exists. - - - - Determines whether the specified service is registered. - - The service to test. - True if the service is registered. - - - - Register a component. - - The component registration. - - - - Register a component. - - The component registration. - If true, existing defaults for the services provided by the - component will not be changed. - - - - Selects from the available registrations after ensuring that any - dynamic registration sources that may provide - have been invoked. - - The service for which registrations are sought. - Registrations supporting . - - - - Add a registration source that will provide registrations on-the-fly. - - The source to register. - - - - Enumerate the registered components. - - - - - Fired whenever a component is registered - either explicitly or via a - . - - - - - Gets the registration sources that are used by the registry. - - - - - True if the registry contains its own components; false if it is forwarding - registrations from another external registry. - - This property is used when walking up the scope tree looking for - registrations for a new customised scope. (See issue 336.) - - - - Fired when an is added to the registry. - - - - - Tracks the services known to the registry. - - - - - Used for bookkeeping so that the same source is not queried twice (may be null.) - - - - - Initializes a new instance of the class. - - The tracked service. - - - - The first time a service is requested, initialization (e.g. reading from sources) - happens. This value will then be set to true. Calling many methods on this type before - initialisation is an error. - - - - - The known implementations. - - - - - True if any implementations are known. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The operation is only valid during initialization.. - - - - - Looks up a localized string similar to The operation is not valid until the object is initialized.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The activation has already been executed.. - - - - - Describes the commencement of a new resolve operation. - - - - - Create an instance of the class. - - The resolve operation that is ending. - If included, the exception causing the operation to end; otherwise, null. - - - - The exception causing the operation to end, or null. - - - - - The resolve operation that is ending. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Subclasses of Autofac.Service must override Object.Equals(). - - - - - Looks up a localized string similar to Subclasses of Autofac.Service must override Object.GetHashCode(). - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Collection Support (Arrays and Generic Collection Interfaces). - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Lazy<T> Support. - - - - - Describes the basic requirements for generating a lightweight adapter. - - - - - Create an instance of . - - The service that will be adapted from. - The adapter function. - - - - The adapter function. - - - - - The service to be adapted from. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Lightweight Adapter from {0} to {1}. - - - - - Looks up a localized string similar to The service {0} cannot be both the adapter's from and to parameters - these must differ.. - - - - - Internal implementation of the RegisterCollection/MemberOf-style collection feature. - - - - - Registration style for dynamic registrations. - - - - - Data used to create factory activators. - - - - - Create a new GeneratedFactoryActivatorData - - The type of the factory. - The service used to provide the products of the factory. - - - - Determines how the parameters of the delegate type are passed on - to the generated Resolve() call as Parameter objects. - For Func-based delegates, this defaults to ByType. Otherwise, the - parameters will be mapped by name. - - - - - Activator data that can provide an IInstanceActivator instance. - - - - - Hides standard Object members to make fluent interfaces - easier to read. - Based on blog post by @kzu here: - http://www.clariusconsulting.net/blogs/kzu/archive/2008/03/10/58301.aspx - - - - - Standard System.Object member. - - Standard result. - - - - Standard System.Object member. - - Standard result. - - - - Standard System.Object member. - - Standard result. - - - - Standard System.Object member. - - The other. - Standard result. - - - - Determines how the parameters of the delegate type are passed on - to the generated Resolve() call as Parameter objects. - - - - - Chooses parameter mapping based on the factory type. - For Func-based factories this is equivalent to ByType, for all - others ByName will be used. - - - - - Pass the parameters supplied to the delegate through to the - underlying registration as NamedParameters based on the parameter - names in the delegate type's formal argument list. - - - - - Pass the parameters supplied to the delegate through to the - underlying registration as TypedParameters based on the parameter - types in the delegate type's formal argument list. - - - - - Pass the parameters supplied to the delegate through to the - underlying registration as PositionalParameters based on the parameter - indices in the delegate type's formal argument list. - - - - - Provides components by lookup operations via an index (key) type. - - The type of the index. - The service provided by the indexed components. - - Retrieving a value given a key: - - IIndex<AccountType, IRenderer> accountRenderers = // ... - var renderer = accountRenderers[AccountType.User]; - - - - - - Get the value associated with if any is available. - - The key to look up. - The retrieved value. - True if a value associated with the key exists. - - - - Get the value associated with . - - The value to retrieve. - The associated value. - - - - - - - - - - - - - Support the - types automatically whenever type T is registered with the container. - Metadata values come from the component registration's metadata. - - - - - Provides a value along with a dictionary of metadata describing the value. - - The type of the value. - - - - Create a new instance. - - The value described by the instance. - The metadata describing the value. - - - - The value described by . - - - - - Metadata describing the value. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Meta<T> Support. - - - - - Looks up a localized string similar to Meta<T, TMetadata> Support. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The service '{0}' is not an open generic type.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to {0} providing {1}. - - - - - Describes the activator for an open generic decorator. - - - - - Construct an . - - The decorator type. - The open generic service type to decorate. - - - - The open generic service type to decorate. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The service {0} cannot be both the adapter's from and to parameters - these must differ.. - - - - - Looks up a localized string similar to Open Generic Decorator {0} from {1} to {2}. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The type {0} is not an open generic type definition.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The type '{0}' does not implement the interface '{1}'.. - - - - - Looks up a localized string similar to The implementation type '{0}' is not an open generic type definition.. - - - - - Looks up a localized string similar to The implementation type '{0}' does not support the interface '{1}'.. - - - - - Looks up a localized string similar to The service '{0}' is not an open generic type definition.. - - - - - Looks up a localized string similar to The service '{1}' is not assignable from implementation type '{0}'.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Owned<T> Support. - - - - - Provides registrations on-the-fly for any concrete type not already registered with - the container. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - A predicate that selects types the source will register. - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - - - Returns a that represents the current . - - - A that represents the current . - - 2 - - - - Gets whether the registrations provided by this source are 1:1 adapters on top - of other components (I.e. like Meta, Func or Owned.) - - - - - Gets or sets an expression used to configure generated registrations. - - - A that can be used to modify the behavior - of registrations that are generated by this source. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to "Resolve Anything" Support. - - - - - Activation data for types located by scanning assemblies. - - - - - Create an instance of . - - - - - The filters applied to the types from the scanned assembly. - - - - - Additional actions to be performed on the concrete type registrations. - - - - - Actions to be called once the scanning operation is complete. - - - - - Fired when the activation process for a new instance is complete. - - - - - Initializes a new instance of the class. - - The context. - The component. - The parameters. - The instance. - - - - The context in which the activation occurred. - - - - - The component providing the instance. - - - - - The paramters provided when resolved. - - - - - The instance that will be used to satisfy the request. - - - - - Fired after the construction of an instance but before that instance - is shared with any other or any members are invoked on it. - - - - - Initializes a new instance of the class. - - The context. - The component. - The parameters. - The instance. - - - - The instance can be replaced if needed, e.g. by an interface proxy. - - The object to use instead of the activated instance. - - - - The context in which the activation occurred. - - - - - The component providing the instance. - - - - - The instance that will be used to satisfy the request. - - - The instance can be replaced if needed, e.g. by an interface proxy. - - - - - The parameters supplied to the activator. - - - - - Activate instances using a delegate. - - - - - Base class for instance activators. - - - - - Create an instance activator that will return instances compatible - with . - - Most derived type to which instances can be cast. - - - - Gets a string representation of the activator. - - A string describing the activator. - - - - The most specific type that the component instances are known to be castable to. - - - - - Activates component instances. - - - - - Activate an instance in the provided context. - - Context in which to activate instances. - Parameters to the instance. - The activated instance. - - The context parameter here should probably be ILifetimeScope in order to reveal Disposer, - but will wait until implementing a concrete use case to make the decision - - - - - The most specific type that the component instances are known to be castable to. - - - - - Create a delegate activator. - - The most specific type to which activated instances can be cast. - Activation delegate. - - - - Activate an instance in the provided context. - - Context in which to activate instances. - Parameters to the instance. - The activated instance. - - The context parameter here should probably be ILifetimeScope in order to reveal Disposer, - but will wait until implementing a concrete use case to make the decision - - - - - Provides a pre-constructed instance. - - - - - Provide the specified instance. - - The instance to provide. - - - - Activate an instance in the provided context. - - Context in which to activate instances. - Parameters to the instance. - The activated instance. - - The context parameter here should probably be ILifetimeScope in order to reveal Disposer, - but will wait until implementing a concrete use case to make the decision - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Determines whether the activator disposes the instance that it holds. - Necessary because otherwise instances that are never resolved will never be - disposed. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The provided instance has already been used in an activation request. Did you combine a provided instance with non-root/single-instance lifetime/sharing?. - - - - - Supplies values based on the target parameter type. - - - - - Returns true if the parameter is able to provide a value to a particular site. - - Constructor, method, or property-mutator parameter. - The component context in which the value is being provided. - If the result is true, the valueProvider parameter will - be set to a function that will lazily retrieve the parameter value. If the result is false, - will be set to null. - True if a value can be supplied; otherwise, false. - - Thrown if or is . - - - - - Binds a constructor to the parameters that will be used when it is invoked. - - - - - Construct a new ConstructorParameterBinding. - - ConstructorInfo to bind. - Available parameters. - Context in which to construct instance. - - - - Invoke the constructor with the parameter bindings. - - The constructed instance. - - - Returns a System.String that represents the current System.Object. - A System.String that represents the current System.Object. - - - - The constructor on the target type. The actual constructor used - might differ, e.g. if using a dynamic proxy. - - - - - True if the binding is valid. - - - - - Describes the constructor parameter binding. - - - - - Selects the best constructor from a set of available constructors. - - - - - Selects the best constructor from the available constructors. - - Available constructors. - The best constructor. - - - - Selects a constructor based on its signature. - - - - - Match constructors with the provided signature. - - Signature to match. - - - - Selects the best constructor from the available constructors. - - Available constructors. - The best constructor. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to At least one binding must be provided in order to select a constructor.. - - - - - Looks up a localized string similar to The required constructor on type '{0}' with signature '{1}' is unavailable.. - - - - - Looks up a localized string similar to More than one constructor matches the signature '{0}'.. - - - - - Selects the constructor with the most parameters. - - - - - Selects the best constructor from the available constructors. - - Available constructors. - The best constructor. - A single unambiguous match could not be chosen. - - - - Uses reflection to activate instances of a type. - - - - - Create an activator for the provided type. - - Type to activate. - Constructor finder. - Constructor selector. - Parameters configured explicitly for this instance. - Properties configured explicitly for this instance. - - - - Activate an instance in the provided context. - - Context in which to activate instances. - Parameters to the instance. - The activated instance. - - The context parameter here should probably be ILifetimeScope in order to reveal Disposer, - but will wait until implementing a concrete use case to make the decision - - - - - The constructor finder. - - - - - The constructor selector. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to No constructors on type '{0}' can be found with the constructor finder '{1}'.. - - - - - Looks up a localized string similar to None of the constructors found with '{0}' on type '{1}' can be invoked with the available services and parameters:{2}. - - - - - Base class for parameters that provide a constant value. - - - - - Create a constant parameter that will apply to parameters matching - the supplied predicate. - - - - - - - Returns true if the parameter is able to provide a value to a particular site. - - Constructor, method, or property-mutator parameter. - The component context in which the value is being provided. - If the result is true, the valueProvider parameter will - be set to a function that will lazily retrieve the parameter value. If the result is false, - will be set to null. - True if a value can be supplied; otherwise, false. - - - - The value of the parameter. - - - - - Standard container implementation. - - - - - Creates, wires dependencies and manages lifetime for a set of components. - Most instances of are created - by a . - - - - // See ContainerBuilder for the definition of the builder variable - using (var container = builder.Build()) - { - var program = container.Resolve<Program>(); - program.Run(); - } - - - - Most functionality is provided by extension methods - on the inherited interface. - - - - - - - - - An tracks the instantiation of component instances. - It defines a boundary in which instances are shared and configured. - Disposing an will dispose the components that were - resolved through it. - - - - // See IContainer for definition of the container variable - using (var requestScope = container.BeginLifetimeScope()) - { - // Note that handler is resolved from requestScope, not - // from the container: - - var handler = requestScope.Resolve<IRequestHandler>(); - handler.Handle(request); - - // When requestScope is disposed, all resources used in processing - // the request will be released. - } - - - - All long-running applications should resolve components via an - . Choosing the duration of the lifetime is application- - specific. The standard Autofac WCF and ASP.NET/MVC integrations are already configured - to create and release s as appropriate. For example, the - ASP.NET integration will create and release an per HTTP - request. - Most functionality is provided by extension methods - on the inherited interface. - - - - - - - - - - - The context in which a service can be accessed or a component's - dependencies resolved. Disposal of a context will dispose any owned - components. - - - - - Resolve an instance of the provided registration within the context. - - The registration. - Parameters for the instance. - - The component instance. - - - - - - - Associates services with the components that provide them. - - - - - Begin a new nested scope. Component instances created via the new scope - will be disposed along with it. - - A new lifetime scope. - - - - Begin a new nested scope. Component instances created via the new scope - will be disposed along with it. - - The tag applied to the . - A new lifetime scope. - - - - Begin a new nested scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - - The components registered in the sub-scope will be treated as though they were - registered in the root scope, i.e., SingleInstance() components will live as long - as the root scope. - - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - - - Begin a new nested scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - - The components registered in the sub-scope will be treated as though they were - registered in the root scope, i.e., SingleInstance() components will live as long - as the root scope. - - The tag applied to the . - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - - - The disposer associated with this . - Component instances can be associated with it manually if required. - - Typical usage does not require interaction with this member- it - is used when extending the container. - - - - The tag applied to the . - - Tags allow a level in the lifetime hierarchy to be identified. - In most applications, tags are not necessary. - - - - - Fired when a new scope based on the current scope is beginning. - - - - - Fired when this scope is ending. - - - - - Fired when a resolve operation is beginning in this scope. - - - - - Create a new container. - - - - - Begin a new sub-scope. Instances created via the sub-scope - will be disposed along with it. - - A new lifetime scope. - - - - Begin a new sub-scope. Instances created via the sub-scope - will be disposed along with it. - - The tag applied to the . - A new lifetime scope. - - - - Begin a new nested scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - - - Begin a new nested scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - The tag applied to the . - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - - - Resolve an instance of the provided registration within the context. - - The registration. - Parameters for the instance. - - The component instance. - - - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Gets the service object of the specified type. - - An object that specifies the type of service object - to get. - - A service object of type .-or- null if there is - no service object of type . - - - - - The disposer associated with this container. Instances can be associated - with it manually if required. - - - - - Tag applied to the lifetime scope. - - The tag applied to this scope and the contexts generated when - it resolves component dependencies. - - - - Fired when a new scope based on the current scope is beginning. - - - - - Fired when this scope is ending. - - - - - Fired when a resolve operation is beginning in this scope. - - - - - Associates services with the components that provide them. - - - - - Base exception type thrown whenever the dependency resolution process fails. This is a fatal - exception, as Autofac is unable to 'roll back' changes to components that may have already - been made during the operation. For example, 'on activated' handlers may have already been - fired, or 'single instance' components partially constructed. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner exception. - - - - Gets a message that describes the current exception. - - - The error message that explains the reason for the exception, or an empty string(""). - - - - - Maintains a set of objects to dispose, and disposes them in the reverse order - from which they were added when the Disposer is itself disposed. - - - - - Provided on an object that will dispose of other objects when it is - itself disposed. - - - - - Adds an object to the disposer. When the disposer is - disposed, so will the object be. - - The instance. - - - - Contents all implement IDisposable. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Adds an object to the disposer. When the disposer is - disposed, so will the object be. - - The instance. - - - - Locates the lifetime to which instances of a component should be attached. - - - - - Given the most nested scope visible within the resolve operation, find - the scope for the component. - - The most nested visible scope. - The scope for the component. - - - - Represents a set of components and related functionality - packaged together. - - - - - Apply the module to the component registry. - - Component registry to apply configuration to. - - - - Determines when instances supporting IDisposable are disposed. - - - - - The lifetime scope does not dispose the instances. - - - - - The instances are disposed when the lifetime scope is disposed. - - - - - Determines whether instances are shared within a lifetime scope. - - - - - Each request for an instance will return a new object. - - - - - Each request for an instance will return the same object. - - - - - Defines a nested structure of lifetimes. - - - - - Try to retrieve an instance based on a GUID key. If the instance - does not exist, invoke to create it. - - Key to look up. - Creation function. - An instance. - - - - The root of the sharing hierarchy. - - - - - The parent of this node of the hierarchy, or null. - - - - - Attaches the instance's lifetime to the current lifetime scope. - - - - - Given the most nested scope visible within the resolve operation, find - the scope for the component. - - The most nested visible scope. - The scope for the component. - - - - Lifetime scope implementation. - - - - - Protects shared instances from concurrent access. Other members and the base class are threadsafe. - - - - - The tag applied to root scopes when no other tag is specified. - - - - - Create a lifetime scope for the provided components and nested beneath a parent. - - The tag applied to the . - Components used in the scope. - Parent scope. - - - - Create a root lifetime scope for the provided components. - - The tag applied to the . - Components used in the scope. - - - - Create a root lifetime scope for the provided components. - - Components used in the scope. - - - - Begin a new anonymous sub-scope. Instances created via the sub-scope - will be disposed along with it. - - A new lifetime scope. - - - - Begin a new tagged sub-scope. Instances created via the sub-scope - will be disposed along with it. - - The tag applied to the . - A new lifetime scope. - - - - Begin a new anonymous sub-scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - IContainer cr = // ... - using (var lifetime = cr.BeginLifetimeScope(builder => { - builder.RegisterType<Foo>(); - builder.RegisterType<Bar>().As<IBar>(); }) - { - var foo = lifetime.Resolve<Foo>(); - } - - - - - Begin a new tagged sub-scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - The tag applied to the . - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - IContainer cr = // ... - using (var lifetime = cr.BeginLifetimeScope("unitOfWork", builder => { - builder.RegisterType<Foo>(); - builder.RegisterType<Bar>().As<IBar>(); }) - { - var foo = lifetime.Resolve<Foo>(); - } - - - - - Resolve an instance of the provided registration within the context. - - The registration. - Parameters for the instance. - - The component instance. - - - - - - - Try to retrieve an instance based on a GUID key. If the instance - does not exist, invoke to create it. - - Key to look up. - Creation function. - An instance. - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Gets the service object of the specified type. - - An object that specifies the type of service object - to get. - - A service object of type .-or- null if there is - no service object of type . - - - - - The parent of this node of the hierarchy, or null. - - - - - The root of the sharing hierarchy. - - - - - The disposer associated with this container. Instances can be associated - with it manually if required. - - - - - Tag applied to the lifetime scope. - - The tag applied to this scope and the contexts generated when - it resolves component dependencies. - - - - Associates services with the components that provide them. - - - - - Fired when a new scope based on the current scope is beginning. - - - - - Fired when this scope is ending. - - - - - Fired when a resolve operation is beginning in this scope. - - - - - Attaches the component's lifetime to scopes matching a supplied expression. - - - - - Match scopes by comparing tags for equality. - - The tags applied to matching scopes. - - - - Given the most nested scope visible within the resolve operation, find - the scope for the component. - - The most nested visible scope. - The scope for the component. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to No scope with a Tag matching '{0}' is visible from the scope in which the instance was requested. This generally indicates that a component registered as per-HTTP request is being requested by a SingleInstance() component (or a similar scenario.) Under the web integration always request dependencies from the DependencyResolver.Current or ILifetimeScopeProvider.RequestLifetime, never from the container itself.. - - - - - Attaches the component's lifetime to the root scope. - - - - - Given the most nested scope visible within the resolve operation, find - the scope for the component. - - The most nested visible scope. - The scope for the component. - - - - A property identified by name. When applied to a reflection-based - component, the name will be matched against property names. - - - - - Create a with the specified constant value. - - The name of the property. - The property value. - - - - The name of the property. - - - - - Fired before the activation process to allow parameters to be changed or an alternative - instance to be provided. - - - - - Initializes a new instance of the class. - - The context. - The component. - The parameters. - - - - The context in which the activation is occurring. - - - - - The component providing the instance being activated. - - - - - The parameters supplied to the activator. - - - - - A service was requested that cannot be provided by the container. To avoid this exception, either register a component - to provide the required service, check for service registration using IsRegistered(), or use the ResolveOptional() - method to resolve an optional dependency. - - This exception is fatal. See for more information. - - - - Initializes a new instance of the class. - - The service. - - - - Initializes a new instance of the class. - - The service. - The inner exception. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The requested service '{0}' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.. - - - - - Information about the ocurrence of a component being registered - with a container. - - - - - Create a new instance with a valid container and component registration. - - The container into which the registration - was made. - The component registration. - - - - The container into which the registration was made. - - - - - The component registration. - - - - - Describes a logical component within the container. - - - - - Create a new component registration. - - Unique identifier for the component. - Activator used to activate instances. - Determines how the component will be associated with its lifetime. - Whether the component is shared within its lifetime scope. - Whether the component instances are disposed at the end of their lifetimes. - Services the component provides. - Data associated with the component. - - - - Create a new component registration. - - Unique identifier for the component. - Activator used to activate instances. - Determines how the component will be associated with its lifetime. - Whether the component is shared within its lifetime scope. - Whether the component instances are disposed at the end of their lifetimes. - Services the component provides. - Data associated with the component. - The component registration upon which this registration is based. - - - - Called by the container when an instance is required. - - The context in which the instance will be activated. - Parameters for activation. - - - - Called by the container once an instance has been constructed. - - The context in which the instance was activated. - The parameters supplied to the activator. - The instance. - - - - Called by the container once an instance has been fully constructed, including - any requested objects that depend on the instance. - - The context in which the instance was activated. - The parameters supplied to the activator. - The instance. - - - - Describes the component in a human-readable form. - - A description of the component. - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - The component registration upon which this registration is based. - If this registration was created directly by the user, returns this. - - - - - A unique identifier for this component (shared in all sub-contexts.) - This value also appears in Services. - - - - - The activator used to create instances. - - - - - The lifetime associated with the component. - - - - - Whether the component instances are shared or not. - - - - - Whether the instances of the component should be disposed by the container. - - - - - The services provided by the component. - - - - - Additional data associated with the component. - - - - - Fired when a new instance is required. The instance can be - provided in order to skip the regular activator, by setting the Instance property in - the provided event arguments. - - - - - Fired when a new instance is being activated. The instance can be - wrapped or switched at this time by setting the Instance property in - the provided event arguments. - - - - - Fired when the activation process for a new instance is complete. - - - - - Catch circular dependencies that are triggered by post-resolve processing (e.g. 'OnActivated') - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Circular component dependency detected: {0}.. - - - - - Looks up a localized string similar to Probable circular dependency between factory-scoped components. Chain includes '{0}'. - - - - - An is a component context that sequences and monitors the multiple - activations that go into producing a single requested object graph. - - - - - Get or create and share an instance of in the . - - The scope in the hierarchy in which the operation will begin. - The component to resolve. - Parameters for the component. - The component instance. - - - - Raised when the entire operation is complete. - - - - - Raised when an instance is looked up within the operation. - - - - - A is a component context that sequences and monitors the multiple - activations that go into producing a single requested object graph. - - - - - Create an instance of in the provided scope. - - The most nested scope in which to begin the operation. The operation - can move upward to less nested scopes as components with wider sharing scopes are activated - - - - Resolve an instance of the provided registration within the context. - - The registration. - Parameters for the instance. - - The component instance. - - - - - - - Execute the complete resolve operation. - - - - - Continue building the object graph by instantiating in the - current . - - The current scope of the operation. - The component to activate. - The parameters for the component. - The resolved instance. - - - - - Associates services with the components that provide them. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to An exception was thrown while executing a resolve operation. See the InnerException for details.. - - - - - Looks up a localized string similar to Probable circular dependency between factory-scoped components. Chain includes '{0}'. - - - - - Looks up a localized string similar to This resolve operation has already ended. When registering components using lambdas, the IComponentContext 'c' parameter to the lambda cannot be stored. Instead, either resolve IComponentContext again from 'c', or resolve a Func<> based factory to create subsequent components from.. - - - - - Identifies a service according to a type to which it can be assigned. - - - - - Initializes a new instance of the class. - - Type of the service. - - - - Indicates whether the current object is equal to another object of the same type. - - An object to compare with this object. - - true if the current object is equal to the parameter; otherwise, false. - - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - The parameter is null. - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Return a new service of the same kind, but carrying - as the . - - The new service type. - A new service with the service type. - - - - Gets the type of the service. - - The type of the service. - - - - Gets a human-readable description of the service. - - The description. - - - - A handy unique service identifier type - all instances will be regarded as unequal. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The id. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - The parameter is null. - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Provides a programmer-readable description of the identifying feature of the service. - - - - - - Registration source providing implicit collection/list/enumerable support. - - - - This registration source provides enumerable support to allow resolving - the set of all registered services of a given type. - - - What may not be immediately apparent is that it also means any time there - are no items of a particular type registered, it will always return an - empty set rather than or throwing an exception. - This is by design. - - - Consider the [possibly majority] use case where you're resolving a set - of message handlers or event handlers from the container. If there aren't - any handlers, you want an empty set - not or - an exception. It's valid to have no handlers registered. - - - This implicit support means other areas (like MVC support or manual - property injection) must take care to only request enumerable values they - expect to get something back for. In other words, "Don't ask the container - for something you don't expect to resolve." - - - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - - - Generates activators for open generic types. - - - - - Represents a dependency that can be released by the dependent component. - - The service provided by the dependency. - - - Autofac automatically provides instances of whenever the - service is registered. - - - It is not necessary for , or the underlying component, to implement . - Disposing of the object is the correct way to handle cleanup of the dependency, - as this will dispose of any other components created indirectly as well. - - - When is resolved, a new is created for the - underlying , and tagged with the service matching , - generally a . This means that shared instances can be tied to this - scope by registering them as InstancePerMatchingLifetimeScope(new TypedService(typeof(T))). - - - - The component D below is disposable and implements IService: - - public class D : IService, IDisposable - { - // ... - } - - The dependent component C can dispose of the D instance whenever required by taking a dependency on - : - - public class C - { - IService _service; - - public C(Owned<IService> service) - { - _service = service; - } - - void DoWork() - { - _service.Value.DoSomething(); - } - - void OnFinished() - { - _service.Dispose(); - } - } - - In general, rather than depending on directly, components will depend on - System.Func<Owned<T>> in order to create and dispose of other components as required. - - - - - Create an instance of . - - The value representing the instance. - An IDisposable interface through which ownership can be released. - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - The owned value. - - - - - Generates registrations for services of type whenever the service - T is available. - - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - - - When implemented by a component, an instance of the component will be resolved - and started as soon as the container is built. Autofac will not call the Start() - method when subsequent instances are resolved. If this behavior is required, use - an OnActivated() event handler instead. - - - For equivalent "Stop" functionality, implement . Autofac - will always dispose a component before any of its dependencies (except in the presence - of circular dependencies, in which case the components in the cycle are disposed in - reverse-construction order.) - - - - - Perform once-off startup processing. - - - - - Base class for user-defined modules. Modules can add a set of releated components - to a container () or attach cross-cutting functionality - to other components (. - Modules are given special support in the XML configuration feature - see - http://code.google.com/p/autofac/wiki/StructuringWithModules. - - Provides a user-friendly way to implement - via . - - Defining a module: - - public class DataAccessModule : Module - { - public string ConnectionString { get; set; } - - public override void Load(ContainerBuilder moduleBuilder) - { - moduleBuilder.RegisterGeneric(typeof(MyRepository<>)) - .As(typeof(IRepository<>)) - .InstancePerMatchingLifetimeScope(WebLifetime.Request); - - moduleBuilder.Register(c => new MyDbConnection(ConnectionString)) - .As<IDbConnection>() - .InstancePerMatchingLifetimeScope(WebLifetime.Request); - } - } - - Using the module: - - var builder = new ContainerBuilder(); - builder.RegisterModule(new DataAccessModule { ConnectionString = "..." }); - var container = builder.Build(); - var customers = container.Resolve<IRepository<Customer>>(); - - - - - - Apply the module to the component registry. - - Component registry to apply configuration to. - - - - Override to add registrations to the container. - - - Note that the ContainerBuilder parameter is unique to this module. - - The builder through which components can be - registered. - - - - Override to attach module-specific functionality to a - component registration. - - This method will be called for all existing and future component - registrations - ordering is not important. - The component registry. - The registration to attach functionality to. - - - - Override to perform module-specific processing on a registration source. - - This method will be called for all existing and future sources - - ordering is not important. - The component registry into which the source was added. - The registration source. - - - - The assembly in which the concrete module type is located. To avoid bugs whereby deriving from a module will - change the target assembly, this property can only be used by modules that inherit directly from - . - - - - - Configure the component so that instances are never disposed by the container. - - A registration builder allowing further configuration of the component. - - - - Configure the component so that instances that support IDisposable are - disposed by the container (default.) - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - gets a new, unique instance (default.) - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - gets the same, shared instance. - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a single ILifetimeScope gets the same, shared instance. Dependent components in - different lifetime scopes will get different instances. - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() within - a ILifetimeScope tagged with any of the provided tags value gets the same, shared instance. - Dependent components in lifetime scopes that are children of the tagged scope will - share the parent's instance. If no appropriately tagged scope can be found in the - hierarchy an is thrown. - - Tag applied to matching lifetime scopes. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - The service type provided by the component. - Key to associate with the component. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - Key to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. The generic parameter(s) to As() - will be exposed as TypedService instances. - - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. The generic parameter(s) to As() - will be exposed as TypedService instances. - - Service type. - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. The generic parameter(s) to As() - will be exposed as TypedService instances. - - Service type. - Service type. - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. - - Service types to expose. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. - - Services to expose. - A registration builder allowing further configuration of the component. - - - - Provide a textual name that can be used to retrieve the component. - - Named service to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Provide a textual name that can be used to retrieve the component. - - Named service to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Provide a key that can be used to retrieve the component. - - Key to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Provide a key that can be used to retrieve the component. - - Key to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Add a handler for the Preparing event. This event allows manipulating of the parameters - that will be provided to the component. - - The event handler. - A registration builder allowing further configuration of the component. - - - - Add a handler for the Activating event. - - The event handler. - A registration builder allowing further configuration of the component. - - - - Add a handler for the Activated event. - - The event handler. - A registration builder allowing further configuration of the component. - - - - Configure the component so that any properties whose types are registered in the - container will be wired to instances of the appropriate service. - - Set wiring options such as circular dependency wiring support. - A registration builder allowing further configuration of the component. - - - - Associates data with the component. - - Key by which the data can be located. - The data value. - A registration builder allowing further configuration of the component. - - - - Associates data with the component. - - The extended properties to associate with the component. - A registration builder allowing further configuration of the component. - - - - Associates data with the component. - - A type with properties whose names correspond to the - property names to configure. - A registration builder allowing further configuration of the component. - - - - The activator data. - - - - - The registration style. - - - - - The registration data. - - - - - Data common to all registrations made in the container, both direct (IComponentRegistration) - and dynamic (IRegistrationSource.) - - - - - Construct a RegistrationData instance. - - The default service that will be used if no others - are added. - - - - Add multiple services for the registration, overriding the default. - - The services to add. - If an empty collection is specified, this will still - clear the default service. - - - - Add a service to the registration, overriding the default. - - The service to add. - - - - Copies the contents of another RegistrationData object into this one. - - The data to copy. - When true, the default service - will be changed to that of the other. - - Thrown if is . - - - - - Empties the configured services. - - - - - The services explicitly assigned to the component. - - - - - The instance ownership assigned to the component. - - - - - The lifetime assigned to the component. - - - - - The sharing mode assigned to the component. - - - - - Extended properties assigned to the component. - - - - - Handlers for the Preparing event. - - - - - Handlers for the Activating event. - - - - - Handlers for the Activated event. - - - - - Adds registration syntax to the type. - - - - - Add a component to the container. - - The builder to register the component with. - The component to add. - - - - Add a registration source to the container. - - The builder to register the registration source via. - The registration source to add. - - - - Register an instance as a component. - - The type of the instance. - Container builder. - The instance to register. - Registration builder allowing the registration to be configured. - If no services are explicitly specified for the instance, the - static type will be used as the default service (i.e. *not* instance.GetType()). - - - - Register a component to be created through reflection. - - The type of the component implementation. - Container builder. - Registration builder allowing the registration to be configured. - - - - Register a component to be created through reflection. - - The type of the component implementation. - Container builder. - Registration builder allowing the registration to be configured. - - - - Register a delegate as a component. - - The type of the instance. - Container builder. - The delegate to register. - Registration builder allowing the registration to be configured. - - - - Register a delegate as a component. - - The type of the instance. - Container builder. - The delegate to register. - Registration builder allowing the registration to be configured. - - - - Register an un-parameterised generic type, e.g. Repository<>. - Concrete types will be made as they are requested, e.g. with Resolve<Repository<int>>(). - - Container builder. - The open generic implementation type. - Registration builder allowing the registration to be configured. - - - - Specifies that the component being registered should only be made the default for services - that have not already been registered. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Specifies that the components being registered should only be made the default for services - that have not already been registered. - - Registration limit type. - Registration style. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Register the types in an assembly. - - Container builder. - The assemblies from which to register types. - Registration builder allowing the registration to be configured. - - - - Register the types in a list. - - Container builder. - The types to register. - Registration builder allowing the registration to be configured. - - - - Specifies a subset of types to register from a scanned assembly. - - Registration limit type. - Registration style. - Activator data type. - Registration to filter types from. - Predicate that returns true for types to register. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a service. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Function mapping types to services. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a service. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Function mapping types to services. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a service. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Function mapping types to services. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a service. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Function mapping types to services. - Registration builder allowing the registration to be configured. - - - - Specifies that a type from a scanned assembly provides its own concrete type as a service. - - Registration limit type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Specifies that a type provides its own concrete type as a service. - - Registration limit type. - Activator data type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Specifies that a type provides its own concrete type as a service. - - Registration limit type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Specify how a type from a scanned assembly provides metadata. - - Registration limit type. - Registration style. - Activator data type. - Registration to set metadata on. - A function mapping the type to a list of metadata items. - Registration builder allowing the registration to be configured. - - - - Use the properties of an attribute (or interface implemented by an attribute) on the scanned type - to provide metadata values. - - Inherited attributes are supported; however, there must be at most one matching attribute - in the inheritance chain. - The attribute applied to the scanned type. - Registration to set metadata on. - Registration builder allowing the registration to be configured. - - - - Specify how a type from a scanned assembly provides metadata. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Key of the metadata item. - A function retrieving the value of the item from the component type. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a named service. - - Registration to set service mapping on. - Service type provided by the component. - Function mapping types to service names. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a named service. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Service type provided by the component. - Function mapping types to service names. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a keyed service. - - Registration to set service mapping on. - Service type provided by the component. - Function mapping types to service keys. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a keyed service. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Service type provided by the component. - Function mapping types to service keys. - Registration builder allowing the registration to be configured. - - - - Specifies that a type from a scanned assembly is registered as providing all of its - implemented interfaces. - - Registration limit type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Specifies that a type is registered as providing all of its implemented interfaces. - - Registration limit type. - Activator data type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Specifies that a type is registered as providing all of its implemented interfaces. - - Registration limit type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Set the policy used to find candidate constructors on the implementation type. - - Registration limit type. - Activator data type. - Registration style. - Registration to set policy on. - Policy to be used when searching for constructors. - A registration builder allowing further configuration of the component. - - - - Set the policy used to find candidate constructors on the implementation type. - - Registration limit type. - Activator data type. - Registration style. - Registration to set policy on. - A function that returns the constructors to select from. - A registration builder allowing further configuration of the component. - - - - Set the policy used to select from available constructors on the implementation type. - - Registration limit type. - Activator data type. - Registration style. - Registration to set policy on. - Constructor signature to match. - A registration builder allowing further configuration of the component. - - - - Set the policy used to select from available constructors on the implementation type. - - Registration limit type. - Registration style. - Activator data type. - Registration to set policy on. - Policy to be used when selecting a constructor. - A registration builder allowing further configuration of the component. - - - - Set the policy used to select from available constructors on the implementation type. - - Registration limit type. - Activator data type. - Registration style. - Registration to set policy on. - Expression demonstrating how the constructor is called. - A registration builder allowing further configuration of the component. - - - - Configure an explicit value for a constructor parameter. - - Registration limit type. - Registration style. - Activator data type. - Registration to set parameter on. - Name of a constructor parameter on the target type. - Value to supply to the parameter. - A registration builder allowing further configuration of the component. - - - - Configure an explicit value for a constructor parameter. - - Registration limit type. - Registration style. - Activator data type. - Registration to set parameter on. - The parameter to supply to the constructor. - A registration builder allowing further configuration of the component. - - - - Configure an explicit value for a constructor parameter. - - Registration limit type. - Registration style. - Activator data type. - Registration to set parameter on. - A predicate selecting the parameter to set. - - A registration builder allowing further configuration of the component. - - - - Configure explicit values for constructor parameters. - - Registration limit type. - Registration style. - Activator data type. - Registration to set parameter on. - The parameters to supply to the constructor. - A registration builder allowing further configuration of the component. - - - - Configure an explicit value for a property. - - Registration limit type. - Registration style. - Activator data type. - Registration to set property on. - Name of a property on the target type. - Value to supply to the property. - A registration builder allowing further configuration of the component. - - - - Configure an explicit value for a property. - - Registration limit type. - Registration style. - Activator data type. - Registration to set parameter on. - The property to supply. - A registration builder allowing further configuration of the component. - - - - Configure explicit values for properties. - - Registration limit type. - Registration style. - Activator data type. - Registration to set parameter on. - The properties to supply. - A registration builder allowing further configuration of the component. - - - - Sets the target of the registration (used for metadata generation.) - - The type of the limit. - The type of the activator data. - Registration style - Registration to set target for. - The target. - - Registration builder allowing the registration to be configured. - - - Thrown if or is . - - - - - Provide a handler to be called when the component is registered. - - Registration limit type. - Registration style. - Activator data type. - Registration add handler to. - The handler. - Registration builder allowing the registration to be configured. - - - - Provide a handler to be called when the component is registred. - - Registration limit type. - Registration style. - Registration add handler to. - The handler. - Registration builder allowing the registration to be configured. - - - - Specifies that a type from a scanned assembly is registered if it implements an interface - that closes the provided open generic interface type. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - The open generic interface or base class type for which implementations will be found. - Registration builder allowing the registration to be configured. - - - - Filters the scanned types to include only those assignable to the provided - type. - - Registration limit type. - Registration style. - Activator data type. - Registration to filter types from. - The type or interface which all classes must be assignable from. - Registration builder allowing the registration to be configured. - - - - Filters the scanned types to include only those assignable to the provided - type. - - Registration to filter types from. - The type or interface which all classes must be assignable from. - Registration builder allowing the registration to be configured. - - - - Filters the scanned types to exclude the provided type. - - Registration to filter types from. - The concrete type to exclude. - Registration builder allowing the registration to be configured. - - - - Filters the scanned types to exclude the provided type, providing specific configuration for - the excluded type. - - Registration to filter types from. - Registration for the excepted type. - The concrete type to exclude. - Registration builder allowing the registration to be configured. - - - - Filters the scanned types to include only those in the namespace of the provided type - or one of its sub-namespaces. - - Registration to filter types from. - A type in the target namespace. - Registration builder allowing the registration to be configured. - - - - Filters the scanned types to include only those in the provided namespace - or one of its sub-namespaces. - - Registration limit type. - Registration style. - Activator data type. - Registration to filter types from. - The namespace from which types will be selected. - Registration builder allowing the registration to be configured. - - - - Adapt all components implementing service - to provide using the provided - function. - - Service type to adapt from. - Service type to adapt to. Must not be the - same as . - Container builder. - Function adapting to - service , given the context and parameters. - - - - Adapt all components implementing service - to provide using the provided - function. - - Service type to adapt from. - Service type to adapt to. Must not be the - same as . - Container builder. - Function adapting to - service , given the context. - - - - Adapt all components implementing service - to provide using the provided - function. - - Service type to adapt from. - Service type to adapt to. Must not be the - same as . - Container builder. - Function adapting to - service . - - - - Decorate all components implementing open generic service . - The and parameters must be different values. - - Container builder. - Service type being decorated. Must be an open generic type. - Service key or name associated with the components being decorated. - Service key or name given to the decorated components. - The type of the decorator. Must be an open generic type, and accept a parameter - of type , which will be set to the instance being decorated. - - - - Decorate all components implementing service - using the provided function. - The and parameters must be different values. - - Service type being decorated. - Container builder. - Function decorating a component instance that provides - , given the context and parameters. - Service key or name associated with the components being decorated. - Service key or name given to the decorated components. - - - - Decorate all components implementing service - using the provided function. - The and parameters must be different values. - - Service type being decorated. - Container builder. - Function decorating a component instance that provides - , given the context. - Service key or name associated with the components being decorated. - Service key or name given to the decorated components. - - - - Decorate all components implementing service - using the provided function. - The and parameters must be different values. - - Service type being decorated. - Container builder. - Function decorating a component instance that provides - . - Service key or name associated with the components being decorated. - Service key or name given to the decorated components. - - - - Run a supplied action instead of disposing instances when they're no - longer required. - - Registration limit type. - Activator data type. - Registration style. - Registration to set release action for. - An action to perform instead of disposing the instance. - Registration builder allowing the registration to be configured. - Only one release action can be configured per registration. - - - - Wraps a registration in an implicit and automatically - activates the registration after the container is built. - - Registration to set release action for. - Registration limit type. - Activator data type. - Registration style. - A registration builder allowing further configuration of the component. - - - While you can implement an to perform some logic at - container build time, sometimes you need to just activate a registered component and - that's it. This extension allows you to automatically activate a registration on - container build. No additional logic is executed and the resolved instance is not held - so container disposal will end up disposing of the instance. - - - Depending on how you register the lifetime of the component, you may get an exception - when you build the container - components that are scoped to specific lifetimes (like - ASP.NET components scoped to a request lifetime) will fail to resolve because the - appropriate lifetime is not available. - - - - - - Share one instance of the component within the context of a single - web/HTTP/API request. Only available for integration that supports - per-request dependencies (e.g., MVC, Web API, web forms, etc.). - - Registration limit type. - Registration style. - Activator data type. - The registration to configure. - Additional tags applied for matching lifetime scopes. - A registration builder allowing further configuration of the component. - - Thrown if is . - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The instance registration '{0}' can support SingleInstance() sharing only.. - - - - - Looks up a localized string similar to A metadata attribute of type {0} was not found on {1}.. - - - - - Looks up a localized string similar to More than one metadata attribute of type {0} was found on {1}.. - - - - - Looks up a localized string similar to No matching constructor exists on type '{0}'.. - - - - - An activator builder with no parameters. - - - - - Return the provided activator. - - The activator to return. - - - - Gets the activator. - - - - - Registration style for individual components. - - - - - The id used for the registration. - - - - - Handlers to notify of the component registration event. - - - - - By default, new registrations override existing registrations as defaults. - If set to true, new registrations will not change existing defaults. - - - - - The component upon which this registration is based. - - - - - Used to build an from component registrations. - - - - var builder = new ContainerBuilder(); - - builder.RegisterType<Logger>() - .As<ILogger>() - .SingleInstance(); - - builder.Register(c => new MessageHandler(c.Resolve<ILogger>())); - - var container = builder.Build(); - // resolve components from container... - - - Most functionality is accessed - via extension methods in . - - - - - - Register a callback that will be invoked when the container is configured. - - This is primarily for extending the builder syntax. - Callback to execute. - - - - Create a new container with the component registrations that have been made. - - Options that influence the way the container is initialised. - - Build can only be called once per - - this prevents ownership issues for provided instances. - Build enables support for the relationship types that come with Autofac (e.g. - Func, Owned, Meta, Lazy, IEnumerable.) To exclude support for these types, - first create the container, then call Update() on the builder. - - A new container with the configured component registrations. - - - - Configure an existing container with the component registrations - that have been made. - - - Update can only be called once per - - this prevents ownership issues for provided instances. - - An existing container to make the registrations in. - - - - Configure an existing container with the component registrations - that have been made and allows additional build options to be specified. - - - Update can only be called once per - - this prevents ownership issues for provided instances. - - An existing container to make the registrations in. - Options that influence the way the container is updated. - - - - Configure an existing registry with the component registrations - that have been made. - - - Update can only be called once per - - this prevents ownership issues for provided instances. - - An existing registry to make the registrations in. - - - - A parameter identified by name. When applied to a reflection-based - component, will be matched against - the name of the component's constructor arguments. When applied to - a delegate-based component, the parameter can be accessed using - . - - - Component with parameter: - - public class MyComponent - { - public MyComponent(int amount) { ... } - } - - Providing the parameter: - - var builder = new ContainerBuilder(); - builder.RegisterType<MyComponent>(); - var container = builder.Build(); - var myComponent = container.Resolve<MyComponent>(new NamedParameter("amount", 123)); - - - - - - Create a with the specified constant value. - - The name of the parameter. - The parameter value. - - - - The name of the parameter. - - - - - Extension methods that simplify extraction of parameter values from - an where T is . - Each method returns the first matching parameter value, or throws an exception if - none is provided. - - - At configuration time, delegate registrations can retrieve parameter values using - the methods , and : - - builder.Register((c, p) => new FtpClient(p.Named<string>("server"))); - - These parameters can be provided at resolution time: - - container.Resolve<FtpClient>(new NamedParameter("server", "ftp.example.com")); - - Alternatively, the parameters can be provided via a Generated Factory - http://code.google.com/p/autofac/wiki/DelegateFactories. - - - - - Retrieve a named parameter value from a instance. - - The type to which the returned value will be cast. - The available parameters to choose from. - The name of the parameter to select. - The value of the selected parameter. - - - - - Retrieve a positional parameter value from a instance. - - The type to which the returned value will be cast. - The available parameters to choose from. - The zero-based position of the parameter to select. - The value of the selected parameter. - The position value is the one associated with the parameter when - it was constructed, not its index into the - sequence. - - - - - Retrieve a typed parameter value from a instance. - - The type to which the returned value will be cast. - The available parameters to choose from. - The value of the selected parameter. - - - - - A parameter that is identified according to an integer representing its - position in an argument list. When applied to a reflection-based - component, will be matched against - the indices of the component's constructor arguments. When applied to - a delegate-based component, the parameter can be accessed using - . - - - Component with parameter: - - public class MyComponent - { - public MyComponent(int amount) { ... } - } - - Providing the parameter: - - var builder = new ContainerBuilder(); - builder.RegisterType<MyComponent>(); - var container = builder.Build(); - var myComponent = container.Resolve<MyComponent>(new PositionalParameter(0, 123)); - - - - - - Construct a positional parameter with the specified constant value. - - The zero-based position of the parameter. - The parameter value. - - - - The zero-based position of the parameter. - - - - - Adds syntactic convenience methods to the interface. - - - - - Set any properties on that can be - resolved in the context. - - Type of instance. Used only to provide method chaining. - The context from which to resolve the service. - The instance to inject properties into. - . - - - - Set any null-valued properties on that can be - resolved by the container. - - Type of instance. Used only to provide method chaining. - The context from which to resolve the service. - The instance to inject properties into. - . - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Name of the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Name of the service. - The parameters. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Name of the service. - The parameters. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Key of the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Key of the service. - The parameters. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Key of the service. - The parameters. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The service to retrieve. - The context from which to resolve the service. - The component instance that provides the service. - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Parameters for the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Parameters for the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - The service type. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Parameters for the service. - The service type. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Parameters for the service. - The service type. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - The service name. - Type of the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Parameters for the service. - The service name. - Type of the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Parameters for the service. - The service name. - Type of the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Key of the service. - Type of the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Key of the service. - Type of the service. - The parameters. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Key of the service. - Type of the service. - The parameters. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - The service to resolve. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Parameters for the service. - The service to resolve. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Parameters for the service. - The service to resolve. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The name of the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The name of the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The name of the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The name of the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The name of the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The key of the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The type of the service. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The type of the service. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The type of the service. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The service. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The service. - Parameters for the service. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The service. - Parameters for the service. - - The component instance that provides the service, or null. - - - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The service to test for the registration of. - True if the service is registered. - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The service to test for the registration of. - True if the service is registered. - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The name of the service to test for the registration of. - Type type of the service to test for the registration of. - True if the service is registered. - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The name of the service to test for the registration of. - Type type of the service to test for the registration of. - True if the service is registered. - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The key of the service to test for the registration of. - Type type of the service to test for the registration of. - True if the service is registered. - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The key of the service to test for the registration of. - Type type of the service to test for the registration of. - True if the service is registered. - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The service to test for the registration of. - True if the service is registered. - - - - Try to retrieve a service from the context. - - The context from which to resolve the service. - The service to resolve. - The resulting component instance providing the service, or null. - The parameters. - - True if a component providing the service is available. - - - - Thrown if is . - - - - - Try to retrieve a service from the context. - - The context from which to resolve the service. - The service to resolve. - The resulting component instance providing the service, or null. - - True if a component providing the service is available. - - - - - - Try to retrieve a service from the context. - - The context from which to resolve the service. - The service type to resolve. - The resulting component instance providing the service, or null. - - True if a component providing the service is available. - - - - - - Try to retrieve a service from the context. - - The service type to resolve. - The context from which to resolve the service. - The resulting component instance providing the service, or default(T). - - True if a component providing the service is available. - - - - - - Try to retrieve a service from the context. - - The context from which to resolve the service. - The name of the service to resolve. - The type of the service to resolve. - The resulting component instance providing the service, or null. - - True if a component providing the service is available. - - - - - - Try to retrieve a service from the context. - - The context from which to resolve the service. - The key of the service to resolve. - The type of the service to resolve. - The resulting component instance providing the service, or null. - - True if a component providing the service is available. - - - - - - Flexible parameter type allows arbitrary values to be retrieved - from the resolution context. - - - - - Create an instance of the ResolvedParameter class. - - A predicate that determines which parameters on a constructor will be supplied by this instance. - A function that supplies the parameter value given the context. - - - - Returns true if the parameter is able to provide a value to a particular site. - - Constructor, method, or property-mutator parameter. - The component context in which the value is being provided. - If the result is true, the valueProvider parameter will - be set to a function that will lazily retrieve the parameter value. If the result is false, - will be set to null. - True if a value can be supplied; otherwise, false. - - - - Construct a that will match parameters of type - and resolve for those parameters an implementation - registered with the name . - - The type of the parameter to match. - The name of the matching service to resolve. - A configured instance. - - - - - - Construct a that will match parameters of type - and resolve for those parameters an implementation - registered with the key . - - The type of the parameter to match. - The key of the matching service to resolve. - A configured instance. - - - - A parameter that can supply values to sites that exactly - match a specified type. When applied to a reflection-based - component, will be matched against - the types of the component's constructor arguments. When applied to - a delegate-based component, the parameter can be accessed using - . - - - Component with parameter: - - public class MyComponent - { - public MyComponent(int amount) { ... } - } - - Providing the parameter: - - var builder = new ContainerBuilder(); - builder.RegisterType<MyComponent>(); - var container = builder.Build(); - var myComponent = container.Resolve<MyComponent>(new TypedParameter(typeof(int), 123)); - - - - - - Create a typed parameter with the specified constant value. - - The exact type to match. - The parameter value. - - - - Shortcut for creating - by using the - - type to be used for the parameter - The parameter value. - new typed parameter - - - - The type against which targets are matched. - - - - - Extends with methods that are useful in - building scanning rules for . - - - - - Returns true if this type is in the namespace - or one of its sub-namespaces. - - The type to test. - The namespace to test. - True if this type is in the namespace - or one of its sub-namespaces; otherwise, false. - - - - Returns true if this type is in the same namespace as - or one of its sub-namespaces. - - The type to test. - True if this type is in the same namespace as - or one of its sub-namespaces; otherwise, false. - - - Determines whether the candidate type supports any base or - interface that closes the provided generic type. - - - - - - - Determines whether this type is assignable to . - - The type to test assignability to. - True if this type is assignable to references of type - ; otherwise, False. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The type '{0}' is not an open generic class or interface type.. - - - - - Extension methods for . - - - - - Safely returns the set of loadable types from an assembly. - - The from which to load types. - - The set of types from the , or the subset - of types that could be loaded if there was any error. - - - Thrown if is . - - - - - Helper methods used throughout the codebase. - - - - - Enforce that an argument is not null. Returns the - value if valid so that it can be used inline in - base initialiser syntax. - - - - - - - - - Enforce that sequence does not contain null. Returns the - value if valid so that it can be used inline in - base initialiser syntax. - - - The value. - The name. - - - - - Enforces that the provided object is non-null. - - - The value. - - - - - Enforce that an argument is not null or empty. Returns the - value if valid so that it can be used inline in - base initialiser syntax. - - The value. - The description. - - - - - Enforce that the argument is a delegate type. - - The type to test. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The argument '{0}' cannot be empty.. - - - - - Looks up a localized string similar to The object of type '{0}' cannot be null.. - - - - - Looks up a localized string similar to Type {0} returns void.. - - - - - Looks up a localized string similar to The sequence provided as argument '{0}' cannot contain null elements.. - - - - - Looks up a localized string similar to Type {0} is not a delegate type.. - - - - - Extension methods for reflection-related types. - - - - - Maps from a property-set-value parameter to the declaring property. - - Parameter to the property setter. - The property info on which the setter is specified. - True if the parameter is a property setter. - - - - Get a PropertyInfo object from an expression of the form - x => x.P. - - Type declaring the property. - The type of the property. - Expression mapping an instance of the - declaring type to the property value. - Property info. - - - - Get the MethodInfo for a method called in the - expression. - - Type on which the method is called. - Expression demonstrating how the method appears. - The method info for the called method. - - - - Gets the for the new operation called in the expression. - - The type on which the constructor is called. - Expression demonstrating how the constructor is called. - The for the called constructor. - - - - Retrieves a custom attribute of a specified type that is applied to a specified member, - and optionally inspects the ancestors of that member. - - The type of attribute to search for. - The member to inspect. - true to inspect the ancestors of element; otherwise, false. - A custom attribute that matches , or null if no such attribute is found. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The provided expression must be of the form () =>new X(), but the provided expression was {0}.. - - - - - Looks up a localized string similar to The provided expression must be of the form x =>x.M(), but the provided expression was {0}.. - - - - - Looks up a localized string similar to The provided expression must be of the form x =>x.P, but the provided expression was {0}.. - - - - - Adapts an action to the interface. - - - - - Joins the strings into one single string interspersing the elements with the separator (a-la - System.String.Join()). - - The elements. - The separator. - The joined string. - - - - Appends the item to the specified sequence. - - - The sequence. - The trailing item. - - - - - Prepends the item to the specified sequence. - - - The sequence. - The leading item. - - - - Returns the first concrete interface supported by the candidate type that - closes the provided open generic service type. - The type that is being checked for the interface. - The open generic type to locate. - The type of the interface. - - - - Looks for an interface on the candidate type that closes the provided open generic interface type. - - The type that is being checked for the interface. - The open generic service type to locate. - True if a closed implementation was found; otherwise false. - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - - - Signal attribute for static analysis that indicates a helper method is - validating arguments for . - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Unable to generate a function to return type '{0}' with input parameter types [{1}]. The input parameter type list has duplicate types. Try registering a custom delegate type instead of using a generic Func relationship.. - - - - - Looks up a localized string similar to Delegate Support (Func<T>and Custom Delegates). - - - - diff --git a/lib/autofac/Autofac.dll b/lib/autofac/Autofac.dll deleted file mode 100644 index e4a596a9751..00000000000 Binary files a/lib/autofac/Autofac.dll and /dev/null differ diff --git a/lib/autofac/License.txt b/lib/autofac/License.txt deleted file mode 100644 index 54ab1fbdbe5..00000000000 --- a/lib/autofac/License.txt +++ /dev/null @@ -1,27 +0,0 @@ -Autofac IoC Container -Copyright (c) 2007-2012 Autofac Contributors -http://code.google.com/p/autofac/wiki/Contributing - -Other software included in this distribution is owned and -licensed separately, see the included license files for details. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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 AND -NONINFRINGEMENT. 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. \ No newline at end of file diff --git a/lib/castle/net45/Castle.Core.dll b/lib/castle/net45/Castle.Core.dll deleted file mode 100644 index 07d9ab887ec..00000000000 Binary files a/lib/castle/net45/Castle.Core.dll and /dev/null differ diff --git a/lib/castle/net45/Castle.Core.xml b/lib/castle/net45/Castle.Core.xml deleted file mode 100644 index dae0055948a..00000000000 --- a/lib/castle/net45/Castle.Core.xml +++ /dev/null @@ -1,4774 +0,0 @@ - - - - Castle.Core - - - - - Specifies assignment by reference rather than by copying. - - - - - Suppresses any on-demand behaviors. - - - - - Removes a property if null or empty string, guid or collection. - - - - - Removes a property if matches value. - - - - - Assigns a specific dictionary key. - - - - - Defines the contract for customizing dictionary access. - - - - - Copies the dictionary behavior. - - null if should not be copied. Otherwise copy. - - - - Determines relative order to apply related behaviors. - - - - - Defines the contract for updating dictionary values. - - - - - Sets the stored dictionary value. - - The dictionary adapter. - The key. - The stored value. - The property. - true if the property should be stored. - - - - Contract for value matching. - - - - - Indicates that underlying values are changeable and should not be cached. - - - - - Contract for dictionary initialization. - - - - - Performs any initialization of the - - The dictionary adapter. - The dictionary behaviors. - - - - Abstract implementation of . - - - - - Conract for traversing a . - - - - - Contract for creating additional Dictionary adapters. - - - - - Contract for manipulating the Dictionary adapter. - - - - - Contract for editing the Dictionary adapter. - - - - - Contract for managing Dictionary adapter notifications. - - - - - Contract for validating Dictionary adapter. - - - - - Defines the contract for building s. - - - - - Builds the dictionary behaviors. - - - - - - Abstract adapter for the support - needed by the - - - - - Adds an element with the provided key and value to the object. - - The to use as the key of the element to add. - The to use as the value of the element to add. - An element with the same key already exists in the object. - key is null. - The is read-only.-or- The has a fixed size. - - - - Removes all elements from the object. - - The object is read-only. - - - - Determines whether the object contains an element with the specified key. - - The key to locate in the object. - - true if the contains an element with the key; otherwise, false. - - key is null. - - - - Returns an object for the object. - - - An object for the object. - - - - - Removes the element with the specified key from the object. - - The key of the element to remove. - The object is read-only.-or- The has a fixed size. - key is null. - - - - Copies the elements of the to an , starting at a particular index. - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - The type of the source cannot be cast automatically to the type of the destination array. - index is less than zero. - array is multidimensional.-or- index is equal to or greater than the length of array.-or- The number of elements in the source is greater than the available space from index to the end of the destination array. - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Gets a value indicating whether the object has a fixed size. - - - true if the object has a fixed size; otherwise, false. - - - - Gets a value indicating whether the object is read-only. - - - true if the object is read-only; otherwise, false. - - - - Gets an object containing the keys of the object. - - - An object containing the keys of the object. - - - - Gets an object containing the values in the object. - - - An object containing the values in the object. - - - - Gets or sets the with the specified key. - - - - - - Gets the number of elements contained in the . - - - The number of elements contained in the . - - - - Gets a value indicating whether access to the is synchronized (thread safe). - - - true if access to the is synchronized (thread safe); otherwise, false. - - - - Gets an object that can be used to synchronize access to the . - - - An object that can be used to synchronize access to the . - - - - Provides a generic collection that supports data binding. - - - This class wraps the CLR - in order to implement the Castle-specific . - - The type of elements in the list. - - - - Initializes a new instance of the class - using default values. - - - - - Initializes a new instance of the class - with the specified list. - - - An of items - to be contained in the . - - - - - Initializes a new instance of the class - wrapping the specified instance. - - - A - to be wrapped by the . - - - - - Defines the contract for retrieving dictionary values. - - - - - Gets the effective dictionary value. - - The dictionary adapter. - The key. - The stored value. - The property. - true if return only existing. - The effective property value. - - - - Initializes a new instance of the class - that represents a child object in a larger object graph. - - - - - - - Contract for dictionary meta-data initialization. - - - - - Initializes the given object. - - The dictionary adapter factory. - The dictionary adapter meta. - - - - - Determines whether the given behavior should be included in a new - object. - - A dictionary behavior or annotation. - True if the behavior should be included; otherwise, false. - - behaviors are always included, - regardless of the result of this method. - - - - - - Checks whether or not collection is null or empty. Assumes colleciton can be safely enumerated multiple times. - - - - - - - Creates a message to inform clients that a proxy couldn't be created due to reliance on an - inaccessible type (perhaps itself). - - the inaccessible type that prevents proxy creation - the type that couldn't be proxied - - - - Find the best available name to describe a type. - - - Usually the best name will be , but - sometimes that's null (see http://msdn.microsoft.com/en-us/library/system.type.fullname%28v=vs.110%29.aspx) - in which case the method falls back to . - - the type to name - the best name - - - - Constant to use when making assembly internals visible to Castle.Core - [assembly: InternalsVisibleTo(CoreInternalsVisible.ToCastleCore)] - - - - - Constant to use when making assembly internals visible to proxy types generated by DynamicProxy. Required when proxying internal types. - [assembly: InternalsVisibleTo(CoreInternalsVisible.ToDynamicProxyGenAssembly2)] - - - - - Identifies a property should be represented as a nested component. - - - - - Defines the contract for building typed dictionary keys. - - - - - Builds the specified key. - - The dictionary adapter. - The current key. - The property. - The updated key - - - - Applies no prefix. - - - - - Gets or sets the prefix. - - The prefix. - - - - Identifies the dictionary adapter types. - - - - - Identifies an interface or property to be pre-fetched. - - - - - Instructs fetching to occur. - - - - - Instructs fetching according to - - - - - - Gets whether or not fetching should occur. - - - - - Assigns a property to a group. - - - - - Constructs a group assignment. - - The group name. - - - - Constructs a group assignment. - - The group name. - - - - Gets the group the property is assigned to. - - - - - Assigns a specific dictionary key. - - - - - Initializes a new instance of the class. - - The key. - - - - Initializes a new instance of the class. - - The compound key. - - - - Assigns a prefix to the keyed properties of an interface. - - - Key prefixes are not inherited by sub-interfaces. - - - - - Initializes a default instance of the class. - - - - - Initializes a new instance of the class. - - The prefix for the keyed properties of the interface. - - - - Gets the prefix key added to the properties of the interface. - - - - - Substitutes part of key with another string. - - - - - Initializes a new instance of the class. - - The old value. - The new value. - - - - Requests support for multi-level editing. - - - - - Generates a new GUID on demand. - - - - - Support for on-demand value resolution. - - - - - Provides simple string formatting from existing properties. - - - - - Gets the string format. - - - - - Gets the format properties. - - - - - Identifies a property should be represented as a delimited string value. - - - - - Gets the separator. - - - - - Converts all properties to strings. - - - - - Gets or sets the format. - - The format. - - - - Suppress property change notifications. - - - - - Contract for property descriptor initialization. - - - - - Performs any initialization of the - - The property descriptor. - The property behaviors. - - - - Assigns a prefix to the keyed properties using the interface name. - - - - - Manages conversion between property values. - - - - - Initializes a new instance of the class. - - The converter. - - - - Gets the effective dictionary value. - - The dictionary adapter. - The key. - The stored value. - The property. - true if return only existing. - The effective property value. - - - - - - - - - Uses Reflection.Emit to expose the properties of a dictionary - through a dynamic implementation of a typed interface. - - - - - Defines the contract for building typed dictionary adapters. - - - - - Gets a typed adapter bound to the . - - The typed interface. - The underlying source of properties. - An implementation of the typed interface bound to the dictionary. - - The type represented by T must be an interface with properties. - - - - - Gets a typed adapter bound to the . - - The typed interface. - The underlying source of properties. - An implementation of the typed interface bound to the dictionary. - - The type represented by T must be an interface with properties. - - - - - Gets a typed adapter bound to the . - - The typed interface. - The underlying source of properties. - The property descriptor. - An implementation of the typed interface bound to the dictionary. - - The type represented by T must be an interface with properties. - - - - - Gets a typed adapter bound to the . - - The typed interface. - The underlying source of properties. - An implementation of the typed interface bound to the namedValues. - - The type represented by T must be an interface with properties. - - - - - Gets a typed adapter bound to the . - - The typed interface. - The underlying source of properties. - An implementation of the typed interface bound to the namedValues. - - The type represented by T must be an interface with properties. - - - - - Gets a typed adapter bound to the . - - The typed interface. - The underlying source of properties. - An implementation of the typed interface bound to the . - - The type represented by T must be an interface with properties. - - - - - Gets a typed adapter bound to the . - - The typed interface. - The underlying source of properties. - An implementation of the typed interface bound to the . - - The type represented by T must be an interface with properties. - - - - - Gets the associated with the type. - - The typed interface. - The adapter meta-data. - - - - Gets the associated with the type. - - The typed interface. - The property descriptor. - The adapter meta-data. - - - - Gets the associated with the type. - - The typed interface. - Another from which to copy behaviors. - The adapter meta-data. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Contract for dictionary validation. - - - - - Determines if is valid. - - The dictionary adapter. - true if valid. - - - - Validates the . - - The dictionary adapter. - The error summary information. - - - - Validates the for a property. - - The dictionary adapter. - The property to validate. - The property summary information. - - - - Invalidates any results cached by the validator. - - The dictionary adapter. - - - - - - - - - Initializes a new instance of the class. - - The name values. - - - - Determines whether the object contains an element with the specified key. - - The key to locate in the object. - - true if the contains an element with the key; otherwise, false. - - key is null. - - - - Adapts the specified name values. - - The name values. - - - - - Gets a value indicating whether the object is read-only. - - - true if the object is read-only; otherwise, false. - - - - Gets or sets the with the specified key. - - - - - - Describes a dictionary property. - - - - - Initializes an empty class. - - - - - Initializes a new instance of the class. - - The property. - The annotations. - - - - Initializes a new instance class. - - - - - Copies an existinginstance of the class. - - - - - - - Gets the key. - - The dictionary adapter. - The key. - The descriptor. - - - - - Gets the property value. - - The dictionary adapter. - The key. - The stored value. - The descriptor. - true if return only existing. - - - - - Sets the property value. - - The dictionary adapter. - The key. - The value. - The descriptor. - - - - - Adds a single behavior. - - The behavior. - - - - Adds the behaviors. - - The behaviors. - - - - Adds the behaviors. - - The behaviors. - - - - Copies the behaviors to the other - - - - - - - Copies the - - - - - - - - - - - Gets the property name. - - - - - Gets the property type. - - - - - Gets the property. - - The property. - - - - Returns true if the property is dynamic. - - - - - Gets additional state. - - - - - Determines if property should be fetched. - - - - - Determines if property must exist first. - - - - - Determines if notifications should occur. - - - - - Gets the property behaviors. - - - - - Gets the type converter. - - The type converter. - - - - Gets the extended properties. - - - - - Gets the setter. - - The setter. - - - - Gets the key builders. - - The key builders. - - - - Gets the setter. - - The setter. - - - - Gets the getter. - - The getter. - - - - Gets the initializers. - - The initializers. - - - - Gets the meta-data initializers. - - The meta-data initializers. - - - - Helper class for retrieving attributes. - - - - - Gets the attribute. - - The member. - The member attribute. - - - - Gets the attributes. Does not consider inherited attributes! - - The member. - The member attributes. - - - - Gets the type attribute. - - The type. - The type attribute. - - - - Gets the type attributes. - - The type. - The type attributes. - - - - Gets the type converter. - - The member. - - - - - Gets the attribute. - - The member. - The member attribute. - - - - Contract for typed dynamic value resolution. - - - - - - Contract for dynamic value resolution. - - - - - Supporting Logger levels. - - - - - Logging will be off - - - - - Fatal logging level - - - - - Error logging level - - - - - Warn logging level - - - - - Info logging level - - - - - Debug logging level - - - - - Encapsulates an invocation of a proxied method. - - - - - Gets the value of the argument at the specified . - - The index. - The value of the argument at the specified . - - - - Returns the concrete instantiation of the on the proxy, with any generic - parameters bound to real types. - - - The concrete instantiation of the on the proxy, or the if - not a generic method. - - - Can be slower than calling . - - - - - Returns the concrete instantiation of , with any - generic parameters bound to real types. - For interface proxies, this will point to the on the target class. - - The concrete instantiation of , or - if not a generic method. - - In debug builds this can be slower than calling . - - - - - Proceeds the call to the next interceptor in line, and ultimately to the target method. - - - Since interface proxies without a target don't have the target implementation to proceed to, - it is important, that the last interceptor does not call this method, otherwise a - will be thrown. - - - - - Overrides the value of an argument at the given with the - new provided. - - - This method accepts an , however the value provided must be compatible - with the type of the argument defined on the method, otherwise an exception will be thrown. - - The index of the argument to override. - The new value for the argument. - - - - Gets the arguments that the has been invoked with. - - The arguments the method was invoked with. - - - - Gets the generic arguments of the method. - - The generic arguments, or null if not a generic method. - - - - Gets the object on which the invocation is performed. This is different from proxy object - because most of the time this will be the proxy target object. - - - The invocation target. - - - - Gets the representing the method being invoked on the proxy. - - The representing the method being invoked. - - - - For interface proxies, this will point to the on the target class. - - The method invocation target. - - - - Gets the proxy object on which the intercepted method is invoked. - - Proxy object on which the intercepted method is invoked. - - - - Gets or sets the return value of the method. - - The return value of the method. - - - - Gets the type of the target object for the intercepted method. - - The type of the target object. - - - - Used during the target type inspection process. Implementors have a chance to customize the - proxy generation process. - - - - - Invoked by the generation process to notify that the whole process has completed. - - - - - Invoked by the generation process to notify that a member was not marked as virtual. - - The type which declares the non-virtual member. - The non-virtual member. - - This method gives an opportunity to inspect any non-proxyable member of a type that has - been requested to be proxied, and if appropriate - throw an exception to notify the caller. - - - - - Invoked by the generation process to determine if the specified method should be proxied. - - The type which declares the given method. - The method to inspect. - True if the given method should be proxied; false otherwise. - - - - Interface describing elements composing generated type - - - - - Performs some basic screening and invokes the - to select methods. - - - - - - - - - Provides functionality for disassembling instances of attributes to CustomAttributeBuilder form, during the process of emiting new types by Dynamic Proxy. - - - - - Disassembles given attribute instance back to corresponding CustomAttributeBuilder. - - An instance of attribute to disassemble - corresponding 1 to 1 to given attribute instance, or null reference. - - Implementers should return that corresponds to given attribute instance 1 to 1, - that is after calling specified constructor with specified arguments, and setting specified properties and fields with values specified - we should be able to get an attribute instance identical to the one passed in . Implementer can return null - if it wishes to opt out of replicating the attribute. Notice however, that for some cases, like attributes passed explicitly by the user - it is illegal to return null, and doing so will result in exception. - - - - - Handles error during disassembly process - - Type of the attribute being disassembled - Exception thrown during the process - usually null, or (re)throws the exception - - - - Here we try to match a constructor argument to its value. - Since we can't get the values from the assembly, we use some heuristics to get it. - a/ we first try to match all the properties on the attributes by name (case insensitive) to the argument - b/ if we fail we try to match them by property type, with some smarts about convertions (i,e: can use Guid for string). - - - - - We have the following rules here. - Try to find a matching type, failing that, if the parameter is string, get the first property (under the assumption that - we can convert it. - - - - - Attributes can only accept simple types, so we return null for null, - if the value is passed as string we call to string (should help with converting), - otherwise, we use the value as is (enums, integer, etc). - - - - - Returns list of all unique interfaces implemented given types, including their base interfaces. - - - - - - - Applied to the assemblies saved by in order to persist the cache data included in the persisted assembly. - - - - - Base class that exposes the common functionalities - to proxy generation. - - - - - It is safe to add mapping (no mapping for the interface exists) - - - - - - - - Generates a parameters constructor that initializes the proxy - state with just to make it non-null. - - This constructor is important to allow proxies to be XML serializable - - - - - - Generates the constructor for the class that extends - - - - - - - - - Default implementation of interface producing in-memory proxy assemblies. - - - - - Abstracts the implementation of proxy type construction. - - - - - Creates a proxy type for given , implementing , using provided. - - The class type to proxy. - Additional interface types to proxy. - The proxy generation options. - The generated proxy type. - - Implementers should return a proxy type for the specified class and interfaces. - Additional interfaces should be only 'mark' interfaces, that is, they should work like interface proxy without target. (See method.) - - Thrown when or any of is a generic type definition. - Thrown when or any of is not public. - Note that to avoid this exception, you can mark offending type internal, and define - pointing to Castle Dynamic Proxy assembly, in assembly containing that type, if this is appropriate. - - - - - Creates a proxy type that proxies calls to members on , implementing , using provided. - - The interface type to proxy. - Additional interface types to proxy. - Type implementing on which calls to the interface members should be intercepted. - The proxy generation options. - The generated proxy type. - - Implementers should return a proxy type for the specified interface that 'proceeds' executions to the specified target. - Additional interfaces should be only 'mark' interfaces, that is, they should work like interface proxy without target. (See method.) - - Thrown when or any of is a generic type definition. - Thrown when or any of is not public. - Note that to avoid this exception, you can mark offending type internal, and define - pointing to Castle Dynamic Proxy assembly, in assembly containing that type, if this is appropriate. - - - - - Creates a proxy type for given and that delegates all calls to the provided interceptors and allows interceptors to switch the actual target of invocation. - - The interface type to proxy. - Additional interface types to proxy. - The proxy generation options. - The generated proxy type. - - Implementers should return a proxy type for the specified interface(s) that delegate all executions to the specified interceptors - and uses an instance of the interface as their targets (i.e. ), rather than a class. All classes should then implement interface, - to allow interceptors to switch invocation target with instance of another type implementing called interface. - - Thrown when or any of is a generic type definition. - Thrown when or any of is not public. - Note that to avoid this exception, you can mark offending type internal, and define - pointing to Castle Dynamic Proxy assembly, in assembly containing that type, if this is appropriate. - - - - - Creates a proxy type for given that delegates all calls to the provided interceptors. - - The interface type to proxy. - Additional interface types to proxy. - The proxy generation options. - The generated proxy type. - - Implementers should return a proxy type for the specified interface and additional interfaces that delegate all executions to the specified interceptors. - - Thrown when or any of is a generic type definition. - Thrown when or any of is not public. - Note that to avoid this exception, you can mark offending type internal, and define - pointing to Castle Dynamic Proxy assembly, in assembly containing that type, if this is appropriate. - - - - - Gets or sets the that this logs to. - - - - - Gets the associated with this builder. - - The module scope associated with this builder. - - - - Initializes a new instance of the class with new . - - - - - Initializes a new instance of the class. - - The module scope for generated proxy types. - - - - Registers custom disassembler to handle disassembly of specified type of attributes. - - Type of attributes to handle - Disassembler converting existing instances of Attributes to CustomAttributeBuilders - - When disassembling an attribute Dynamic Proxy will first check if an custom disassembler has been registered to handle attributes of that type, - and if none is found, it'll use the . - - - - - Attributes should be replicated if they are non-inheritable, - but there are some special cases where the attributes means - something to the CLR, where they should be skipped. - - - - - Initializes a new instance of the class. - - Target element. This is either target type or target method for invocation types. - The type of the proxy. This is base type for invocation types. - The interfaces. - The options. - - - - Initializes a new instance of the class. - - Type of the target. - The interfaces. - The options. - - - - s - Provides appropriate Ldc.X opcode for the type of primitive value to be loaded. - - - - - Provides appropriate Ldind.X opcode for - the type of primitive value to be loaded indirectly. - - - - - Emits a load indirect opcode of the appropriate type for a value or object reference. - Pops a pointer off the evaluation stack, dereferences it and loads - a value of the specified type. - - - - - - - Emits a load opcode of the appropriate kind for a constant string or - primitive value. - - - - - - - Emits a load opcode of the appropriate kind for the constant default value of a - type, such as 0 for value types and null for reference types. - - - - - Emits a store indirectopcode of the appropriate type for a value or object reference. - Pops a value of the specified type and a pointer off the evaluation stack, and - stores the value. - - - - - - - Summary description for PropertiesCollection. - - - - - Wraps a reference that is passed - ByRef and provides indirect load/store support. - - - - - Summary description for NewArrayExpression. - - - - - - - - - Provides appropriate Stind.X opcode - for the type of primitive value to be stored indirectly. - - - - - Initializes a new instance of the class. - - The name. - Type declaring the original event being overriten, or null. - - The add method. - The remove method. - The attributes. - - - - Represents the scope of uniquenes of names for types and their members - - - - - Gets a unique name based on - - Name suggested by the caller - Unique name based on . - - Implementers should provide name as closely resembling as possible. - Generally if no collision occurs it is suggested to return suggested name, otherwise append sequential suffix. - Implementers must return deterministic names, that is when is called twice - with the same suggested name, the same returned name should be provided each time. Non-deterministic return - values, like appending random suffices will break serialization of proxies. - - - - - Returns new, disposable naming scope. It is responsibilty of the caller to make sure that no naming collision - with enclosing scope, or other subscopes is possible. - - New naming scope. - - - - Returns the methods implemented by a type. Use this instead of Type.GetMethods() to work around a CLR issue - where duplicate MethodInfos are returned by Type.GetMethods() after a token of a generic type's method was loaded. - - - - - Determines whether the specified method is internal. - - The method. - - true if the specified method is internal; otherwise, false. - - - - - Determines whether this assembly has internals visible to dynamic proxy. - - The assembly to inspect. - - - - Checks if the method is public or protected. - - - - - - - Because we need to cache the types based on the mixed in mixins, we do the following here: - - Get all the mixin interfaces - - Sort them by full name - - Return them by position - - The idea is to have reproducible behavior for the case that mixins are registered in different orders. - This method is here because it is required - - - - - Summary description for ModuleScope. - - - - - The default file name used when the assembly is saved using . - - - - - The default assembly (simple) name used for the assemblies generated by a instance. - - - - - Initializes a new instance of the class; assemblies created by this instance will not be saved. - - - - - Initializes a new instance of the class, allowing to specify whether the assemblies generated by this instance - should be saved. - - If set to true saves the generated module. - - - - Initializes a new instance of the class, allowing to specify whether the assemblies generated by this instance - should be saved. - - If set to true saves the generated module. - If set to true disables ability to generate signed module. This should be used in cases where ran under constrained permissions. - - - - Initializes a new instance of the class, allowing to specify whether the assemblies generated by this instance - should be saved and what simple names are to be assigned to them. - - If set to true saves the generated module. - If set to true disables ability to generate signed module. This should be used in cases where ran under constrained permissions. - The simple name of the strong-named assembly generated by this . - The path and file name of the manifest module of the strong-named assembly generated by this . - The simple name of the weak-named assembly generated by this . - The path and file name of the manifest module of the weak-named assembly generated by this . - - - - Initializes a new instance of the class, allowing to specify whether the assemblies generated by this instance - should be saved and what simple names are to be assigned to them. - - If set to true saves the generated module. - If set to true disables ability to generate signed module. This should be used in cases where ran under constrained permissions. - Naming scope used to provide unique names to generated types and their members (usually via sub-scopes). - The simple name of the strong-named assembly generated by this . - The path and file name of the manifest module of the strong-named assembly generated by this . - The simple name of the weak-named assembly generated by this . - The path and file name of the manifest module of the weak-named assembly generated by this . - - - - Returns a type from this scope's type cache, or null if the key cannot be found. - - The key to be looked up in the cache. - The type from this scope's type cache matching the key, or null if the key cannot be found - - - - Registers a type in this scope's type cache. - - The key to be associated with the type. - The type to be stored in the cache. - - - - Gets the key pair used to sign the strong-named assembly generated by this . - - - - - - Gets the specified module generated by this scope, creating a new one if none has yet been generated. - - If set to true, a strong-named module is returned; otherwise, a weak-named module is returned. - A strong-named or weak-named module generated by this scope, as specified by the parameter. - - - - Gets the strong-named module generated by this scope, creating a new one if none has yet been generated. - - A strong-named module generated by this scope. - - - - Gets the weak-named module generated by this scope, creating a new one if none has yet been generated. - - A weak-named module generated by this scope. - - - - Saves the generated assembly with the name and directory information given when this instance was created (or with - the and current directory if none was given). - - - - This method stores the generated assembly in the directory passed as part of the module information specified when this instance was - constructed (if any, else the current directory is used). If both a strong-named and a weak-named assembly - have been generated, it will throw an exception; in this case, use the overload. - - - If this was created without indicating that the assembly should be saved, this method does nothing. - - - Both a strong-named and a weak-named assembly have been generated. - The path of the generated assembly file, or null if no file has been generated. - - - - Saves the specified generated assembly with the name and directory information given when this instance was created - (or with the and current directory if none was given). - - True if the generated assembly with a strong name should be saved (see ); - false if the generated assembly without a strong name should be saved (see . - - - This method stores the specified generated assembly in the directory passed as part of the module information specified when this instance was - constructed (if any, else the current directory is used). - - - If this was created without indicating that the assembly should be saved, this method does nothing. - - - No assembly has been generated that matches the parameter. - - The path of the generated assembly file, or null if no file has been generated. - - - - Loads the generated types from the given assembly into this 's cache. - - The assembly to load types from. This assembly must have been saved via or - , or it must have the manually applied. - - This method can be used to load previously generated and persisted proxy types from disk into this scope's type cache, eg. in order - to avoid the performance hit associated with proxy generation. - - - - - Users of this should use this lock when accessing the cache. - - - - - Gets the strong-named module generated by this scope, or if none has yet been generated. - - The strong-named module generated by this scope, or if none has yet been generated. - - - - Gets the file name of the strongly named module generated by this scope. - - The file name of the strongly named module generated by this scope. - - - - Gets the directory where the strongly named module generated by this scope will be saved, or if the current directory - is used. - - The directory where the strongly named module generated by this scope will be saved when is called - (if this scope was created to save modules). - - - - Gets the weak-named module generated by this scope, or if none has yet been generated. - - The weak-named module generated by this scope, or if none has yet been generated. - - - - Gets the file name of the weakly named module generated by this scope. - - The file name of the weakly named module generated by this scope. - - - - Gets the directory where the weakly named module generated by this scope will be saved, or if the current directory - is used. - - The directory where the weakly named module generated by this scope will be saved when is called - (if this scope was created to save modules). - - - - ProxyBuilder that persists the generated type. - - - The saved assembly contains just the last generated type. - - - - - Initializes a new instance of the class. - - - - - Saves the generated assembly to a physical file. Note that this renders the unusable. - - The path of the generated assembly file, or null if no assembly has been generated. - - This method does not support saving multiple files. If both a signed and an unsigned module have been generated, use the - respective methods of the . - - - - - Initializes a new instance of the class. - - The hook. - - - - Initializes a new instance of the class. - - - - - Provides proxy objects for classes and interfaces. - - - - - Initializes a new instance of the class. - - Proxy types builder. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - If true forces all types to be generated into an unsigned module. - - - - Creates proxy object intercepting calls to members of interface on object with given . - - Type of the interface implemented by which will be proxied. - The target object, calls to which will be intercepted. - The interceptors called during the invocation of proxied methods. - Object proxying calls to members of on object. - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is not an interface type. - Thrown when no default constructor exists on actual type of object. - Thrown when default constructor of actual type of throws an exception. - - This method generates new proxy type for each type of , which affects performance. If you don't want to proxy types differently depending on the type of the target - use method. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on object with given . - - Type of the interface implemented by which will be proxied. - The target object, calls to which will be intercepted. - The proxy generation options used to influence generated proxy type and object. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of on object. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is not an interface type. - Thrown when no default constructor exists on actual type of object. - Thrown when default constructor of actual type of throws an exception. - - This method generates new proxy type for each type of , which affects performance. If you don't want to proxy types differently depending on the type of the target - use method. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on object with given . - - Type of the interface implemented by which will be proxied. - The target object, calls to which will be intercepted. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of type on object. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not an interface type. - Thrown when given does not implement interface. - Thrown when no default constructor exists on actual type of object. - Thrown when default constructor of actual type of throws an exception. - - This method generates new proxy type for each type of , which affects performance. If you don't want to proxy types differently depending on the type of the target - use method. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on object with given . - - Type of the interface implemented by which will be proxied. - The target object, calls to which will be intercepted. - The proxy generation options used to influence generated proxy type and object. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of type on object. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not an interface type. - Thrown when given does not implement interface. - Thrown when no default constructor exists on actual type of object. - Thrown when default constructor of actual type of throws an exception. - - This method generates new proxy type for each type of , which affects performance. If you don't want to proxy types differently depending on the type of the target - use method. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on object with given . - - Type of the interface implemented by which will be proxied. - The target object, calls to which will be intercepted. - Additional interface types. Calls to their members will be proxied as well. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of and types on object. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given or any of is a generic type definition. - Thrown when given is not an interface type. - Thrown when given does not implement interface. - Thrown when no default constructor exists on actual type of object. - Thrown when default constructor of actual type of throws an exception. - - This method generates new proxy type for each type of , which affects performance. If you don't want to proxy types differently depending on the type of the target - use method. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on object with given . - - Type of the interface implemented by which will be proxied. - The target object, calls to which will be intercepted. - The proxy generation options used to influence generated proxy type and object. - Additional interface types. Calls to their members will be proxied as well. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of and types on object. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given or any of is a generic type definition. - Thrown when given is not an interface type. - Thrown when given does not implement interface. - Thrown when no default constructor exists on actual type of object. - Thrown when default constructor of actual type of throws an exception. - - This method generates new proxy type for each type of , which affects performance. If you don't want to proxy types differently depending on the type of the target - use method. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on object with given . - Interceptors can use interface to provide other target for method invocation than default . - - Type of the interface implemented by which will be proxied. - The target object, calls to which will be intercepted. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of type on object or alternative implementation swapped at runtime by an interceptor. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not an interface type. - Thrown when given does not implement interface. - Thrown when no default constructor exists on actual type of object. - Thrown when default constructor of actual type of throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on object with given . - Interceptors can use interface to provide other target for method invocation than default . - - Type of the interface implemented by which will be proxied. - The target object, calls to which will be intercepted. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of type on object or alternative implementation swapped at runtime by an interceptor. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is not an interface type. - Thrown when no default constructor exists on actual type of object. - Thrown when default constructor of actual type of throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on object with given . - Interceptors can use interface to provide other target for method invocation than default . - - Type of the interface implemented by which will be proxied. - The target object, calls to which will be intercepted. - The proxy generation options used to influence generated proxy type and object. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of type on object or alternative implementation swapped at runtime by an interceptor. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is not an interface type. - Thrown when no default constructor exists on actual type of object. - Thrown when default constructor of actual type of throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on object with given . - Interceptors can use interface to provide other target for method invocation than default . - - Type of the interface implemented by which will be proxied. - The target object, calls to which will be intercepted. - Additional interface types. Calls to their members will be proxied as well. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of and types on object or alternative implementation swapped at runtime by an interceptor. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given or any of is a generic type definition. - Thrown when given is not an interface type. - Thrown when given does not implement interface. - Thrown when no default constructor exists on actual type of object. - Thrown when default constructor of actual type of throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on object with given . - Interceptors can use interface to provide other target for method invocation than default . - - Type of the interface implemented by which will be proxied. - The target object, calls to which will be intercepted. - The proxy generation options used to influence generated proxy type and object. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of type on object or alternative implementation swapped at runtime by an interceptor. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not an interface type. - Thrown when given does not implement interface. - Thrown when no default constructor exists on actual type of object. - Thrown when default constructor of actual type of throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on object with given . - Interceptors can use interface to provide other target for method invocation than default . - - Type of the interface implemented by which will be proxied. - The target object, calls to which will be intercepted. - The proxy generation options used to influence generated proxy type and object. - Additional interface types. Calls to their members will be proxied as well. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of and types on object or alternative implementation swapped at runtime by an interceptor. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given or any of is a generic type definition. - Thrown when given is not an interface type. - Thrown when given does not implement interface. - Thrown when no default constructor exists on actual type of object. - Thrown when default constructor of actual type of throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on target object generated at runtime with given . - - Type of the interface which will be proxied. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of types on generated target object. - - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is not an interface type. - - Since this method uses an empty-shell implementation of interfaces to proxy generated at runtime, the actual implementation of proxied methods must be provided by given implementations. - They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call , since there's no actual implementation to proceed with. - As a result of that also at least one implementation must be provided. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on target object generated at runtime with given . - - Type of the interface which will be proxied. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of types on generated target object. - - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is not an interface type. - - Since this method uses an empty-shell implementation of interfaces to proxy generated at runtime, the actual implementation of proxied methods must be provided by given implementations. - They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call , since there's no actual implementation to proceed with. - As a result of that also at least one implementation must be provided. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on target object generated at runtime with given . - - Type of the interface which will be proxied. - The proxy generation options used to influence generated proxy type and object. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of types on generated target object. - - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is not an interface type. - - Since this method uses an empty-shell implementation of interfaces to proxy generated at runtime, the actual implementation of proxied methods must be provided by given implementations. - They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call , since there's no actual implementation to proceed with. - As a result of that also at least one implementation must be provided. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on target object generated at runtime with given . - - Type of the interface which will be proxied. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of type on generated target object. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not an interface type. - - Since this method uses an empty-shell implementation of interfaces to proxy generated at runtime, the actual implementation of proxied methods must be provided by given implementations. - They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call , since there's no actual implementation to proceed with. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on target object generated at runtime with given . - - Type of the interface which will be proxied. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of type on generated target object. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not an interface type. - - Since this method uses an empty-shell implementation of interfaces to proxy generated at runtime, the actual implementation of proxied methods must be provided by given implementations. - They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call , since there's no actual implementation to proceed with. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on target object generated at runtime with given . - - Type of the interface which will be proxied. - Additional interface types. Calls to their members will be proxied as well. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of and types on generated target object. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given or any of is a generic type definition. - Thrown when given is not an interface type. - - Since this method uses an empty-shell implementation of interfaces to proxy generated at runtime, the actual implementation of proxied methods must be provided by given implementations. - They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call , since there's no actual implementation to proceed with. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on target object generated at runtime with given . - - Type of the interface which will be proxied. - The proxy generation options used to influence generated proxy type and object. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of on generated target object. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not an interface type. - - They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call , since there's no actual implementation to proceed with. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to members of interface on target object generated at runtime with given . - - Type of the interface which will be proxied. - The proxy generation options used to influence generated proxy type and object. - Additional interface types. Calls to their members will be proxied as well. - The interceptors called during the invocation of proxied methods. - - Object proxying calls to members of and types on generated target object. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given array is a null reference (Nothing in Visual Basic). - Thrown when given or any of is a generic type definition. - Thrown when given is not an interface type. - - Since this method uses an empty-shell implementation of to proxy generated at runtime, the actual implementation of proxied methods must be provided by given implementations. - They are responsible for setting return value (and out parameters) on proxied methods. It is also illegal for an interceptor to call , since there's no actual implementation to proceed with. - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - The target object, calls to which will be intercepted. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of type. - - Thrown when given is not a class type. - Thrown when no default constructor exists on type . - Thrown when default constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - The target object, calls to which will be intercepted. - The proxy generation options used to influence generated proxy type and object. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of type. - - Thrown when given is not a class type. - Thrown when no default constructor exists on type . - Thrown when default constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - Additional interface types. Calls to their members will be proxied as well. - The target object, calls to which will be intercepted. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of and types. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given or any of is a generic type definition. - Thrown when given is not a class type. - Thrown when no default constructor exists on type . - Thrown when default constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - The target object, calls to which will be intercepted. - The proxy generation options used to influence generated proxy type and object. - Arguments of constructor of type which should be used to create a new instance of that type. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of type. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not a class type. - Thrown when no constructor exists on type with parameters matching . - Thrown when constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - The target object, calls to which will be intercepted. - Arguments of constructor of type which should be used to create a new instance of that type. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of type. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not a class type. - Thrown when no constructor exists on type with parameters matching . - Thrown when constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - The target object, calls to which will be intercepted. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of type. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not a class type. - Thrown when no parameterless constructor exists on type . - Thrown when constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - The target object, calls to which will be intercepted. - The proxy generation options used to influence generated proxy type and object. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of type. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not a class type. - Thrown when no default constructor exists on type . - Thrown when default constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - Additional interface types. Calls to their members will be proxied as well. - The target object, calls to which will be intercepted. - The proxy generation options used to influence generated proxy type and object. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of and types. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given or any of is a generic type definition. - Thrown when given is not a class type. - Thrown when no default constructor exists on type . - Thrown when default constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - Additional interface types. Calls to their members will be proxied as well. - The target object, calls to which will be intercepted. - The proxy generation options used to influence generated proxy type and object. - Arguments of constructor of type which should be used to create a new instance of that type. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of and types. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given or any of is a generic type definition. - Thrown when given is not a class type. - Thrown when no constructor exists on type with parameters matching . - Thrown when constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of type. - - Thrown when given is not a class type. - Thrown when no default constructor exists on type . - Thrown when default constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - The proxy generation options used to influence generated proxy type and object. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of type. - - Thrown when given is not a class type. - Thrown when no default constructor exists on type . - Thrown when default constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - Additional interface types. Calls to their members will be proxied as well. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of and types. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given or any of is a generic type definition. - Thrown when given is not a class type. - Thrown when no default constructor exists on type . - Thrown when default constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - The proxy generation options used to influence generated proxy type and object. - Arguments of constructor of type which should be used to create a new instance of that type. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of type. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not a class type. - Thrown when no constructor exists on type with parameters matching . - Thrown when constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - Arguments of constructor of type which should be used to create a new instance of that type. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of type. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not a class type. - Thrown when no constructor exists on type with parameters matching . - Thrown when constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of type. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not a class type. - Thrown when no parameterless constructor exists on type . - Thrown when constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - The proxy generation options used to influence generated proxy type and object. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of type. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given is a generic type definition. - Thrown when given is not a class type. - Thrown when no default constructor exists on type . - Thrown when default constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - Additional interface types. Calls to their members will be proxied as well. - The proxy generation options used to influence generated proxy type and object. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of and types. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given or any of is a generic type definition. - Thrown when given is not a class type. - Thrown when no default constructor exists on type . - Thrown when default constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates proxy object intercepting calls to virtual members of type on newly created instance of that type with given . - - Type of class which will be proxied. - Additional interface types. Calls to their members will be proxied as well. - The proxy generation options used to influence generated proxy type and object. - Arguments of constructor of type which should be used to create a new instance of that type. - The interceptors called during the invocation of proxied methods. - - New object of type proxying calls to virtual members of and types. - - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given object is a null reference (Nothing in Visual Basic). - Thrown when given or any of is a generic type definition. - Thrown when given is not a class type. - Thrown when no constructor exists on type with parameters matching . - Thrown when constructor of type throws an exception. - - This method uses implementation to generate a proxy type. - As such caller should expect any type of exception that given implementation may throw. - - - - - Creates the proxy type for class proxy with given class, implementing given and using provided . - - The base class for proxy type. - The interfaces that proxy type should implement. - The options for proxy generation process. - of proxy. - - - - Creates the proxy type for interface proxy with target for given interface, implementing given on given and using provided . - - The interface proxy type should implement. - The additional interfaces proxy type should implement. - Actual type that the proxy type will encompass. - The options for proxy generation process. - of proxy. - - - - Creates the proxy type for interface proxy with target interface for given interface, implementing given on given and using provided . - - The interface proxy type should implement. - The additional interfaces proxy type should implement. - The options for proxy generation process. - of proxy. - - - - Creates the proxy type for interface proxy without target for given interface, implementing given and using provided . - - The interface proxy type should implement. - The additional interfaces proxy type should implement. - The options for proxy generation process. - of proxy. - - - - Gets or sets the that this log to. - - - - - Gets the proxy builder instance used to generate proxy types. - - The proxy builder. - - - - - - - - - - - - - For interface proxies, this will point to the - on the target class - - - - - Handles the deserialization of proxies. - - - - - Resets the used for deserialization to a new scope. - - - This is useful for test cases. - - - - - Resets the used for deserialization to a given . - - The scope to be used for deserialization. - - By default, the deserialization process uses a different scope than the rest of the application, which can lead to multiple proxies - being generated for the same type. By explicitly setting the deserialization scope to the application's scope, this can be avoided. - - - - - Gets the used for deserialization. - - As has no way of automatically determining the scope used by the application (and the application might use more than one scope at the same time), uses a dedicated scope instance for deserializing proxy types. This instance can be reset and set to a specific value via and . - - - - Holds objects representing methods of class. - - - - - Holds objects representing methods of class. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides an extension point that allows proxies to choose specific interceptors on - a per method basis. - - - - - Selects the interceptors that should intercept calls to the given . - - The type declaring the method to intercept. - The method that will be intercepted. - All interceptors registered with the proxy. - An array of interceptors to invoke upon calling the . - - This method is called only once per proxy instance, upon the first call to the - . Either an empty array or null are valid return values to indicate - that no interceptor should intercept calls to the method. Although it is not advised, it is - legal to return other implementations than these provided in - . - - - - - Creates a new lock. - - - - - - This interface should be implemented by classes - that are available in a bigger context, exposing - the container to different areas in the same application. - - For example, in Web application, the (global) HttpApplication - subclasses should implement this interface to expose - the configured container - - - - - - Exposes means to change target objects of proxies and invocations - - - - - Changes the target object () of current . - - The new value of target of invocation. - - Although the method takes the actual instance must be of type assignable to , otherwise an will be thrown. - Also while it's technically legal to pass null reference (Nothing in Visual Basic) as , for obvious reasons Dynamic Proxy will not be able to call the intercepted method on such target. - In this case last interceptor in the pipeline mustn't call or a will be throws. - Also while it's technically legal to pass proxy itself as , this would create stack overflow. - In this case last interceptor in the pipeline mustn't call or a will be throws. - - Thrown when is not assignable to the proxied type. - - - - Permanently changes the target object of the proxy. This does not affect target of the current invocation. - - The new value of target of the proxy. - - Although the method takes the actual instance must be of type assignable to proxy's target type, otherwise an will be thrown. - Also while it's technically legal to pass null reference (Nothing in Visual Basic) as , for obvious reasons Dynamic Proxy will not be able to call the intercepted method on such target. - In this case last interceptor in the pipeline mustn't call or a will be throws. - Also while it's technically legal to pass proxy itself as , this would create stack overflow. - In this case last interceptor in the pipeline mustn't call or a will be throws. - - Thrown when is not assignable to the proxied type. - - - - New interface that is going to be used by DynamicProxy 2 - - - - - Get the proxy target (note that null is a valid target!) - - - - - - Gets the interceptors for the proxy - - - - - - Defines that the implementation wants a - in order to - access other components. The creator must be aware - that the component might (or might not) implement - the interface. - - - Used by Castle Project components to, for example, - gather logging factories - - - - - Increments IServiceProvider with a generic service resolution operation. - - - - - Provides a factory that can produce either or - classes. - - - - - Manages the instantiation of s. - - - - - Creates a new logger, getting the logger name from the specified type. - - - - - Creates a new logger. - - - - - Creates a new logger, getting the logger name from the specified type. - - - - - Creates a new logger. - - - - - Creates a new extended logger, getting the logger name from the specified type. - - - - - Creates a new extended logger. - - - - - Creates a new extended logger, getting the logger name from the specified type. - - - - - Creates a new extended logger. - - - - - Creates a new extended logger, getting the logger name from the specified type. - - - - - Creates a new extended logger. - - - - - Creates a new extended logger, getting the logger name from the specified type. - - - - - Creates a new extended logger. - - - - - Creates a new logger, getting the logger name from the specified type. - - - - - Creates a new logger. - - - - - Creates a new logger, getting the logger name from the specified type. - - - - - Creates a new logger. - - - - - Gets the configuration file. - - i.e. log4net.config - - - - - Used to create the TraceLogger implementation of ILogger interface. See . - - - - - Gets the configuration file. - - i.e. log4net.config - - - - - Interface for Context Properties implementations - - - - This interface defines a basic property get set accessor. - - - Based on the ContextPropertiesBase of log4net, by Nicko Cadell. - - - - - - Gets or sets the value of a property - - - The value for the property with the specified key - - - - Gets or sets the value of a property - - - - - - NullLogFactory used when logging is turned off. - - - - - Creates an instance of ILogger with the specified name. - - Name. - - - - - Creates an instance of ILogger with the specified name and LoggerLevel. - - Name. - Level. - - - - - Creates outputing - to files. The name of the file is derived from the log name - plus the 'log' extension. - - - - - Provides an interface that supports and - allows the storage and retrieval of Contexts. These are supported in - both log4net and NLog. - - - - - Manages logging. - - - This is a facade for the different logging subsystems. - It offers a simplified interface that follows IOC patterns - and a simplified priority/level/severity abstraction. - - - - - Create a new child logger. - The name of the child logger is [current-loggers-name].[passed-in-name] - - The Subname of this logger. - The New ILogger instance. - If the name has an empty element name. - - - - Logs a debug message. - - The message to log - - - - Logs a debug message with lazily constructed message. The message will be constructed only if the is true. - - - - - - Logs a debug message. - - The exception to log - The message to log - - - - Logs a debug message. - - Format string for the message to log - Format arguments for the message to log - - - - Logs a debug message. - - The exception to log - Format string for the message to log - Format arguments for the message to log - - - - Logs a debug message. - - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs a debug message. - - The exception to log - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs an error message. - - The message to log - - - - Logs an error message with lazily constructed message. The message will be constructed only if the is true. - - - - - - Logs an error message. - - The exception to log - The message to log - - - - Logs an error message. - - Format string for the message to log - Format arguments for the message to log - - - - Logs an error message. - - The exception to log - Format string for the message to log - Format arguments for the message to log - - - - Logs an error message. - - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs an error message. - - The exception to log - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs a fatal message. - - The message to log - - - - Logs a fatal message with lazily constructed message. The message will be constructed only if the is true. - - - - - - Logs a fatal message. - - The exception to log - The message to log - - - - Logs a fatal message. - - Format string for the message to log - Format arguments for the message to log - - - - Logs a fatal message. - - The exception to log - Format string for the message to log - Format arguments for the message to log - - - - Logs a fatal message. - - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs a fatal message. - - The exception to log - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs an info message. - - The message to log - - - - Logs a info message with lazily constructed message. The message will be constructed only if the is true. - - - - - - Logs an info message. - - The exception to log - The message to log - - - - Logs an info message. - - Format string for the message to log - Format arguments for the message to log - - - - Logs an info message. - - The exception to log - Format string for the message to log - Format arguments for the message to log - - - - Logs an info message. - - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs an info message. - - The exception to log - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs a warn message. - - The message to log - - - - Logs a warn message with lazily constructed message. The message will be constructed only if the is true. - - - - - - Logs a warn message. - - The exception to log - The message to log - - - - Logs a warn message. - - Format string for the message to log - Format arguments for the message to log - - - - Logs a warn message. - - The exception to log - Format string for the message to log - Format arguments for the message to log - - - - Logs a warn message. - - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs a warn message. - - The exception to log - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Determines if messages of priority "debug" will be logged. - - True if "debug" messages will be logged. - - - - Determines if messages of priority "error" will be logged. - - True if "error" messages will be logged. - - - - Determines if messages of priority "fatal" will be logged. - - True if "fatal" messages will be logged. - - - - Determines if messages of priority "info" will be logged. - - True if "info" messages will be logged. - - - - Determines if messages of priority "warn" will be logged. - - True if "warn" messages will be logged. - - - - Exposes the Global Context of the extended logger. - - - - - Exposes the Thread Context of the extended logger. - - - - - Exposes the Thread Stack of the extended logger. - - - - - The Logger sending everything to the standard output streams. - This is mainly for the cases when you have a utility that - does not have a logger to supply. - - - - - The Level Filtered Logger class. This is a base clase which - provides a LogLevel attribute and reroutes all functions into - one Log method. - - - - - Creates a new LevelFilteredLogger. - - - - - Keep the instance alive in a remoting scenario - - - - - - Logs a debug message. - - The message to log - - - - Logs a debug message. - - The exception to log - The message to log - - - - Logs a debug message. - - Format string for the message to log - Format arguments for the message to log - - - - Logs a debug message. - - The exception to log - Format string for the message to log - Format arguments for the message to log - - - - Logs a debug message. - - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs a debug message. - - The exception to log - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs an info message. - - The message to log - - - - Logs an info message. - - The exception to log - The message to log - - - - Logs an info message. - - Format string for the message to log - Format arguments for the message to log - - - - Logs an info message. - - The exception to log - Format string for the message to log - Format arguments for the message to log - - - - Logs an info message. - - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs an info message. - - The exception to log - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs a warn message. - - The message to log - - - - Logs a warn message. - - The exception to log - The message to log - - - - Logs a warn message. - - Format string for the message to log - Format arguments for the message to log - - - - Logs a warn message. - - The exception to log - Format string for the message to log - Format arguments for the message to log - - - - Logs a warn message. - - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs a warn message. - - The exception to log - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs an error message. - - The message to log - - - - Logs an error message. - - The exception to log - The message to log - - - - Logs an error message. - - Format string for the message to log - Format arguments for the message to log - - - - Logs an error message. - - The exception to log - Format string for the message to log - Format arguments for the message to log - - - - Logs an error message. - - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs an error message. - - The exception to log - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs a fatal message. - - The message to log - - - - Logs a fatal message. - - The exception to log - The message to log - - - - Logs a fatal message. - - Format string for the message to log - Format arguments for the message to log - - - - Logs a fatal message. - - The exception to log - Format string for the message to log - Format arguments for the message to log - - - - Logs a fatal message. - - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Logs a fatal message. - - The exception to log - The format provider to use - Format string for the message to log - Format arguments for the message to log - - - - Implementors output the log content by implementing this method only. - Note that exception can be null - - - - - - - - - The LoggerLevel that this logger - will be using. Defaults to LoggerLevel.Off - - - - - The name that this logger will be using. - Defaults to String.Empty - - - - - Determines if messages of priority "debug" will be logged. - - true if log level flags include the bit - - - - Determines if messages of priority "info" will be logged. - - true if log level flags include the bit - - - - Determines if messages of priority "warn" will be logged. - - true if log level flags include the bit - - - - Determines if messages of priority "error" will be logged. - - true if log level flags include the bit - - - - Determines if messages of priority "fatal" will be logged. - - true if log level flags include the bit - - - - Creates a new ConsoleLogger with the Level - set to LoggerLevel.Debug and the Name - set to String.Empty. - - - - - Creates a new ConsoleLogger with the Name - set to String.Empty. - - The logs Level. - - - - Creates a new ConsoleLogger with the Level - set to LoggerLevel.Debug. - - The logs Name. - - - - Creates a new ConsoleLogger. - - The logs Name. - The logs Level. - - - - A Common method to log. - - The level of logging - The name of the logger - The Message - The Exception - - - - Returns a new ConsoleLogger with the name - added after this loggers name, with a dot in between. - - The added hierarchical name. - A new ConsoleLogger. - - - - The Logger using standart Diagnostics namespace. - - - - - Creates a logger based on . - - - - - - Creates a logger based on . - - - - - - - Creates a logger based on . - - - - - - - - The Null Logger class. This is useful for implementations where you need - to provide a logger to a utility class, but do not want any output from it. - It also helps when you have a utility that does not have a logger to supply. - - - - - Returns this NullLogger. - - Ignored - This ILogger instance. - - - - No-op. - - Ignored - - - - No-op. - - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - - - - No-op. - - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - - - - No-op. - - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - - - - No-op. - - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - - - - No-op. - - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - - - - No-op. - - Ignored - Ignored - Ignored - Ignored - - - - Returns empty context properties. - - - - - Returns empty context properties. - - - - - Returns empty context stacks. - - - - - No-op. - - false - - - - No-op. - - false - - - - No-op. - - false - - - - No-op. - - false - - - - No-op. - - false - - - - The Stream Logger class. This class can stream log information - to any stream, it is suitable for storing a log file to disk, - or to a MemoryStream for testing your components. - - - This logger is not thread safe. - - - - - Creates a new StreamLogger with default encoding - and buffer size. Initial Level is set to Debug. - - - The name of the log. - - - The stream that will be used for logging, - seeking while the logger is alive - - - - - Creates a new StreamLogger with default buffer size. - Initial Level is set to Debug. - - - The name of the log. - - - The stream that will be used for logging, - seeking while the logger is alive - - - The encoding that will be used for this stream. - - - - - - Creates a new StreamLogger. - Initial Level is set to Debug. - - - The name of the log. - - - The stream that will be used for logging, - seeking while the logger is alive - - - The encoding that will be used for this stream. - - - - The buffer size that will be used for this stream. - - - - - - Creates a new StreamLogger with - Debug as default Level. - - The name of the log. - The StreamWriter the log will write to. - - - - The TraceLogger sends all logging to the System.Diagnostics.TraceSource - built into the .net framework. - - - Logging can be configured in the system.diagnostics configuration - section. - - If logger doesn't find a source name with a full match it will - use source names which match the namespace partially. For example you can - configure from all castle components by adding a source name with the - name "Castle". - - If no portion of the namespace matches the source named "Default" will - be used. - - - - - Build a new trace logger based on the named TraceSource - - The name used to locate the best TraceSource. In most cases comes from the using type's fullname. - - - - Build a new trace logger based on the named TraceSource - - The name used to locate the best TraceSource. In most cases comes from the using type's fullname. - The default logging level at which this source should write messages. In almost all cases this - default value will be overridden in the config file. - - - - Create a new child logger. - The name of the child logger is [current-loggers-name].[passed-in-name] - - The Subname of this logger. - The New ILogger instance. - - - - This is an abstract implementation - that deals with methods that can be abstracted away - from underlying implementations. - - - AbstractConfiguration makes easier to implementers - to create a new version of - - - - - is a interface encapsulating a configuration node - used to retrieve configuration values. - - - - - Gets the value of the node and converts it - into specified . - - The - - The Default value returned if the conversion fails. - - The Value converted into the specified type. - - - - Gets the name of the node. - - - The Name of the node. - - - - - Gets the value of the node. - - - The Value of the node. - - - - - Gets an of - elements containing all node children. - - The Collection of child nodes. - - - - Gets an of the configuration attributes. - - - - - Gets the value of the node and converts it - into specified . - - The - - The Default value returned if the conversion fails. - - The Value converted into the specified type. - - - - Gets node attributes. - - - All attributes of the node. - - - - - Gets all child nodes. - - The of child nodes. - - - - Gets the name of the . - - - The Name of the . - - - - - Gets the value of . - - - The Value of the . - - - - - A collection of objects. - - - - - Creates a new instance of ConfigurationCollection. - - - - - Creates a new instance of ConfigurationCollection. - - - - - Summary description for MutableConfiguration. - - - - - Initializes a new instance of the class. - - The name. - - - - Gets the value of . - - - The Value of the . - - - - - Deserializes the specified node into an abstract representation of configuration. - - The node. - - - - - If a config value is an empty string we return null, this is to keep - backward compatibility with old code - - - - - General purpose class to represent a standard pair of values. - - Type of the first value - Type of the second value - - - - Constructs a pair with its values - - - - - - - List of utility methods related to dynamic proxy operations - - - - - Determines whether the specified type is a proxy generated by - DynamicProxy (1 or 2). - - The type. - - true if it is a proxy; otherwise, false. - - - - - Readonly implementation of which uses an anonymous object as its source. Uses names of properties as keys, and property values as... well - values. Keys are not case sensitive. - - - - - Initializes a new instance of the class. - - The target. - - - - Adds an element with the provided key and value to the object. - - The to use as the key of the element to add. - The to use as the value of the element to add. - - is null. - An element with the same key already exists in the object. - The is read-only.-or- The has a fixed size. - - - - Removes all elements from the object. - - The object is read-only. - - - - Determines whether the object contains an element with the specified key. - - The key to locate in the object. - - true if the contains an element with the key; otherwise, false. - - - is null. - - - - Removes the element with the specified key from the object. - - The key of the element to remove. - - is null. - The object is read-only.-or- The has a fixed size. - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Copies the elements of the to an , starting at a particular index. - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in at which copying begins. - - is null. - - is less than zero. - - is multidimensional.-or- is equal to or greater than the length of .-or- The number of elements in the source is greater than the available space from to the end of the destination . - The type of the source cannot be cast automatically to the type of the destination . - - - - Returns an object for the object. - - - An object for the object. - - - - - Reads values of properties from and inserts them into using property names as keys. - - - - - - - Gets the number of elements contained in the . - - - The number of elements contained in the . - - - - Gets a value indicating whether access to the is synchronized (thread safe). - - - true if access to the is synchronized (thread safe); otherwise, false. - - - - Gets an object that can be used to synchronize access to the . - - - An object that can be used to synchronize access to the . - - - - Gets a value indicating whether the object is read-only. - - - true if the object is read-only; otherwise, false. - - - - Gets or sets the with the specified key. - - - - - - Gets an object containing the keys of the object. - - - An object containing the keys of the object. - - - - Gets an object containing the values in the object. - - - An object containing the values in the object. - - - - Gets a value indicating whether the object has a fixed size. - - - true if the object has a fixed size; otherwise, false. - - - - Represents a 'streamable' resource. Can - be a file, a resource in an assembly. - - - - - Returns a reader for the stream - - - It's up to the caller to dispose the reader. - - - - - - Returns a reader for the stream - - - It's up to the caller to dispose the reader. - - - - - - - Returns an instance of - created according to the relativePath - using itself as the root. - - - - - - - - - - Only valid for resources that - can be obtained through relative paths - - - - - - - - - - This returns a new stream instance each time it is called. - It is the responsibility of the caller to dispose of this stream - - - - - Depicts the contract for resource factories. - - - - - Used to check whether the resource factory - is able to deal with the given resource - identifier. - - - Implementors should return true - only if the given identifier is supported - by the resource factory - - - - - - - Creates an instance - for the given resource identifier - - - - - - - Creates an instance - for the given resource identifier - - - - - - - - - - - - - - - - - - Adapts a static string content as an - - - - - Enable access to files on network shares - - - - - Email sender abstraction. - - - - - Sends a mail message. - - From field - To field - E-mail's subject - message's body - - - - Sends a message. - - Message instance - - - - Sends multiple messages. - - List of messages - - - - Default implementation. - - - - - Initializes a new instance of the class based on the configuration provided in the application configuration file. - - - This constructor is based on the default configuration in the application configuration file. - - - - - This service implementation - requires a host name in order to work - - The smtp server name - - - - Sends a message. - - If any of the parameters is null - From field - To field - e-mail's subject - message's body - - - - Sends a message. - - If the message is null - Message instance - - - - Configures the sender - with port information and eventual credential - informed - - Message instance - - - - Gets or sets the port used to - access the SMTP server - - - - - Gets the hostname. - - The hostname. - - - - Gets or sets a value which is used to - configure if emails are going to be sent asynchronously or not. - - - - - Gets or sets a value that specifies - the amount of time after which a synchronous Send call times out. - - - - - Gets or sets a value indicating whether the email should be sent using - a secure communication channel. - - true if should use SSL; otherwise, false. - - - - Gets or sets the domain. - - The domain. - - - - Gets or sets the name of the user. - - The name of the user. - - - - Gets or sets the password. - - The password. - - - - Gets a value indicating whether credentials were informed. - - - if this instance has credentials; otherwise, . - - - - diff --git a/lib/castle/net45/Castle.Services.Logging.Log4netIntegration.dll b/lib/castle/net45/Castle.Services.Logging.Log4netIntegration.dll deleted file mode 100644 index ec6e41491e2..00000000000 Binary files a/lib/castle/net45/Castle.Services.Logging.Log4netIntegration.dll and /dev/null differ diff --git a/lib/dlr/IronRuby.Libraries.dll b/lib/dlr/IronRuby.Libraries.dll deleted file mode 100644 index 73d23036d29..00000000000 Binary files a/lib/dlr/IronRuby.Libraries.dll and /dev/null differ diff --git a/lib/dlr/IronRuby.dll b/lib/dlr/IronRuby.dll deleted file mode 100644 index 3f999616268..00000000000 Binary files a/lib/dlr/IronRuby.dll and /dev/null differ diff --git a/lib/dlr/LICENSE.APACHE.html b/lib/dlr/LICENSE.APACHE.html deleted file mode 100644 index 7b8e3f76932..00000000000 --- a/lib/dlr/LICENSE.APACHE.html +++ /dev/null @@ -1,214 +0,0 @@ - - - -Apache License, Version 2.0 - - - - -
-

-Apache License
-Version 2.0, January 2004
-http://www.apache.org/licenses/ -

-

-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -

-

1. Definitions.

-

- "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. -

-

- "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. -

-

- "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. -

-

- "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. -

-

- "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. -

-

- "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. -

-

- "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). -

-

- "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. -

-

- "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." -

-

- "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. -

-

2. Grant of Copyright License. -Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. -

-

3. Grant of Patent License. -Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. -

-

4. Redistribution. -You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: -

    -
  1. You must give any other recipients of the Work or - Derivative Works a copy of this License; and -

  2. - -
  3. You must cause any modified files to carry prominent notices - stating that You changed the files; and -

  4. - -
  5. You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and -

  6. - -
  7. If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License.
  8. -
- You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. -

-

5. Submission of Contributions. -Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. -

-

6. Trademarks. -This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. -

-

7. Disclaimer of Warranty. -Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) 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. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. -

-

8. Limitation of Liability. -In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. -

-

9. Accepting Warranty or Additional Liability. -While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. -

-
- -

See FAQ for answers to frequently asked questions -about this license.

- - - - diff --git a/lib/dlr/LICENSE.CPL.txt b/lib/dlr/LICENSE.CPL.txt deleted file mode 100644 index a8e6c050cc1..00000000000 --- a/lib/dlr/LICENSE.CPL.txt +++ /dev/null @@ -1,86 +0,0 @@ -Common Public License - v 1.0 - -THE 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. - -1. DEFINITIONS - -"Contribution" means: - - a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and - b) in the case of each subsequent Contributor: - - i) changes to the Program, and - - ii) additions to the Program; - - 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. - -"Contributor" means any person or entity that distributes the Program. - -"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. - -"Program" means the Contributions distributed in accordance with this Agreement. - -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - - 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. - - 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. - - 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. - - 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. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: - - a) it complies with the terms and conditions of this Agreement; and - - b) its license agreement: - - 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; - - ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; - - iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and - - 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. - -When the Program is made available in source code form: - - a) it must be made available under this Agreement; and - - b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within the Program. - -Each 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. - -4. COMMERCIAL DISTRIBUTION - -Commercial 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. - -For 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. - -5. NO WARRANTY - -EXCEPT 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. - -6. DISCLAIMER OF LIABILITY - -EXCEPT 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. - -7. GENERAL - -If 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. - -If 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. - -All 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. - -Everyone 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. - -This 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. diff --git a/lib/dlr/LICENSE.Ruby.txt b/lib/dlr/LICENSE.Ruby.txt deleted file mode 100644 index 4a99f6f01a8..00000000000 --- a/lib/dlr/LICENSE.Ruby.txt +++ /dev/null @@ -1,58 +0,0 @@ -Ruby is copyrighted free software by Yukihiro Matsumoto . -You can redistribute it and/or modify it under either the terms of the GPL -(see COPYING.txt file), or the conditions below: - - 1. You may make and give away verbatim copies of the source form of the - software without restriction, provided that you duplicate all of the - original copyright notices and associated disclaimers. - - 2. You may modify your copy of the software in any way, provided that - you do at least ONE of the following: - - a) place your modifications in the Public Domain or otherwise - make them Freely Available, such as by posting said - modifications to Usenet or an equivalent medium, or by allowing - the author to include your modifications in the software. - - b) use the modified software only within your corporation or - organization. - - c) rename any non-standard executables so the names do not conflict - with standard executables, which must also be provided. - - d) make other distribution arrangements with the author. - - 3. You may distribute the software in object code or executable - form, provided that you do at least ONE of the following: - - a) distribute the executables and library files of the software, - together with instructions (in the manual page or equivalent) - on where to get the original distribution. - - b) accompany the distribution with the machine-readable source of - the software. - - c) give non-standard executables non-standard names, with - instructions on where to get the original software distribution. - - d) make other distribution arrangements with the author. - - 4. You may modify and include the part of the software into any other - software (possibly commercial). But some files in the distribution - are not written by the author, so that they are not under this terms. - - They are gc.c(partly), utils.c(partly), regex.[ch], st.[ch] and some - files under the ./missing directory. See each file for the copying - condition. - - 5. The scripts and library files supplied as input to or produced as - output from the software do not automatically fall under the - copyright of the software, but belong to whomever generated them, - and may be sold commercially, and may be aggregated with this - software. - - 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. - diff --git a/lib/dlr/Microsoft.Dynamic.dll b/lib/dlr/Microsoft.Dynamic.dll deleted file mode 100644 index b28b36c6b78..00000000000 Binary files a/lib/dlr/Microsoft.Dynamic.dll and /dev/null differ diff --git a/lib/dlr/Microsoft.Scripting.Metadata.dll b/lib/dlr/Microsoft.Scripting.Metadata.dll deleted file mode 100644 index 2d1bcf4d2f6..00000000000 Binary files a/lib/dlr/Microsoft.Scripting.Metadata.dll and /dev/null differ diff --git a/lib/dlr/Microsoft.Scripting.dll b/lib/dlr/Microsoft.Scripting.dll deleted file mode 100644 index 0c26390608a..00000000000 Binary files a/lib/dlr/Microsoft.Scripting.dll and /dev/null differ diff --git a/lib/dlr/README.txt b/lib/dlr/README.txt deleted file mode 100644 index 0bf5f24720e..00000000000 --- a/lib/dlr/README.txt +++ /dev/null @@ -1,49 +0,0 @@ -IronRuby - A .NET Implementation of the Ruby language - -Authors: - Daniele Alessandri, Shri Borde, Peter Bacon Darwin, Jim Deville, - Curt Hagenlocher, John Lam, Haibo Luo, Tomas Matousek, John Messerly, - Jirapong Nanta, Srivatsn Narayanan, Jimmy Schementi, Oleg Tkachenko, - Dino Viehland, and everyone else from the community who reports bugs, - builds libraries, and helps enrich IronRuby. - -Project Contacts: - Jimmy Schementi - Miguel de Icaza - Tomas Matousek - -== About - -IronRuby is a Open Source implementation of the Ruby programming language -(http://www.ruby-lang.org) for .NET, heavily relying on the -Dynamic Language Runtime (http://dlr.codeplex.com). - -The project's #1 goal is to be a true Ruby implementation, meaning it runs -existing Ruby code. See -http://ironruby.net/Documentation/Real_Ruby_Applications for information about -using the Ruby standard library and 3rd party libraries in IronRuby. - -IronRuby has tightly integration with .NET, so any .NET types can be used from -IronRuby, and the IronRuby runtime can be embedded into any .NET application. -See http://ironruby.net/documentation/.net for more information. - -== Running - -bin/ir.exe rubyfile.rb - -Will run rubyfile.rb with the IronRuby compiler. - -== Package - - /bin IronRuby binaries, ir.exe, iirb, irake, igem, iri, irdoc, etc. - /lib Ruby standard library, including RubyGems - CHANGELOG.txt Changes for each release - RELEASE.txt Release notes - LICENSE.Ruby.txt Ruby license - LICENSE.CPL.txt Common Public License - LICENSE.APACHE.html Apache License, Version 2.0 - README.txt This file - -== License - -Read the License.* files diff --git a/lib/dotnetzip/Ionic.Zip.dll b/lib/dotnetzip/Ionic.Zip.dll deleted file mode 100644 index 95fa9288557..00000000000 Binary files a/lib/dotnetzip/Ionic.Zip.dll and /dev/null differ diff --git a/lib/dotnetzip/Ionic.Zip.xml b/lib/dotnetzip/Ionic.Zip.xml deleted file mode 100644 index a90fbe069ee..00000000000 --- a/lib/dotnetzip/Ionic.Zip.xml +++ /dev/null @@ -1,18132 +0,0 @@ - - - - Ionic.Zip - - - - - An enum that specifies the source of the ZipEntry. - - - - - Default value. Invalid on a bonafide ZipEntry. - - - - - The entry was instantiated by calling AddFile() or another method that - added an entry from the filesystem. - - - - - The entry was instantiated via or - . - - - - - The ZipEntry was instantiated by reading a zipfile. - - - - - The content for the ZipEntry will be or was provided by the WriteDelegate. - - - - - The content for the ZipEntry will be obtained from the stream dispensed by the OpenDelegate. - The entry was instantiated via . - - - - - The content for the ZipEntry will be or was obtained from a ZipOutputStream. - - - - - Provides a stream metaphor for generating zip files. - - - - - This class writes zip files, as defined in the specification - for zip files described by PKWare. The compression for this - implementation is provided by a managed-code version of Zlib, included with - DotNetZip in the classes in the Ionic.Zlib namespace. - - - - This class provides an alternative programming model to the one enabled by the - class. Use this when creating zip files, as an - alternative to the class, when you would like to use a - Stream type to write the zip file. - - - - Both the ZipOutputStream class and the ZipFile class can be used - to create zip files. Both of them support many of the common zip features, - including Unicode, different compression levels, and ZIP64. They provide - very similar performance when creating zip files. - - - - The ZipFile class is generally easier to use than - ZipOutputStream and should be considered a higher-level interface. For - example, when creating a zip file via calls to the PutNextEntry() and - Write() methods on the ZipOutputStream class, the caller is - responsible for opening the file, reading the bytes from the file, writing - those bytes into the ZipOutputStream, setting the attributes on the - ZipEntry, and setting the created, last modified, and last accessed - timestamps on the zip entry. All of these things are done automatically by a - call to ZipFile.AddFile(). - For this reason, the ZipOutputStream is generally recommended for use - only when your application emits arbitrary data, not necessarily data from a - filesystem file, directly into a zip file, and does so using a Stream - metaphor. - - - - Aside from the differences in programming model, there are other - differences in capability between the two classes. - - - - - ZipFile can be used to read and extract zip files, in addition to - creating zip files. ZipOutputStream cannot read zip files. If you want - to use a stream to read zip files, check out the class. - - - - ZipOutputStream does not support the creation of segmented or spanned - zip files. - - - - ZipOutputStream cannot produce a self-extracting archive. - - - - - Be aware that the ZipOutputStream class implements the interface. In order for - ZipOutputStream to produce a valid zip file, you use use it within - a using clause (Using in VB), or call the Dispose() method - explicitly. See the examples for how to employ a using clause. - - - - Also, a note regarding compression performance: On the desktop .NET - Framework, DotNetZip can use a multi-threaded compression implementation - that provides significant speed increases on large files, over 300k or so, - at the cost of increased memory use at runtime. (The output of the - compression is almost exactly the same size). But, the multi-threaded - approach incurs a performance hit on smaller files. There's no way for the - ZipOutputStream to know whether parallel compression will be beneficial, - because the ZipOutputStream does not know how much data you will write - through the stream. You may wish to set the property to zero, if you are compressing - large files through ZipOutputStream. This will cause parallel - compression to be used, always. - - - - - - Create a ZipOutputStream, wrapping an existing stream. - - - - - The class is generally easier to use when creating - zip files. The ZipOutputStream offers a different metaphor for creating a - zip file, based on the class. - - - - - - The stream to wrap. It must be writable. This stream will be closed at - the time the ZipOutputStream is closed. - - - - - This example shows how to create a zip file, using the - ZipOutputStream class. - - - private void Zipup() - { - if (filesToZip.Count == 0) - { - System.Console.WriteLine("Nothing to do."); - return; - } - - using (var raw = File.Open(_outputFileName, FileMode.Create, FileAccess.ReadWrite )) - { - using (var output= new ZipOutputStream(raw)) - { - output.Password = "VerySecret!"; - output.Encryption = EncryptionAlgorithm.WinZipAes256; - - foreach (string inputFileName in filesToZip) - { - System.Console.WriteLine("file: {0}", inputFileName); - - output.PutNextEntry(inputFileName); - using (var input = File.Open(inputFileName, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Write )) - { - byte[] buffer= new byte[2048]; - int n; - while ((n= input.Read(buffer,0,buffer.Length)) > 0) - { - output.Write(buffer,0,n); - } - } - } - } - } - } - - - - Private Sub Zipup() - Dim outputFileName As String = "XmlData.zip" - Dim filesToZip As String() = Directory.GetFiles(".", "*.xml") - If (filesToZip.Length = 0) Then - Console.WriteLine("Nothing to do.") - Else - Using raw As FileStream = File.Open(outputFileName, FileMode.Create, FileAccess.ReadWrite) - Using output As ZipOutputStream = New ZipOutputStream(raw) - output.Password = "VerySecret!" - output.Encryption = EncryptionAlgorithm.WinZipAes256 - Dim inputFileName As String - For Each inputFileName In filesToZip - Console.WriteLine("file: {0}", inputFileName) - output.PutNextEntry(inputFileName) - Using input As FileStream = File.Open(inputFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) - Dim n As Integer - Dim buffer As Byte() = New Byte(2048) {} - Do While (n = input.Read(buffer, 0, buffer.Length) > 0) - output.Write(buffer, 0, n) - Loop - End Using - Next - End Using - End Using - End If - End Sub - - - - - - Create a ZipOutputStream that writes to a filesystem file. - - - - The class is generally easier to use when creating - zip files. The ZipOutputStream offers a different metaphor for creating a - zip file, based on the class. - - - - The name of the zip file to create. - - - - - This example shows how to create a zip file, using the - ZipOutputStream class. - - - private void Zipup() - { - if (filesToZip.Count == 0) - { - System.Console.WriteLine("Nothing to do."); - return; - } - - using (var output= new ZipOutputStream(outputFileName)) - { - output.Password = "VerySecret!"; - output.Encryption = EncryptionAlgorithm.WinZipAes256; - - foreach (string inputFileName in filesToZip) - { - System.Console.WriteLine("file: {0}", inputFileName); - - output.PutNextEntry(inputFileName); - using (var input = File.Open(inputFileName, FileMode.Open, FileAccess.Read, - FileShare.Read | FileShare.Write )) - { - byte[] buffer= new byte[2048]; - int n; - while ((n= input.Read(buffer,0,buffer.Length)) > 0) - { - output.Write(buffer,0,n); - } - } - } - } - } - - - - Private Sub Zipup() - Dim outputFileName As String = "XmlData.zip" - Dim filesToZip As String() = Directory.GetFiles(".", "*.xml") - If (filesToZip.Length = 0) Then - Console.WriteLine("Nothing to do.") - Else - Using output As ZipOutputStream = New ZipOutputStream(outputFileName) - output.Password = "VerySecret!" - output.Encryption = EncryptionAlgorithm.WinZipAes256 - Dim inputFileName As String - For Each inputFileName In filesToZip - Console.WriteLine("file: {0}", inputFileName) - output.PutNextEntry(inputFileName) - Using input As FileStream = File.Open(inputFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) - Dim n As Integer - Dim buffer As Byte() = New Byte(2048) {} - Do While (n = input.Read(buffer, 0, buffer.Length) > 0) - output.Write(buffer, 0, n) - Loop - End Using - Next - End Using - End If - End Sub - - - - - - Create a ZipOutputStream. - - - - See the documentation for the ZipOutputStream(Stream) - constructor for an example. - - - - The stream to wrap. It must be writable. - - - - true if the application would like the stream - to remain open after the ZipOutputStream has been closed. - - - - Provides a string representation of the instance. - - - This can be useful for debugging purposes. - - - a string representation of the instance. - - - - Returns true if an entry by the given name has already been written - to the ZipOutputStream. - - - - The name of the entry to scan for. - - - - true if an entry by the given name has already been written. - - - - - Write the data from the buffer to the stream. - - - - As the application writes data into this stream, the data may be - compressed and encrypted before being written out to the underlying - stream, depending on the settings of the - and the properties. - - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Specify the name of the next entry that will be written to the zip file. - - - - - Call this method just before calling , to - specify the name of the entry that the next set of bytes written to - the ZipOutputStream belongs to. All subsequent calls to Write, - until the next call to PutNextEntry, - will be inserted into the named entry in the zip file. - - - - If the used in PutNextEntry() ends in - a slash, then the entry added is marked as a directory. Because directory - entries do not contain data, a call to Write(), before an - intervening additional call to PutNextEntry(), will throw an - exception. - - - - If you don't call Write() between two calls to - PutNextEntry(), the first entry is inserted into the zip file as a - file of zero size. This may be what you want. - - - - Because PutNextEntry() closes out the prior entry, if any, this - method may throw if there is a problem with the prior entry. - - - - This method returns the ZipEntry. You can modify public properties - on the ZipEntry, such as , , and so on, until the first call to - ZipOutputStream.Write(), or until the next call to - PutNextEntry(). If you modify the ZipEntry after - having called Write(), you may get a runtime exception, or you may - silently get an invalid zip archive. - - - - - - - This example shows how to create a zip file, using the - ZipOutputStream class. - - - private void Zipup() - { - using (FileStream fs raw = File.Open(_outputFileName, FileMode.Create, FileAccess.ReadWrite )) - { - using (var output= new ZipOutputStream(fs)) - { - output.Password = "VerySecret!"; - output.Encryption = EncryptionAlgorithm.WinZipAes256; - output.PutNextEntry("entry1.txt"); - byte[] buffer= System.Text.Encoding.ASCII.GetBytes("This is the content for entry #1."); - output.Write(buffer,0,buffer.Length); - output.PutNextEntry("entry2.txt"); // this will be zero length - output.PutNextEntry("entry3.txt"); - buffer= System.Text.Encoding.ASCII.GetBytes("This is the content for entry #3."); - output.Write(buffer,0,buffer.Length); - } - } - } - - - - - The name of the entry to be added, including any path to be used - within the zip file. - - - - The ZipEntry created. - - - - - - Dispose the stream - - - - - This method writes the Zip Central directory, then closes the stream. The - application must call Dispose() (or Close) in order to produce a valid zip file. - - - - Typically the application will call Dispose() implicitly, via a using - statement in C#, or a Using statement in VB. - - - - - set this to true, always. - - - - This is a no-op. - - - - - This method always throws a NotSupportedException. - - ignored - ignored - ignored - nothing - - - - This method always throws a NotSupportedException. - - ignored - ignored - nothing - - - - This method always throws a NotSupportedException. - - ignored - - - - Sets the password to be used on the ZipOutputStream instance. - - - - - - When writing a zip archive, this password is applied to the entries, not - to the zip archive itself. It applies to any ZipEntry subsequently - written to the ZipOutputStream. - - - - Using a password does not encrypt or protect the "directory" of the - archive - the list of entries contained in the archive. If you set the - Password property, the password actually applies to individual - entries that are added to the archive, subsequent to the setting of this - property. The list of filenames in the archive that is eventually created - will appear in clear text, but the contents of the individual files are - encrypted. This is how Zip encryption works. - - - - If you set this property, and then add a set of entries to the archive via - calls to PutNextEntry, then each entry is encrypted with that - password. You may also want to change the password between adding - different entries. If you set the password, add an entry, then set the - password to null (Nothing in VB), and add another entry, the - first entry is encrypted and the second is not. - - - - When setting the Password, you may also want to explicitly set the property, to specify how to encrypt the entries added - to the ZipFile. If you set the Password to a non-null value and do not - set , then PKZip 2.0 ("Weak") encryption is used. - This encryption is relatively weak but is very interoperable. If - you set the password to a null value (Nothing in VB), - Encryption is reset to None. - - - - Special case: if you wrap a ZipOutputStream around a non-seekable stream, - and use encryption, and emit an entry of zero bytes, the Close() or - PutNextEntry() following the entry will throw an exception. - - - - - - - The Encryption to use for entries added to the ZipOutputStream. - - - - - The specified Encryption is applied to the entries subsequently - written to the ZipOutputStream instance. - - - - If you set this to something other than - EncryptionAlgorithm.None, you will also need to set the - to a non-null, non-empty value in - order to actually get encryption on the entry. - - - - - ZipOutputStream.Password - ZipEntry.Encryption - - - - Size of the work buffer to use for the ZLIB codec during compression. - - - - Setting this may affect performance. For larger files, setting this to a - larger size may improve performance, but I'm not sure. Sorry, I don't - currently have good recommendations on how to set it. You can test it if - you like. - - - - - The compression strategy to use for all entries. - - - - Set the Strategy used by the ZLIB-compatible compressor, when compressing - data for the entries in the zip archive. Different compression strategies - work better on different sorts of data. The strategy parameter can affect - the compression ratio and the speed of compression but not the correctness - of the compresssion. For more information see . - - - - - The type of timestamp attached to the ZipEntry. - - - - Set this in order to specify the kind of timestamp that should be emitted - into the zip file for each entry. - - - - - Sets the compression level to be used for entries subsequently added to - the zip archive. - - - - - Varying the compression level used on entries can affect the - size-vs-speed tradeoff when compression and decompressing data streams - or files. - - - - As with some other properties on the ZipOutputStream class, like , and , - setting this property on a ZipOutputStream - instance will cause the specified CompressionLevel to be used on all - items that are subsequently added to the - ZipOutputStream instance. - - - - If you do not set this property, the default compression level is used, - which normally gives a good balance of compression efficiency and - compression speed. In some tests, using BestCompression can - double the time it takes to compress, while delivering just a small - increase in compression efficiency. This behavior will vary with the - type of data you compress. If you are in doubt, just leave this setting - alone, and accept the default. - - - - - - The compression method used on each entry added to the ZipOutputStream. - - - - - A comment attached to the zip archive. - - - - - - The application sets this property to specify a comment to be embedded - into the generated zip archive. - - - - According to PKWARE's - zip specification, the comment is not encrypted, even if there is a - password set on the zip file. - - - - The specification does not describe how to indicate the encoding used - on a comment string. Many "compliant" zip tools and libraries use - IBM437 as the code page for comments; DotNetZip, too, follows that - practice. On the other hand, there are situations where you want a - Comment to be encoded with something else, for example using code page - 950 "Big-5 Chinese". To fill that need, DotNetZip will encode the - comment following the same procedure it follows for encoding - filenames: (a) if is - Never, it uses the default encoding (IBM437). (b) if is Always, it always uses the - alternate encoding (). (c) if is AsNecessary, it uses the - alternate encoding only if the default encoding is not sufficient for - encoding the comment - in other words if decoding the result does not - produce the original string. This decision is taken at the time of - the call to ZipFile.Save(). - - - - - - - Specify whether to use ZIP64 extensions when saving a zip archive. - - - - - The default value for the property is . is - safest, in the sense that you will not get an Exception if a - pre-ZIP64 limit is exceeded. - - - - You must set this property before calling Write(). - - - - - - - Indicates whether ZIP64 extensions were used when saving the zip archive. - - - - The value is defined only after the ZipOutputStream has been closed. - - - - - Whether the ZipOutputStream should use case-insensitive comparisons when - checking for uniqueness of zip entries. - - - - - Though the zip specification doesn't prohibit zipfiles with duplicate - entries, Sane zip files have no duplicates, and the DotNetZip library - cannot create zip files with duplicate entries. If an application attempts - to call with a name that duplicates one - already used within the archive, the library will throw an Exception. - - - This property allows the application to specify whether the - ZipOutputStream instance considers ordinal case when checking for - uniqueness of zip entries. - - - - - - Indicates whether to encode entry filenames and entry comments using - Unicode (UTF-8). - - - - - The - PKWare zip specification provides for encoding file names and file - comments in either the IBM437 code page, or in UTF-8. This flag selects - the encoding according to that specification. By default, this flag is - false, and filenames and comments are encoded into the zip file in the - IBM437 codepage. Setting this flag to true will specify that filenames - and comments that cannot be encoded with IBM437 will be encoded with - UTF-8. - - - - Zip files created with strict adherence to the PKWare specification with - respect to UTF-8 encoding can contain entries with filenames containing - any combination of Unicode characters, including the full range of - characters from Chinese, Latin, Hebrew, Greek, Cyrillic, and many other - alphabets. However, because at this time, the UTF-8 portion of the PKWare - specification is not broadly supported by other zip libraries and - utilities, such zip files may not be readable by your favorite zip tool or - archiver. In other words, interoperability will decrease if you set this - flag to true. - - - - In particular, Zip files created with strict adherence to the PKWare - specification with respect to UTF-8 encoding will not work well with - Explorer in Windows XP or Windows Vista, because Windows compressed - folders, as far as I know, do not support UTF-8 in zip files. Vista can - read the zip files, but shows the filenames incorrectly. Unpacking from - Windows Vista Explorer will result in filenames that have rubbish - characters in place of the high-order UTF-8 bytes. - - - - Also, zip files that use UTF-8 encoding will not work well with Java - applications that use the java.util.zip classes, as of v5.0 of the Java - runtime. The Java runtime does not correctly implement the PKWare - specification in this regard. - - - - As a result, we have the unfortunate situation that "correct" behavior by - the DotNetZip library with regard to Unicode encoding of filenames during - zip creation will result in zip files that are readable by strictly - compliant and current tools (for example the most recent release of the - commercial WinZip tool); but these zip files will not be readable by - various other tools or libraries, including Windows Explorer. - - - - The DotNetZip library can read and write zip files with UTF8-encoded - entries, according to the PKware spec. If you use DotNetZip for both - creating and reading the zip file, and you use UTF-8, there will be no - loss of information in the filenames. For example, using a self-extractor - created by this library will allow you to unpack files correctly with no - loss of information in the filenames. - - - - If you do not set this flag, it will remain false. If this flag is false, - the ZipOutputStream will encode all filenames and comments using - the IBM437 codepage. This can cause "loss of information" on some - filenames, but the resulting zipfile will be more interoperable with other - utilities. As an example of the loss of information, diacritics can be - lost. The o-tilde character will be down-coded to plain o. The c with a - cedilla (Unicode 0xE7) used in Portugese will be downcoded to a c. - Likewise, the O-stroke character (Unicode 248), used in Danish and - Norwegian, will be down-coded to plain o. Chinese characters cannot be - represented in codepage IBM437; when using the default encoding, Chinese - characters in filenames will be represented as ?. These are all examples - of "information loss". - - - - The loss of information associated to the use of the IBM437 encoding is - inconvenient, and can also lead to runtime errors. For example, using - IBM437, any sequence of 4 Chinese characters will be encoded as ????. If - your application creates a ZipOutputStream, does not set the - encoding, then adds two files, each with names of four Chinese characters - each, this will result in a duplicate filename exception. In the case - where you add a single file with a name containing four Chinese - characters, the zipfile will save properly, but extracting that file - later, with any zip tool, will result in an error, because the question - mark is not legal for use within filenames on Windows. These are just a - few examples of the problems associated to loss of information. - - - - This flag is independent of the encoding of the content within the entries - in the zip file. Think of the zip file as a container - it supports an - encoding. Within the container are other "containers" - the file entries - themselves. The encoding within those entries is independent of the - encoding of the zip archive container for those entries. - - - - Rather than specify the encoding in a binary fashion using this flag, an - application can specify an arbitrary encoding via the property. Setting the encoding - explicitly when creating zip archives will result in non-compliant zip - files that, curiously, are fairly interoperable. The challenge is, the - PKWare specification does not provide for a way to specify that an entry - in a zip archive uses a code page that is neither IBM437 nor UTF-8. - Therefore if you set the encoding explicitly when creating a zip archive, - you must take care upon reading the zip archive to use the same code page. - If you get it wrong, the behavior is undefined and may result in incorrect - filenames, exceptions, stomach upset, hair loss, and acne. - - - - - - - The text encoding to use when emitting entries into the zip archive, for - those entries whose filenames or comments cannot be encoded with the - default (IBM437) encoding. - - - - - In its - zip specification, PKWare describes two options for encoding - filenames and comments: using IBM437 or UTF-8. But, some archiving tools - or libraries do not follow the specification, and instead encode - characters using the system default code page. For example, WinRAR when - run on a machine in Shanghai may encode filenames with the Big-5 Chinese - (950) code page. This behavior is contrary to the Zip specification, but - it occurs anyway. - - - - When using DotNetZip to write zip archives that will be read by one of - these other archivers, set this property to specify the code page to use - when encoding the and for each ZipEntry in the zip file, for - values that cannot be encoded with the default codepage for zip files, - IBM437. This is why this property is "provisional". In all cases, IBM437 - is used where possible, in other words, where no loss of data would - result. It is possible, therefore, to have a given entry with a - Comment encoded in IBM437 and a FileName encoded with the - specified "provisional" codepage. - - - - Be aware that a zip file created after you've explicitly set the - ProvisionalAlternateEncoding property to a value other than - IBM437 may not be compliant to the PKWare specification, and may not be - readable by compliant archivers. On the other hand, many (most?) - archivers are non-compliant and can read zip files created in arbitrary - code pages. The trick is to use or specify the proper codepage when - reading the zip. - - - - When creating a zip archive using this library, it is possible to change - the value of ProvisionalAlternateEncoding between each entry you - add, and between adding entries and the call to Close(). Don't do - this. It will likely result in a zipfile that is not readable. For best - interoperability, either leave ProvisionalAlternateEncoding - alone, or specify it only once, before adding any entries to the - ZipOutputStream instance. There is one exception to this - recommendation, described later. - - - - When using an arbitrary, non-UTF8 code page for encoding, there is no - standard way for the creator application - whether DotNetZip, WinZip, - WinRar, or something else - to formally specify in the zip file which - codepage has been used for the entries. As a result, readers of zip files - are not able to inspect the zip file and determine the codepage that was - used for the entries contained within it. It is left to the application - or user to determine the necessary codepage when reading zip files encoded - this way. If you use an incorrect codepage when reading a zipfile, you - will get entries with filenames that are incorrect, and the incorrect - filenames may even contain characters that are not legal for use within - filenames in Windows. Extracting entries with illegal characters in the - filenames will lead to exceptions. It's too bad, but this is just the way - things are with code pages in zip files. Caveat Emptor. - - - - One possible approach for specifying the code page for a given zip file is - to describe the code page in a human-readable form in the Zip comment. For - example, the comment may read "Entries in this archive are encoded in the - Big5 code page". For maximum interoperability, the zip comment in this - case should be encoded in the default, IBM437 code page. In this case, - the zip comment is encoded using a different page than the filenames. To - do this, Specify ProvisionalAlternateEncoding to your desired - region-specific code page, once before adding any entries, and then set - the property and reset - ProvisionalAlternateEncoding to IBM437 before calling Close(). - - - - - - A Text Encoding to use when encoding the filenames and comments for - all the ZipEntry items, during a ZipFile.Save() operation. - - - - Whether the encoding specified here is used during the save depends - on . - - - - - - A flag that tells if and when this instance should apply - AlternateEncoding to encode the filenames and comments associated to - of ZipEntry objects contained within this instance. - - - - - The default text encoding used in zip archives. It is numeric 437, also - known as IBM437. - - - - - - The size threshold for an entry, above which a parallel deflate is used. - - - - - - DotNetZip will use multiple threads to compress any ZipEntry, when - the CompressionMethod is Deflate, and if the entry is - larger than the given size. Zero means "always use parallel - deflate", while -1 means "never use parallel deflate". - - - - If the entry size cannot be known before compression, as with any entry - added via a ZipOutputStream, then Parallel deflate will never be - performed, unless the value of this property is zero. - - - - A parallel deflate operations will speed up the compression of - large files, on computers with multiple CPUs or multiple CPU - cores. For files above 1mb, on a dual core or dual-cpu (2p) - machine, the time required to compress the file can be 70% of the - single-threaded deflate. For very large files on 4p machines the - compression can be done in 30% of the normal time. The downside - is that parallel deflate consumes extra memory during the deflate, - and the deflation is slightly less effective. - - - - Parallel deflate tends to not be as effective as single-threaded deflate - because the original data stream is split into multiple independent - buffers, each of which is compressed in parallel. But because they are - treated independently, there is no opportunity to share compression - dictionaries, and additional framing bytes must be added to the output - stream. For that reason, a deflated stream may be slightly larger when - compressed using parallel deflate, as compared to a traditional - single-threaded deflate. For files of about 512k, the increase over the - normal deflate is as much as 5% of the total compressed size. For larger - files, the difference can be as small as 0.1%. - - - - Multi-threaded compression does not give as much an advantage when using - Encryption. This is primarily because encryption tends to slow down - the entire pipeline. Also, multi-threaded compression gives less of an - advantage when using lower compression levels, for example . You may have to perform - some tests to determine the best approach for your situation. - - - - The default value for this property is -1, which means parallel - compression will not be performed unless you set it to zero. - - - - - - - The maximum number of buffer pairs to use when performing - parallel compression. - - - - - This property sets an upper limit on the number of memory - buffer pairs to create when performing parallel - compression. The implementation of the parallel - compression stream allocates multiple buffers to - facilitate parallel compression. As each buffer fills up, - the stream uses - ThreadPool.QueueUserWorkItem() to compress those - buffers in a background threadpool thread. After a buffer - is compressed, it is re-ordered and written to the output - stream. - - - - A higher number of buffer pairs enables a higher degree of - parallelism, which tends to increase the speed of compression on - multi-cpu computers. On the other hand, a higher number of buffer - pairs also implies a larger memory consumption, more active worker - threads, and a higher cpu utilization for any compression. This - property enables the application to limit its memory consumption and - CPU utilization behavior depending on requirements. - - - - For each compression "task" that occurs in parallel, there are 2 - buffers allocated: one for input and one for output. This property - sets a limit for the number of pairs. The total amount of storage - space allocated for buffering will then be (N*S*2), where N is the - number of buffer pairs, S is the size of each buffer (). By default, DotNetZip allocates 4 buffer - pairs per CPU core, so if your machine has 4 cores, and you retain - the default buffer size of 128k, then the - ParallelDeflateOutputStream will use 4 * 4 * 2 * 128kb of buffer - memory in total, or 4mb, in blocks of 128kb. If you then set this - property to 8, then the number will be 8 * 2 * 128kb of buffer - memory, or 2mb. - - - - CPU utilization will also go up with additional buffers, because a - larger number of buffer pairs allows a larger number of background - threads to compress in parallel. If you find that parallel - compression is consuming too much memory or CPU, you can adjust this - value downward. - - - - The default value is 16. Different values may deliver better or - worse results, depending on your priorities and the dynamic - performance characteristics of your storage and compute resources. - - - - This property is not the number of buffer pairs to use; it is an - upper limit. An illustration: Suppose you have an application that - uses the default value of this property (which is 16), and it runs - on a machine with 2 CPU cores. In that case, DotNetZip will allocate - 4 buffer pairs per CPU core, for a total of 8 pairs. The upper - limit specified by this property has no effect. - - - - The application can set this value at any time, but it is - effective only if set before calling - ZipOutputStream.Write() for the first time. - - - - - - - - - Always returns false. - - - - - Always returns false. - - - - - Always returns true. - - - - - Always returns a NotSupportedException. - - - - - Setting this property always returns a NotSupportedException. Getting it - returns the value of the Position on the underlying stream. - - - - - Provides a stream metaphor for reading zip files. - - - - - This class provides an alternative programming model for reading zip files to - the one enabled by the class. Use this when reading zip - files, as an alternative to the class, when you would - like to use a Stream class to read the file. - - - - Some application designs require a readable stream for input. This stream can - be used to read a zip file, and extract entries. - - - - Both the ZipInputStream class and the ZipFile class can be used - to read and extract zip files. Both of them support many of the common zip - features, including Unicode, different compression levels, and ZIP64. The - programming models differ. For example, when extracting entries via calls to - the GetNextEntry() and Read() methods on the - ZipInputStream class, the caller is responsible for creating the file, - writing the bytes into the file, setting the attributes on the file, and - setting the created, last modified, and last accessed timestamps on the - file. All of these things are done automatically by a call to ZipEntry.Extract(). For this reason, the - ZipInputStream is generally recommended for when your application wants - to extract the data, without storing that data into a file. - - - - Aside from the obvious differences in programming model, there are some - differences in capability between the ZipFile class and the - ZipInputStream class. - - - - - ZipFile can be used to create or update zip files, or read and - extract zip files. ZipInputStream can be used only to read and - extract zip files. If you want to use a stream to create zip files, check - out the . - - - - ZipInputStream cannot read segmented or spanned - zip files. - - - - ZipInputStream will not read Zip file comments. - - - - When reading larger files, ZipInputStream will always underperform - ZipFile. This is because the ZipInputStream does a full scan on the - zip file, while the ZipFile class reads the central directory of the - zip file. - - - - - - - - - Create a ZipInputStream, wrapping it around an existing stream. - - - - - - While the class is generally easier - to use, this class provides an alternative to those - applications that want to read from a zipfile directly, - using a . - - - - Both the ZipInputStream class and the ZipFile class can be used - to read and extract zip files. Both of them support many of the common zip - features, including Unicode, different compression levels, and ZIP64. The - programming models differ. For example, when extracting entries via calls to - the GetNextEntry() and Read() methods on the - ZipInputStream class, the caller is responsible for creating the file, - writing the bytes into the file, setting the attributes on the file, and - setting the created, last modified, and last accessed timestamps on the - file. All of these things are done automatically by a call to ZipEntry.Extract(). For this reason, the - ZipInputStream is generally recommended for when your application wants - to extract the data, without storing that data into a file. - - - - Aside from the obvious differences in programming model, there are some - differences in capability between the ZipFile class and the - ZipInputStream class. - - - - - ZipFile can be used to create or update zip files, or read and extract - zip files. ZipInputStream can be used only to read and extract zip - files. If you want to use a stream to create zip files, check out the . - - - - ZipInputStream cannot read segmented or spanned - zip files. - - - - ZipInputStream will not read Zip file comments. - - - - When reading larger files, ZipInputStream will always underperform - ZipFile. This is because the ZipInputStream does a full scan on the - zip file, while the ZipFile class reads the central directory of the - zip file. - - - - - - - - The stream to read. It must be readable. This stream will be closed at - the time the ZipInputStream is closed. - - - - - This example shows how to read a zip file, and extract entries, using the - ZipInputStream class. - - - private void Unzip() - { - byte[] buffer= new byte[2048]; - int n; - using (var raw = File.Open(inputFileName, FileMode.Open, FileAccess.Read)) - { - using (var input= new ZipInputStream(raw)) - { - ZipEntry e; - while (( e = input.GetNextEntry()) != null) - { - if (e.IsDirectory) continue; - string outputPath = Path.Combine(extractDir, e.FileName); - using (var output = File.Open(outputPath, FileMode.Create, FileAccess.ReadWrite)) - { - while ((n= input.Read(buffer, 0, buffer.Length)) > 0) - { - output.Write(buffer,0,n); - } - } - } - } - } - } - - - - Private Sub UnZip() - Dim inputFileName As String = "MyArchive.zip" - Dim extractDir As String = "extract" - Dim buffer As Byte() = New Byte(2048) {} - Using raw As FileStream = File.Open(inputFileName, FileMode.Open, FileAccess.Read) - Using input As ZipInputStream = New ZipInputStream(raw) - Dim e As ZipEntry - Do While (Not e = input.GetNextEntry Is Nothing) - If Not e.IsDirectory Then - Using output As FileStream = File.Open(Path.Combine(extractDir, e.FileName), _ - FileMode.Create, FileAccess.ReadWrite) - Dim n As Integer - Do While (n = input.Read(buffer, 0, buffer.Length) > 0) - output.Write(buffer, 0, n) - Loop - End Using - End If - Loop - End Using - End Using - End Sub - - - - - - Create a ZipInputStream, given the name of an existing zip file. - - - - - - This constructor opens a FileStream for the given zipfile, and - wraps a ZipInputStream around that. See the documentation for the - constructor for full details. - - - - While the class is generally easier - to use, this class provides an alternative to those - applications that want to read from a zipfile directly, - using a . - - - - - - The name of the filesystem file to read. - - - - - This example shows how to read a zip file, and extract entries, using the - ZipInputStream class. - - - private void Unzip() - { - byte[] buffer= new byte[2048]; - int n; - using (var input= new ZipInputStream(inputFileName)) - { - ZipEntry e; - while (( e = input.GetNextEntry()) != null) - { - if (e.IsDirectory) continue; - string outputPath = Path.Combine(extractDir, e.FileName); - using (var output = File.Open(outputPath, FileMode.Create, FileAccess.ReadWrite)) - { - while ((n= input.Read(buffer, 0, buffer.Length)) > 0) - { - output.Write(buffer,0,n); - } - } - } - } - } - - - - Private Sub UnZip() - Dim inputFileName As String = "MyArchive.zip" - Dim extractDir As String = "extract" - Dim buffer As Byte() = New Byte(2048) {} - Using input As ZipInputStream = New ZipInputStream(inputFileName) - Dim e As ZipEntry - Do While (Not e = input.GetNextEntry Is Nothing) - If Not e.IsDirectory Then - Using output As FileStream = File.Open(Path.Combine(extractDir, e.FileName), _ - FileMode.Create, FileAccess.ReadWrite) - Dim n As Integer - Do While (n = input.Read(buffer, 0, buffer.Length) > 0) - output.Write(buffer, 0, n) - Loop - End Using - End If - Loop - End Using - End Sub - - - - - - Create a ZipInputStream, explicitly specifying whether to - keep the underlying stream open. - - - - See the documentation for the ZipInputStream(Stream) - constructor for a discussion of the class, and an example of how to use the class. - - - - The stream to read from. It must be readable. - - - - true if the application would like the stream - to remain open after the ZipInputStream has been closed. - - - - Provides a string representation of the instance. - - - This can be useful for debugging purposes. - - - a string representation of the instance. - - - - Read the data from the stream into the buffer. - - - - - The data for the zipentry will be decrypted and uncompressed, as - necessary, before being copied into the buffer. - - - - You must set the property before calling - Read() the first time for an encrypted entry. To determine if an - entry is encrypted and requires a password, check the ZipEntry.Encryption property. - - - - The buffer to hold the data read from the stream. - the offset within the buffer to copy the first byte read. - the number of bytes to read. - the number of bytes read, after decryption and decompression. - - - - Read the next entry from the zip file. - - - - - Call this method just before calling , - to position the pointer in the zip file to the next entry that can be - read. Subsequent calls to Read(), will decrypt and decompress the - data in the zip file, until Read() returns 0. - - - - Each time you call GetNextEntry(), the pointer in the wrapped - stream is moved to the next entry in the zip file. If you call , and thus re-position the pointer within - the file, you will need to call GetNextEntry() again, to insure - that the file pointer is positioned at the beginning of a zip entry. - - - - This method returns the ZipEntry. Using a stream approach, you will - read the raw bytes for an entry in a zip file via calls to Read(). - Alternatively, you can extract an entry into a file, or a stream, by - calling , or one of its siblings. - - - - - - The ZipEntry read. Returns null (or Nothing in VB) if there are no more - entries in the zip file. - - - - - - Dispose the stream. - - - - - This method disposes the ZipInputStream. It may also close the - underlying stream, depending on which constructor was used. - - - - Typically the application will call Dispose() implicitly, via - a using statement in C#, or a Using statement in VB. - - - - Application code won't call this code directly. This method may - be invoked in two distinct scenarios. If disposing == true, the - method has been called directly or indirectly by a user's code, - for example via the public Dispose() method. In this case, both - managed and unmanaged resources can be referenced and disposed. - If disposing == false, the method has been called by the runtime - from inside the object finalizer and this method should not - reference other objects; in that case only unmanaged resources - must be referenced or disposed. - - - - - true if the Dispose method was invoked by user code. - - - - - This is a no-op. - - - - - This method always throws a NotSupportedException. - - ignored - ignored - ignored - - - - This method seeks in the underlying stream. - - - - - Call this method if you want to seek around within the zip file for random access. - - - - Applications can intermix calls to Seek() with calls to . After a call to Seek(), - GetNextEntry() will get the next ZipEntry that falls after - the current position in the input stream. You're on your own for finding - out just where to seek in the stream, to get to the various entries. - - - - - the offset point to seek to - the reference point from which to seek - The new position - - - - This method always throws a NotSupportedException. - - ignored - - - - The text encoding to use when reading entries into the zip archive, for - those entries whose filenames or comments cannot be encoded with the - default (IBM437) encoding. - - - - - In its - zip specification, PKWare describes two options for encoding - filenames and comments: using IBM437 or UTF-8. But, some archiving tools - or libraries do not follow the specification, and instead encode - characters using the system default code page. For example, WinRAR when - run on a machine in Shanghai may encode filenames with the Big-5 Chinese - (950) code page. This behavior is contrary to the Zip specification, but - it occurs anyway. - - - - When using DotNetZip to read zip archives that use something other than - UTF-8 or IBM437, set this property to specify the code page to use when - reading encoded filenames and comments for each ZipEntry in the zip - file. - - - - This property is "provisional". When the entry in the zip archive is not - explicitly marked as using UTF-8, then IBM437 is used to decode filenames - and comments. If a loss of data would result from using IBM436 - - specifically when encoding and decoding is not reflexive - the codepage - specified here is used. It is possible, therefore, to have a given entry - with a Comment encoded in IBM437 and a FileName encoded with - the specified "provisional" codepage. - - - - When a zip file uses an arbitrary, non-UTF8 code page for encoding, there - is no standard way for the reader application - whether DotNetZip, WinZip, - WinRar, or something else - to know which codepage has been used for the - entries. Readers of zip files are not able to inspect the zip file and - determine the codepage that was used for the entries contained within it. - It is left to the application or user to determine the necessary codepage - when reading zip files encoded this way. If you use an incorrect codepage - when reading a zipfile, you will get entries with filenames that are - incorrect, and the incorrect filenames may even contain characters that - are not legal for use within filenames in Windows. Extracting entries with - illegal characters in the filenames will lead to exceptions. It's too bad, - but this is just the way things are with code pages in zip files. Caveat - Emptor. - - - - - - - Size of the work buffer to use for the ZLIB codec during decompression. - - - - Setting this affects the performance and memory efficiency of compression - and decompression. For larger files, setting this to a larger size may - improve performance, but the exact numbers vary depending on available - memory, and a bunch of other variables. I don't have good firm - recommendations on how to set it. You'll have to test it yourself. Or - just leave it alone and accept the default. - - - - - Sets the password to be used on the ZipInputStream instance. - - - - - - When reading a zip archive, this password is used to read and decrypt the - entries that are encrypted within the zip file. When entries within a zip - file use different passwords, set the appropriate password for the entry - before the first call to Read() for each entry. - - - - When reading an entry that is not encrypted, the value of this property is - ignored. - - - - - - - This example uses the ZipInputStream to read and extract entries from a - zip file, using a potentially different password for each entry. - - - byte[] buffer= new byte[2048]; - int n; - using (var raw = File.Open(_inputFileName, FileMode.Open, FileAccess.Read )) - { - using (var input= new ZipInputStream(raw)) - { - ZipEntry e; - while (( e = input.GetNextEntry()) != null) - { - input.Password = PasswordForEntry(e.FileName); - if (e.IsDirectory) continue; - string outputPath = Path.Combine(_extractDir, e.FileName); - using (var output = File.Open(outputPath, FileMode.Create, FileAccess.ReadWrite)) - { - while ((n= input.Read(buffer,0,buffer.Length)) > 0) - { - output.Write(buffer,0,n); - } - } - } - } - } - - - - - - - Always returns true. - - - - - Returns the value of CanSeek for the underlying (wrapped) stream. - - - - - Always returns false. - - - - - Returns the length of the underlying stream. - - - - - Gets or sets the position of the underlying stream. - - - Setting the position is equivalent to calling Seek(value, SeekOrigin.Begin). - - - - - Sort-of like a factory method, ForUpdate is used only when - the application needs to update the zip entry metadata for - a segmented zip file, when the starting segment is earlier - than the ending segment, for a particular entry. - - - - The update is always contiguous, never rolls over. As a - result, this method doesn't need to return a ZSS; it can - simply return a FileStream. That's why it's "sort of" - like a Factory method. - - - Caller must Close/Dispose the stream object returned by - this method. - - - - - - Read from the stream - - the buffer to read - the offset at which to start - the number of bytes to read - the number of bytes actually read - - - - Write to the stream. - - the buffer from which to write - the offset at which to start writing - the number of bytes to write - - - - Name of the filesystem file corresponding to the current segment. - - - - The name is not always the name currently being used in the - filesystem. When rwMode is RwMode.Write, the filesystem file has a - temporary name until the stream is closed or until the next segment is - started. - - - - - - This class exposes a set of COM-accessible wrappers for static - methods available on the ZipFile class. You don't need this - class unless you are using DotNetZip from a COM environment. - - - - - A wrapper for ZipFile.IsZipFile(string) - - The filename to of the zip file to check. - true if the file contains a valid zip file. - - - - A wrapper for ZipFile.IsZipFile(string, bool) - - - We cannot use "overloaded" Method names in COM interop. - So, here, we use a unique name. - - The filename to of the zip file to check. - true if the file contains a valid zip file. - - - - A wrapper for ZipFile.CheckZip(string) - - The filename to of the zip file to check. - - true if the named zip file checks OK. Otherwise, false. - - - - A COM-friendly wrapper for the static method . - - - The filename to of the zip file to check. - - The password to check. - - true if the named zip file checks OK. Otherwise, false. - - - - A wrapper for ZipFile.FixZipDirectory(string) - - The filename to of the zip file to fix. - - - - A wrapper for ZipFile.LibraryVersion - - - the version number on the DotNetZip assembly, formatted as a string. - - - - - An enum providing the options when an error occurs during opening or reading - of a file or directory that is being saved to a zip file. - - - - - This enum describes the actions that the library can take when an error occurs - opening or reading a file, as it is being saved into a Zip archive. - - - - In some cases an error will occur when DotNetZip tries to open a file to be - added to the zip archive. In other cases, an error might occur after the - file has been successfully opened, while DotNetZip is reading the file. - - - - The first problem might occur when calling AddDirectory() on a directory - that contains a Clipper .dbf file; the file is locked by Clipper and - cannot be opened by another process. An example of the second problem is - the ERROR_LOCK_VIOLATION that results when a file is opened by another - process, but not locked, and a range lock has been taken on the file. - Microsoft Outlook takes range locks on .PST files. - - - - - - Throw an exception when an error occurs while zipping. This is the default - behavior. (For COM clients, this is a 0 (zero).) - - - - - When an error occurs during zipping, for example a file cannot be opened, - skip the file causing the error, and continue zipping. (For COM clients, - this is a 1.) - - - - - When an error occurs during zipping, for example a file cannot be opened, - retry the operation that caused the error. Be careful with this option. If - the error is not temporary, the library will retry forever. (For COM - clients, this is a 2.) - - - - - When an error occurs, invoke the zipError event. The event type used is - . A typical use of this option: - a GUI application may wish to pop up a dialog to allow the user to view the - error that occurred, and choose an appropriate action. After your - processing in the error event, if you want to skip the file, set on the - ZipProgressEventArgs.CurrentEntry to Skip. If you want the - exception to be thrown, set ZipErrorAction on the CurrentEntry - to Throw. If you want to cancel the zip, set - ZipProgressEventArgs.Cancel to true. Cancelling differs from using - Skip in that a cancel will not save any further entries, if there are any. - (For COM clients, the value of this enum is a 3.) - - - - - An enum that provides the various encryption algorithms supported by this - library. - - - - - - PkzipWeak implies the use of Zip 2.0 encryption, which is known to be - weak and subvertible. - - - - A note on interoperability: Values of PkzipWeak and None are - specified in PKWARE's zip - specification, and are considered to be "standard". Zip archives - produced using these options will be interoperable with many other zip tools - and libraries, including Windows Explorer. - - - - Values of WinZipAes128 and WinZipAes256 are not part of the Zip - specification, but rather imply the use of a vendor-specific extension from - WinZip. If you want to produce interoperable Zip archives, do not use these - values. For example, if you produce a zip archive using WinZipAes256, you - will be able to open it in Windows Explorer on Windows XP and Vista, but you - will not be able to extract entries; trying this will lead to an "unspecified - error". For this reason, some people have said that a zip archive that uses - WinZip's AES encryption is not actually a zip archive at all. A zip archive - produced this way will be readable with the WinZip tool (Version 11 and - beyond). - - - - There are other third-party tools and libraries, both commercial and - otherwise, that support WinZip's AES encryption. These will be able to read - AES-encrypted zip archives produced by DotNetZip, and conversely applications - that use DotNetZip to read zip archives will be able to read AES-encrypted - archives produced by those tools or libraries. Consult the documentation for - those other tools and libraries to find out if WinZip's AES encryption is - supported. - - - - In case you care: According to the WinZip specification, the - actual AES key used is derived from the via an - algorithm that complies with RFC 2898, using an iteration - count of 1000. The algorithm is sometimes referred to as PBKDF2, which stands - for "Password Based Key Derivation Function #2". - - - - A word about password strength and length: The AES encryption technology is - very good, but any system is only as secure as the weakest link. If you want - to secure your data, be sure to use a password that is hard to guess. To make - it harder to guess (increase its "entropy"), you should make it longer. If - you use normal characters from an ASCII keyboard, a password of length 20 will - be strong enough that it will be impossible to guess. For more information on - that, I'd encourage you to read this - article. - - - - The WinZip AES algorithms are not supported with the version of DotNetZip that - runs on the .NET Compact Framework. This is because .NET CF lacks the - HMACSHA1 class that is required for producing the archive. - - - - - - No encryption at all. - - - - - Traditional or Classic pkzip encryption. - - - - - WinZip AES encryption (128 key bits). - - - - - WinZip AES encryption (256 key bits). - - - - - An encryption algorithm that is not supported by DotNetZip. - - - - - An enum for the options when extracting an entry would overwrite an existing file. - - - - - This enum describes the actions that the library can take when an - Extract() or ExtractWithPassword() method is called to extract an - entry to a filesystem, and the extraction would overwrite an existing filesystem - file. - - - - - - - Throw an exception when extraction would overwrite an existing file. (For - COM clients, this is a 0 (zero).) - - - - - When extraction would overwrite an existing file, overwrite the file silently. - The overwrite will happen even if the target file is marked as read-only. - (For COM clients, this is a 1.) - - - - - When extraction would overwrite an existing file, don't overwrite the file, silently. - (For COM clients, this is a 2.) - - - - - When extraction would overwrite an existing file, invoke the ExtractProgress - event, using an event type of . In - this way, the application can decide, just-in-time, whether to overwrite the - file. For example, a GUI application may wish to pop up a dialog to allow - the user to choose. You may want to examine the property before making - the decision. If, after your processing in the Extract progress event, you - want to NOT extract the file, set - on the ZipProgressEventArgs.CurrentEntry to DoNotOverwrite. - If you do want to extract the file, set ZipEntry.ExtractExistingFile - to OverwriteSilently. If you want to cancel the Extraction, set - ZipProgressEventArgs.Cancel to true. Cancelling differs from using - DoNotOverwrite in that a cancel will not extract any further entries, if - there are any. (For COM clients, the value of this enum is a 3.) - - - - - Enumerates the options for a logical conjunction. This enum is intended for use - internally by the FileSelector class. - - - - - FileSelector encapsulates logic that selects files from a source - a zip file - or the filesystem - based on a set of criteria. This class is used internally - by the DotNetZip library, in particular for the AddSelectedFiles() methods. - This class can also be used independently of the zip capability in DotNetZip. - - - - - - The FileSelector class is used internally by the ZipFile class for selecting - files for inclusion into the ZipFile, when the method, or one of - its overloads, is called. It's also used for the methods. Typically, an - application that creates or manipulates Zip archives will not directly - interact with the FileSelector class. - - - - Some applications may wish to use the FileSelector class directly, to - select files from disk volumes based on a set of criteria, without creating or - querying Zip archives. The file selection criteria include: a pattern to - match the filename; the last modified, created, or last accessed time of the - file; the size of the file; and the attributes of the file. - - - - Consult the documentation for - for more information on specifying the selection criteria. - - - - - - - Constructor that allows the caller to specify file selection criteria. - - - - - This constructor allows the caller to specify a set of criteria for - selection of files. - - - - See for a description of - the syntax of the selectionCriteria string. - - - - By default the FileSelector will traverse NTFS Reparse Points. To - change this, use FileSelector(String, bool). - - - - The criteria for file selection. - - - - Constructor that allows the caller to specify file selection criteria. - - - - - This constructor allows the caller to specify a set of criteria for - selection of files. - - - - See for a description of - the syntax of the selectionCriteria string. - - - - The criteria for file selection. - - whether to traverse NTFS reparse points (junctions). - - - - - Returns a string representation of the FileSelector object. - - The string representation of the boolean logic statement of the file - selection criteria for this instance. - - - - Returns the names of the files in the specified directory - that fit the selection criteria specified in the FileSelector. - - - - This is equivalent to calling - with recurseDirectories = false. - - - - The name of the directory over which to apply the FileSelector - criteria. - - - - A collection of strings containing fully-qualified pathnames of files - that match the criteria specified in the FileSelector instance. - - - - - Returns the names of the files in the specified directory that fit the - selection criteria specified in the FileSelector, optionally recursing - through subdirectories. - - - - This method applies the file selection criteria contained in the - FileSelector to the files contained in the given directory, and - returns the names of files that conform to the criteria. - - - - The name of the directory over which to apply the FileSelector - criteria. - - - - Whether to recurse through subdirectories when applying the file - selection criteria. - - - - A collection of strings containing fully-qualified pathnames of files - that match the criteria specified in the FileSelector instance. - - - - - Retrieve the ZipEntry items in the ZipFile that conform to the specified criteria. - - - - - This method applies the criteria set in the FileSelector instance (as described in - the ) to the specified ZipFile. Using this - method, for example, you can retrieve all entries from the given ZipFile that - have filenames ending in .txt. - - - - Normally, applications would not call this method directly. This method is used - by the ZipFile class. - - - - Using the appropriate SelectionCriteria, you can retrieve entries based on size, - time, and attributes. See for a - description of the syntax of the SelectionCriteria string. - - - - - The ZipFile from which to retrieve entries. - - a collection of ZipEntry objects that conform to the criteria. - - - - Retrieve the ZipEntry items in the ZipFile that conform to the specified criteria. - - - - - This method applies the criteria set in the FileSelector instance (as described in - the ) to the specified ZipFile. Using this - method, for example, you can retrieve all entries from the given ZipFile that - have filenames ending in .txt. - - - - Normally, applications would not call this method directly. This method is used - by the ZipFile class. - - - - This overload allows the selection of ZipEntry instances from the ZipFile to be restricted - to entries contained within a particular directory in the ZipFile. - - - - Using the appropriate SelectionCriteria, you can retrieve entries based on size, - time, and attributes. See for a - description of the syntax of the SelectionCriteria string. - - - - - The ZipFile from which to retrieve entries. - - - the directory in the archive from which to select entries. If null, then - all directories in the archive are used. - - - a collection of ZipEntry objects that conform to the criteria. - - - - The string specifying which files to include when retrieving. - - - - - Specify the criteria in statements of 3 elements: a noun, an operator, - and a value. Consider the string "name != *.doc" . The noun is - "name". The operator is "!=", implying "Not Equal". The value is - "*.doc". That criterion, in English, says "all files with a name that - does not end in the .doc extension." - - - - Supported nouns include "name" (or "filename") for the filename; - "atime", "mtime", and "ctime" for last access time, last modfied time, - and created time of the file, respectively; "attributes" (or "attrs") - for the file attributes; "size" (or "length") for the file length - (uncompressed); and "type" for the type of object, either a file or a - directory. The "attributes", "type", and "name" nouns all support = - and != as operators. The "size", "atime", "mtime", and "ctime" nouns - support = and !=, and >, >=, <, <= as well. The times are - taken to be expressed in local time. - - - - Specify values for the file attributes as a string with one or more of - the characters H,R,S,A,I,L in any order, implying file attributes of - Hidden, ReadOnly, System, Archive, NotContextIndexed, and ReparsePoint - (symbolic link) respectively. - - - - To specify a time, use YYYY-MM-DD-HH:mm:ss or YYYY/MM/DD-HH:mm:ss as - the format. If you omit the HH:mm:ss portion, it is assumed to be - 00:00:00 (midnight). - - - - The value for a size criterion is expressed in integer quantities of - bytes, kilobytes (use k or kb after the number), megabytes (m or mb), - or gigabytes (g or gb). - - - - The value for a name is a pattern to match against the filename, - potentially including wildcards. The pattern follows CMD.exe glob - rules: * implies one or more of any character, while ? implies one - character. If the name pattern contains any slashes, it is matched to - the entire filename, including the path; otherwise, it is matched - against only the filename without the path. This means a pattern of - "*\*.*" matches all files one directory level deep, while a pattern of - "*.*" matches all files in all directories. - - - - To specify a name pattern that includes spaces, use single quotes - around the pattern. A pattern of "'* *.*'" will match all files that - have spaces in the filename. The full criteria string for that would - be "name = '* *.*'" . - - - - The value for a type criterion is either F (implying a file) or D - (implying a directory). - - - - Some examples: - - - - - criteria - Files retrieved - - - - name != *.xls - any file with an extension that is not .xls - - - - - name = *.mp3 - any file with a .mp3 extension. - - - - - *.mp3 - (same as above) any file with a .mp3 extension. - - - - - attributes = A - all files whose attributes include the Archive bit. - - - - - attributes != H - all files whose attributes do not include the Hidden bit. - - - - - mtime > 2009-01-01 - all files with a last modified time after January 1st, 2009. - - - - - ctime > 2009/01/01-03:00:00 - all files with a created time after 3am (local time), - on January 1st, 2009. - - - - - size > 2gb - all files whose uncompressed size is greater than 2gb. - - - - - type = D - all directories in the filesystem. - - - - - - You can combine criteria with the conjunctions AND, OR, and XOR. Using - a string like "name = *.txt AND size >= 100k" for the - selectionCriteria retrieves entries whose names end in .txt, and whose - uncompressed size is greater than or equal to 100 kilobytes. - - - - For more complex combinations of criteria, you can use parenthesis to - group clauses in the boolean logic. Absent parenthesis, the - precedence of the criterion atoms is determined by order of - appearance. Unlike the C# language, the AND conjunction does not take - precendence over the logical OR. This is important only in strings - that contain 3 or more criterion atoms. In other words, "name = *.txt - and size > 1000 or attributes = H" implies "((name = *.txt AND size - > 1000) OR attributes = H)" while "attributes = H OR name = *.txt - and size > 1000" evaluates to "((attributes = H OR name = *.txt) - AND size > 1000)". When in doubt, use parenthesis. - - - - Using time properties requires some extra care. If you want to - retrieve all entries that were last updated on 2009 February 14, - specify "mtime >= 2009-02-14 AND mtime < 2009-02-15". Read this - to say: all files updated after 12:00am on February 14th, until - 12:00am on February 15th. You can use the same bracketing approach to - specify any time period - a year, a month, a week, and so on. - - - - The syntax allows one special case: if you provide a string with no - spaces, it is treated as a pattern to match for the filename. - Therefore a string like "*.xls" will be equivalent to specifying "name - = *.xls". This "shorthand" notation does not work with compound - criteria. - - - - There is no logic in this class that insures that the inclusion - criteria are internally consistent. For example, it's possible to - specify criteria that says the file must have a size of less than 100 - bytes, as well as a size that is greater than 1000 bytes. Obviously - no file will ever satisfy such criteria, but this class does not check - for or detect such inconsistencies. - - - - - - Thrown in the setter if the value has an invalid syntax. - - - - - Indicates whether searches will traverse NTFS reparse points, like Junctions. - - - - - Summary description for EnumUtil. - - - - - Returns the value of the DescriptionAttribute if the specified Enum - value has one. If not, returns the ToString() representation of the - Enum value. - - The Enum to get the description for - - - - - Converts the string representation of the name or numeric value of one - or more enumerated constants to an equivalent enumerated object. - Note: use the DescriptionAttribute on enum values to enable this. - - The System.Type of the enumeration. - - A string containing the name or value to convert. - - - - - - Converts the string representation of the name or numeric value of one - or more enumerated constants to an equivalent enumerated object. A - parameter specified whether the operation is case-sensitive. Note: - use the DescriptionAttribute on enum values to enable this. - - The System.Type of the enumeration. - - A string containing the name or value to convert. - - - Whether the operation is case-sensitive or not. - - - - - This is a helper class supporting WinZip AES encryption. - This class is intended for use only by the DotNetZip library. - - - - Most uses of the DotNetZip library will not involve direct calls into - the WinZipAesCrypto class. Instead, the WinZipAesCrypto class is - instantiated and used by the ZipEntry() class when WinZip AES - encryption or decryption on an entry is employed. - - - - - A stream that encrypts as it writes, or decrypts as it reads. The - Crypto is AES in CTR (counter) mode, which is compatible with the AES - encryption employed by WinZip 12.0. - - - - The AES/CTR encryption protocol used by WinZip works like this: - - - start with a counter, initialized to zero. - - - to encrypt, take the data by 16-byte blocks. For each block: - - apply the transform to the counter - - increement the counter - - XOR the result of the transform with the plaintext to - get the ciphertext. - - compute the mac on the encrypted bytes - - when finished with all blocks, store the computed MAC. - - - to decrypt, take the data by 16-byte blocks. For each block: - - compute the mac on the encrypted bytes, - - apply the transform to the counter - - increement the counter - - XOR the result of the transform with the ciphertext to - get the plaintext. - - when finished with all blocks, compare the computed MAC against - the stored MAC - - - - - - - The constructor. - - The underlying stream - To either encrypt or decrypt. - The pre-initialized WinZipAesCrypto object. - The maximum number of bytes to read from the stream. - - - - Close the stream. - - - - - Flush the content in the stream. - - - - - This method throws a NotImplementedException. - - - - - This method throws a NotImplementedException. - - - - - Returns the final HMAC-SHA1-80 for the data that was encrypted. - - - - - Returns true if the stream can be read. - - - - - Always returns false. - - - - - Returns true if the CryptoMode is Encrypt. - - - - - Getting this property throws a NotImplementedException. - - - - - Getting or Setting this property throws a NotImplementedException. - - - - - Issued when an ZipEntry.ExtractWithPassword() method is invoked - with an incorrect password. - - - - - Base class for all exceptions defined by and throw by the Zip library. - - - - - Default ctor. - - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The message in the exception. - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The message in the exception. - The innerException for this exception. - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The serialization info for the exception. - The streaming context from which to deserialize. - - - - Default ctor. - - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The message in the exception. - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The message in the exception. - The innerException for this exception. - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The serialization info for the exception. - The streaming context from which to deserialize. - - - - Indicates that a read was attempted on a stream, and bad or incomplete data was - received. - - - - - Default ctor. - - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The message in the exception. - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The message in the exception. - The innerException for this exception. - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The serialization info for the exception. - The streaming context from which to deserialize. - - - - Issued when an CRC check fails upon extracting an entry from a zip archive. - - - - - Default ctor. - - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The message in the exception. - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The serialization info for the exception. - The streaming context from which to deserialize. - - - - Issued when errors occur saving a self-extracting archive. - - - - - Default ctor. - - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The message in the exception. - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The serialization info for the exception. - The streaming context from which to deserialize. - - - - Indicates that an operation was attempted on a ZipFile which was not possible - given the state of the instance. For example, if you call Save() on a ZipFile - which has no filename set, you can get this exception. - - - - - Default ctor. - - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The message in the exception. - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The message in the exception. - The innerException for this exception. - - - - Come on, you know how exceptions work. Why are you looking at this documentation? - - The serialization info for the exception. - The streaming context from which to deserialize. - - - - Collects general purpose utility methods. - - - - private null constructor - - - - Utility routine for transforming path names from filesystem format (on Windows that means backslashes) to - a format suitable for use within zipfiles. This means trimming the volume letter and colon (if any) And - swapping backslashes for forward slashes. - - source path. - transformed path - - - - Finds a signature in the zip stream. This is useful for finding - the end of a zip entry, for example, or the beginning of the next ZipEntry. - - - - - Scans through 64k at a time. - - - - If the method fails to find the requested signature, the stream Position - after completion of this method is unchanged. If the method succeeds in - finding the requested signature, the stream position after completion is - direct AFTER the signature found in the stream. - - - - The stream to search - The 4-byte signature to find - The number of bytes read - - - - Create a pseudo-random filename, suitable for use as a temporary - file, and open it. - - - - The System.IO.Path.GetRandomFileName() method is not available on - the Compact Framework, so this library provides its own substitute - on NETCF. - - - This method produces a filename of the form - DotNetZip-xxxxxxxx.tmp, where xxxxxxxx is replaced by randomly - chosen characters, and creates that file. - - - - - - Workitem 7889: handle ERROR_LOCK_VIOLATION during read - - - This could be gracefully handled with an extension attribute, but - This assembly is built for .NET 2.0, so I cannot use them. - - - - - A decorator stream. It wraps another stream, and performs bookkeeping - to keep track of the stream Position. - - - - In some cases, it is not possible to get the Position of a stream, let's - say, on a write-only output stream like ASP.NET's - Response.OutputStream, or on a different write-only stream - provided as the destination for the zip by the application. In this - case, programmers can use this counting stream to count the bytes read - or written. - - - Consider the scenario of an application that saves a self-extracting - archive (SFX), that uses a custom SFX stub. - - - Saving to a filesystem file, the application would open the - filesystem file (getting a FileStream), save the custom sfx stub - into it, and then call ZipFile.Save(), specifying the same - FileStream. ZipFile.Save() does the right thing for the zipentry - offsets, by inquiring the Position of the FileStream before writing - any data, and then adding that initial offset into any ZipEntry - offsets in the zip directory. Everything works fine. - - - Now suppose the application is an ASPNET application and it saves - directly to Response.OutputStream. It's not possible for DotNetZip to - inquire the Position, so the offsets for the SFX will be wrong. - - - The workaround is for the application to use this class to wrap - HttpResponse.OutputStream, then write the SFX stub and the ZipFile - into that wrapper stream. Because ZipFile.Save() can inquire the - Position, it will then do the right thing with the offsets. - - - - - - The constructor. - - The underlying stream - - - - Adjust the byte count on the stream. - - - - the number of bytes to subtract from the count. - - - - - Subtract delta from the count of bytes written to the stream. - This is necessary when seeking back, and writing additional data, - as happens in some cases when saving Zip files. - - - - - - The read method. - - The buffer to hold the data read from the stream. - the offset within the buffer to copy the first byte read. - the number of bytes to read. - the number of bytes read, after decryption and decompression. - - - - Write data into the stream. - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Flushes the underlying stream. - - - - - Seek in the stream. - - the offset point to seek to - the reference point from which to seek - The new position - - - - Set the length of the underlying stream. Be careful with this! - - - the length to set on the underlying stream. - - - - Gets the wrapped stream. - - - - - The count of bytes written out to the stream. - - - - - the count of bytes that have been read from the stream. - - - - - Whether the stream can be read. - - - - - Whether it is possible to call Seek() on the stream. - - - - - Whether it is possible to call Write() on the stream. - - - - - The length of the underlying stream. - - - - - Returns the sum of number of bytes written, plus the initial - offset before writing. - - - - - The Position of the stream. - - - - - This class implements the "traditional" or "classic" PKZip encryption, - which today is considered to be weak. On the other hand it is - ubiquitous. This class is intended for use only by the DotNetZip - library. - - - - Most uses of the DotNetZip library will not involve direct calls into - the ZipCrypto class. Instead, the ZipCrypto class is instantiated and - used by the ZipEntry() class when encryption or decryption on an entry - is employed. If for some reason you really wanted to use a weak - encryption algorithm in some other application, you might use this - library. But you would be much better off using one of the built-in - strong encryption libraries in the .NET Framework, like the AES - algorithm or SHA. - - - - - The default constructor for ZipCrypto. - - - - This class is intended for internal use by the library only. It's - probably not useful to you. Seriously. Stop reading this - documentation. It's a waste of your time. Go do something else. - Check the football scores. Go get an ice cream with a friend. - Seriously. - - - - - - Call this method on a cipher text to render the plaintext. You must - first initialize the cipher with a call to InitCipher. - - - - - var cipher = new ZipCrypto(); - cipher.InitCipher(Password); - // Decrypt the header. This has a side effect of "further initializing the - // encryption keys" in the traditional zip encryption. - byte[] DecryptedMessage = cipher.DecryptMessage(EncryptedMessage); - - - - The encrypted buffer. - - The number of bytes to encrypt. - Should be less than or equal to CipherText.Length. - - - The plaintext. - - - - This is the converse of DecryptMessage. It encrypts the plaintext - and produces a ciphertext. - - - The plain text buffer. - - - The number of bytes to encrypt. - Should be less than or equal to plainText.Length. - - - The ciphertext. - - - - This initializes the cipher with the given password. - See AppNote.txt for details. - - - - The passphrase for encrypting or decrypting with this cipher. - - - - - Step 1 - Initializing the encryption keys - ----------------------------------------- - Start with these keys: - Key(0) := 305419896 (0x12345678) - Key(1) := 591751049 (0x23456789) - Key(2) := 878082192 (0x34567890) - - Then, initialize the keys with a password: - - loop for i from 0 to length(password)-1 - update_keys(password(i)) - end loop - - Where update_keys() is defined as: - - update_keys(char): - Key(0) := crc32(key(0),char) - Key(1) := Key(1) + (Key(0) bitwiseAND 000000ffH) - Key(1) := Key(1) * 134775813 + 1 - Key(2) := crc32(key(2),key(1) rightshift 24) - end update_keys - - Where crc32(old_crc,char) is a routine that given a CRC value and a - character, returns an updated CRC value after applying the CRC-32 - algorithm described elsewhere in this document. - - - - - After the keys are initialized, then you can use the cipher to - encrypt the plaintext. - - - - Essentially we encrypt the password with the keys, then discard the - ciphertext for the password. This initializes the keys for later use. - - - - - - - From AppNote.txt: - unsigned char decrypt_byte() - local unsigned short temp - temp :=- Key(2) | 2 - decrypt_byte := (temp * (temp ^ 1)) bitshift-right 8 - end decrypt_byte - - - - - A Stream for reading and concurrently decrypting data from a zip file, - or for writing and concurrently encrypting data to a zip file. - - - - The constructor. - The underlying stream - To either encrypt or decrypt. - The pre-initialized ZipCrypto object. - - - - Delegate in which the application writes the ZipEntry content for the named entry. - - - The name of the entry that must be written. - The stream to which the entry data should be written. - - - When you add an entry and specify a WriteDelegate, via , the application - code provides the logic that writes the entry data directly into the zip file. - - - - - This example shows how to define a WriteDelegate that obtains a DataSet, and then - writes the XML for the DataSet into the zip archive. There's no need to - save the XML to a disk file first. - - - private void WriteEntry (String filename, Stream output) - { - DataSet ds1 = ObtainDataSet(); - ds1.WriteXml(output); - } - - private void Run() - { - using (var zip = new ZipFile()) - { - zip.AddEntry(zipEntryName, WriteEntry); - zip.Save(zipFileName); - } - } - - - - Private Sub WriteEntry (ByVal filename As String, ByVal output As Stream) - DataSet ds1 = ObtainDataSet() - ds1.WriteXml(stream) - End Sub - - Public Sub Run() - Using zip = New ZipFile - zip.AddEntry(zipEntryName, New WriteDelegate(AddressOf WriteEntry)) - zip.Save(zipFileName) - End Using - End Sub - - - - - - - Delegate in which the application opens the stream, just-in-time, for the named entry. - - - - The name of the ZipEntry that the application should open the stream for. - - - - When you add an entry via , the application code provides the logic that - opens and closes the stream for the given ZipEntry. - - - - - - - Delegate in which the application closes the stream, just-in-time, for the named entry. - - - - The name of the ZipEntry that the application should close the stream for. - - - The stream to be closed. - - - When you add an entry via , the application code provides the logic that - opens and closes the stream for the given ZipEntry. - - - - - - - Delegate for the callback by which the application tells the - library the CompressionLevel to use for a file. - - - - - Using this callback, the application can, for example, specify that - previously-compressed files (.mp3, .png, .docx, etc) should use a - CompressionLevel of None, or can set the compression level based - on any other factor. - - - - - - - In an EventArgs type, indicates which sort of progress event is being - reported. - - - There are events for reading, events for saving, and events for - extracting. This enumeration allows a single EventArgs type to be sued to - describe one of multiple subevents. For example, a SaveProgress event is - invoked before, after, and during the saving of a single entry. The value - of an enum with this type, specifies which event is being triggered. The - same applies to Extraction, Reading and Adding events. - - - - - Indicates that a Add() operation has started. - - - - - Indicates that an individual entry in the archive has been added. - - - - - Indicates that a Add() operation has completed. - - - - - Indicates that a Read() operation has started. - - - - - Indicates that an individual entry in the archive is about to be read. - - - - - Indicates that an individual entry in the archive has just been read. - - - - - Indicates that a Read() operation has completed. - - - - - The given event reports the number of bytes read so far - during a Read() operation. - - - - - Indicates that a Save() operation has started. - - - - - Indicates that an individual entry in the archive is about to be written. - - - - - Indicates that an individual entry in the archive has just been saved. - - - - - Indicates that a Save() operation has completed. - - - - - Indicates that the zip archive has been created in a - temporary location during a Save() operation. - - - - - Indicates that the temporary file is about to be renamed to the final archive - name during a Save() operation. - - - - - Indicates that the temporary file is has just been renamed to the final archive - name during a Save() operation. - - - - - Indicates that the self-extracting archive has been compiled - during a Save() operation. - - - - - The given event is reporting the number of source bytes that have run through the compressor so far - during a Save() operation. - - - - - Indicates that an entry is about to be extracted. - - - - - Indicates that an entry has just been extracted. - - - - - Indicates that extraction of an entry would overwrite an existing - filesystem file. You must use - - ExtractExistingFileAction.InvokeExtractProgressEvent in the call - to ZipEntry.Extract() in order to receive this event. - - - - - The given event is reporting the number of bytes written so far for - the current entry during an Extract() operation. - - - - - Indicates that an ExtractAll operation is about to begin. - - - - - Indicates that an ExtractAll operation has completed. - - - - - Indicates that an error has occurred while saving a zip file. - This generally means the file cannot be opened, because it has been - removed, or because it is locked by another process. It can also - mean that the file cannot be Read, because of a range lock conflict. - - - - - Provides information about the progress of a save, read, or extract operation. - This is a base class; you will probably use one of the classes derived from this one. - - - - - The total number of entries to be saved or extracted. - - - - - The name of the last entry saved or extracted. - - - - - In an event handler, set this to cancel the save or extract - operation that is in progress. - - - - - The type of event being reported. - - - - - Returns the archive name associated to this event. - - - - - The number of bytes read or written so far for this entry. - - - - - Total number of bytes that will be read or written for this entry. - This number will be -1 if the value cannot be determined. - - - - - Provides information about the progress of a Read operation. - - - - - Provides information about the progress of a Add operation. - - - - - Provides information about the progress of a save operation. - - - - - Constructor for the SaveProgressEventArgs. - - the name of the zip archive. - whether this is before saving the entry, or after - The total number of entries in the zip archive. - Number of entries that have been saved. - The entry involved in the event. - - - - Number of entries saved so far. - - - - - Provides information about the progress of the extract operation. - - - - - Constructor for the ExtractProgressEventArgs. - - the name of the zip archive. - whether this is before saving the entry, or after - The total number of entries in the zip archive. - Number of entries that have been extracted. - The entry involved in the event. - The location to which entries are extracted. - - - - Number of entries extracted so far. This is set only if the - EventType is Extracting_BeforeExtractEntry or Extracting_AfterExtractEntry, and - the Extract() is occurring witin the scope of a call to ExtractAll(). - - - - - Returns the extraction target location, a filesystem path. - - - - - Provides information about the an error that occurred while zipping. - - - - - Returns the exception that occurred, if any. - - - - - Returns the name of the file that caused the exception, if any. - - - - - Represents a single entry in a ZipFile. Typically, applications get a ZipEntry - by enumerating the entries within a ZipFile, or by adding an entry to a ZipFile. - - - - - Reads one entry from the zip directory structure in the zip file. - - - - The zipfile for which a directory entry will be read. From this param, the - method gets the ReadStream and the expected text encoding - (ProvisionalAlternateEncoding) which is used if the entry is not marked - UTF-8. - - - - a list of previously seen entry names; used to prevent duplicates. - - - the entry read from the archive. - - - - Returns true if the passed-in value is a valid signature for a ZipDirEntry. - - the candidate 4-byte signature value. - true, if the signature is valid according to the PKWare spec. - - - - Default constructor. - - - Applications should never need to call this directly. It is exposed to - support COM Automation environments. - - - - - Sets the NTFS Creation, Access, and Modified times for the given entry. - - - - - When adding an entry from a file or directory, the Creation, Access, and - Modified times for the given entry are automatically set from the - filesystem values. When adding an entry from a stream or string, the - values are implicitly set to DateTime.Now. The application may wish to - set these values to some arbitrary value, before saving the archive, and - can do so using the various setters. If you want to set all of the times, - this method is more efficient. - - - - The values you set here will be retrievable with the , and properties. - - - - When this method is called, if both and are false, then the - EmitTimesInWindowsFormatWhenSaving flag is automatically set. - - - - DateTime values provided here without a DateTimeKind are assumed to be Local Time. - - - - the creation time of the entry. - the last access time of the entry. - the last modified time of the entry. - - - - - - - - - Provides a string representation of the instance. - a string representation of the instance. - - - - Extract the entry to the filesystem, starting at the current - working directory. - - - - This method has a bunch of overloads! One of them is sure to - be the right one for you... If you don't like these, check - out the ExtractWithPassword() methods. - - - - - - - - - This method extracts an entry from a zip file into the current - working directory. The path of the entry as extracted is the full - path as specified in the zip archive, relative to the current - working directory. After the file is extracted successfully, the - file attributes and timestamps are set. - - - - The action taken when extraction an entry would overwrite an - existing file is determined by the property. - - - - Within the call to Extract(), the content for the entry is - written into a filesystem file, and then the last modified time of the - file is set according to the property on - the entry. See the remarks the property for - some details about the last modified time. - - - - - - - Extract the entry to a file in the filesystem, using the specified - behavior when extraction would overwrite an existing file. - - - - - See the remarks on the property, for some - details about how the last modified time of the file is set after - extraction. - - - - - The action to take if extraction would overwrite an existing file. - - - - - Extracts the entry to the specified stream. - - - - - The caller can specify any write-able stream, for example a , a , or ASP.NET's - Response.OutputStream. The content will be decrypted and - decompressed as necessary. If the entry is encrypted and no password - is provided, this method will throw. - - - The position on the stream is not reset by this method before it extracts. - You may want to call stream.Seek() before calling ZipEntry.Extract(). - - - - - the stream to which the entry should be extracted. - - - - - - Extract the entry to the filesystem, starting at the specified base - directory. - - - the pathname of the base directory - - - - - - This example extracts only the entries in a zip file that are .txt files, - into a directory called "textfiles". - - using (ZipFile zip = ZipFile.Read("PackedDocuments.zip")) - { - foreach (string s1 in zip.EntryFilenames) - { - if (s1.EndsWith(".txt")) - { - zip[s1].Extract("textfiles"); - } - } - } - - - Using zip As ZipFile = ZipFile.Read("PackedDocuments.zip") - Dim s1 As String - For Each s1 In zip.EntryFilenames - If s1.EndsWith(".txt") Then - zip(s1).Extract("textfiles") - End If - Next - End Using - - - - - - - Using this method, existing entries in the filesystem will not be - overwritten. If you would like to force the overwrite of existing - files, see the property, or call - . - - - - See the remarks on the property, for some - details about how the last modified time of the created file is set. - - - - - - Extract the entry to the filesystem, starting at the specified base - directory, and using the specified behavior when extraction would - overwrite an existing file. - - - - - See the remarks on the property, for some - details about how the last modified time of the created file is set. - - - - - - String sZipPath = "Airborne.zip"; - String sFilePath = "Readme.txt"; - String sRootFolder = "Digado"; - using (ZipFile zip = ZipFile.Read(sZipPath)) - { - if (zip.EntryFileNames.Contains(sFilePath)) - { - // use the string indexer on the zip file - zip[sFileName].Extract(sRootFolder, - ExtractExistingFileAction.OverwriteSilently); - } - } - - - - Dim sZipPath as String = "Airborne.zip" - Dim sFilePath As String = "Readme.txt" - Dim sRootFolder As String = "Digado" - Using zip As ZipFile = ZipFile.Read(sZipPath) - If zip.EntryFileNames.Contains(sFilePath) - ' use the string indexer on the zip file - zip(sFilePath).Extract(sRootFolder, _ - ExtractExistingFileAction.OverwriteSilently) - End If - End Using - - - - the pathname of the base directory - - The action to take if extraction would overwrite an existing file. - - - - - Extract the entry to the filesystem, using the current working directory - and the specified password. - - - - This method has a bunch of overloads! One of them is sure to be - the right one for you... - - - - - - - - - Existing entries in the filesystem will not be overwritten. If you - would like to force the overwrite of existing files, see the property, or call - . - - - - See the remarks on the property for some - details about how the "last modified" time of the created file is - set. - - - - - In this example, entries that use encryption are extracted using a - particular password. - - using (var zip = ZipFile.Read(FilePath)) - { - foreach (ZipEntry e in zip) - { - if (e.UsesEncryption) - e.ExtractWithPassword("Secret!"); - else - e.Extract(); - } - } - - - Using zip As ZipFile = ZipFile.Read(FilePath) - Dim e As ZipEntry - For Each e In zip - If (e.UsesEncryption) - e.ExtractWithPassword("Secret!") - Else - e.Extract - End If - Next - End Using - - - The Password to use for decrypting the entry. - - - - Extract the entry to the filesystem, starting at the specified base - directory, and using the specified password. - - - - - - - - Existing entries in the filesystem will not be overwritten. If you - would like to force the overwrite of existing files, see the property, or call - . - - - - See the remarks on the property, for some - details about how the last modified time of the created file is set. - - - - The pathname of the base directory. - The Password to use for decrypting the entry. - - - - Extract the entry to a file in the filesystem, relative to the - current directory, using the specified behavior when extraction - would overwrite an existing file. - - - - - See the remarks on the property, for some - details about how the last modified time of the created file is set. - - - - The Password to use for decrypting the entry. - - - The action to take if extraction would overwrite an existing file. - - - - - Extract the entry to the filesystem, starting at the specified base - directory, and using the specified behavior when extraction would - overwrite an existing file. - - - - See the remarks on the property, for some - details about how the last modified time of the created file is set. - - - the pathname of the base directory - - The action to take if extraction would - overwrite an existing file. - - The Password to use for decrypting the entry. - - - - Extracts the entry to the specified stream, using the specified - Password. For example, the caller could extract to Console.Out, or - to a MemoryStream. - - - - - The caller can specify any write-able stream, for example a , a , or ASP.NET's - Response.OutputStream. The content will be decrypted and - decompressed as necessary. If the entry is encrypted and no password - is provided, this method will throw. - - - The position on the stream is not reset by this method before it extracts. - You may want to call stream.Seek() before calling ZipEntry.Extract(). - - - - - - the stream to which the entry should be extracted. - - - The password to use for decrypting the entry. - - - - - Opens a readable stream corresponding to the zip entry in the - archive. The stream decompresses and decrypts as necessary, as it - is read. - - - - - - DotNetZip offers a variety of ways to extract entries from a zip - file. This method allows an application to extract an entry by - reading a . - - - - The return value is of type . Use it as you would any - stream for reading. When an application calls on that stream, it will - receive data from the zip entry that is decrypted and decompressed - as necessary. - - - - CrcCalculatorStream adds one additional feature: it keeps a - CRC32 checksum on the bytes of the stream as it is read. The CRC - value is available in the property on the - CrcCalculatorStream. When the read is complete, your - application - should check this CRC against the - property on the ZipEntry to validate the content of the - ZipEntry. You don't have to validate the entry using the CRC, but - you should, to verify integrity. Check the example for how to do - this. - - - - If the entry is protected with a password, then you need to provide - a password prior to calling , either by - setting the property on the entry, or the - property on the ZipFile - itself. Or, you can use , the - overload of OpenReader that accepts a password parameter. - - - - If you want to extract entry data into a write-able stream that is - already opened, like a , do not - use this method. Instead, use . - - - - Your application may use only one stream created by OpenReader() at - a time, and you should not call other Extract methods before - completing your reads on a stream obtained from OpenReader(). This - is because there is really only one source stream for the compressed - content. A call to OpenReader() seeks in the source stream, to the - beginning of the compressed content. A subsequent call to - OpenReader() on a different entry will seek to a different position - in the source stream, as will a call to Extract() or one of its - overloads. This will corrupt the state for the decompressing stream - from the original call to OpenReader(). - - - - The OpenReader() method works only when the ZipEntry is - obtained from an instance of ZipFile. This method will throw - an exception if the ZipEntry is obtained from a . - - - - - This example shows how to open a zip archive, then read in a named - entry via a stream. After the read loop is complete, the code - compares the calculated during the read loop with the expected CRC - on the ZipEntry, to verify the extraction. - - using (ZipFile zip = new ZipFile(ZipFileToRead)) - { - ZipEntry e1= zip["Elevation.mp3"]; - using (Ionic.Zlib.CrcCalculatorStream s = e1.OpenReader()) - { - byte[] buffer = new byte[4096]; - int n, totalBytesRead= 0; - do { - n = s.Read(buffer,0, buffer.Length); - totalBytesRead+=n; - } while (n>0); - if (s.Crc32 != e1.Crc32) - throw new Exception(string.Format("The Zip Entry failed the CRC Check. (0x{0:X8}!=0x{1:X8})", s.Crc32, e1.Crc32)); - if (totalBytesRead != e1.UncompressedSize) - throw new Exception(string.Format("We read an unexpected number of bytes. ({0}!={1})", totalBytesRead, e1.UncompressedSize)); - } - } - - - Using zip As New ZipFile(ZipFileToRead) - Dim e1 As ZipEntry = zip.Item("Elevation.mp3") - Using s As Ionic.Zlib.CrcCalculatorStream = e1.OpenReader - Dim n As Integer - Dim buffer As Byte() = New Byte(4096) {} - Dim totalBytesRead As Integer = 0 - Do - n = s.Read(buffer, 0, buffer.Length) - totalBytesRead = (totalBytesRead + n) - Loop While (n > 0) - If (s.Crc32 <> e1.Crc32) Then - Throw New Exception(String.Format("The Zip Entry failed the CRC Check. (0x{0:X8}!=0x{1:X8})", s.Crc32, e1.Crc32)) - End If - If (totalBytesRead <> e1.UncompressedSize) Then - Throw New Exception(String.Format("We read an unexpected number of bytes. ({0}!={1})", totalBytesRead, e1.UncompressedSize)) - End If - End Using - End Using - - - - The Stream for reading. - - - - Opens a readable stream for an encrypted zip entry in the archive. - The stream decompresses and decrypts as necessary, as it is read. - - - - - See the documentation on the method for - full details. This overload allows the application to specify a - password for the ZipEntry to be read. - - - - The password to use for decrypting the entry. - The Stream for reading. - - - - Validates that the args are consistent. - - - Only one of {baseDir, outStream} can be non-null. - If baseDir is non-null, then the outputFile is created. - - - - - Reads one ZipEntry from the given stream. The content for - the entry does not get decompressed or decrypted. This method - basically reads metadata, and seeks. - - the ZipContainer this entry belongs to. - - true of this is the first entry being read from the stream. - - the ZipEntry read from the stream. - - - - Finds a particular segment in the given extra field. - This is used when modifying a previously-generated - extra field, in particular when removing the AES crypto - segment in the extra field. - - - - - At current cursor position in the stream, read the extra - field, and set the properties on the ZipEntry instance - appropriately. This can be called when processing the - Extra field in the Central Directory, or in the local - header. - - - - - generate and return a byte array that encodes the filename - for the entry. - - - - side effects: generate and store into _CommentBytes the - byte array for any comment attached to the entry. Also - sets _actualEncoding to indicate the actual encoding - used. The same encoding is used for both filename and - comment. - - - - - - Stores the position of the entry source stream, or, if the position is - already stored, seeks to that position. - - - - - This method is called in prep for reading the source stream. If PKZIP - encryption is used, then we need to calc the CRC32 before doing the - encryption, because the CRC is used in the 12th byte of the PKZIP - encryption header. So, we need to be able to seek backward in the source - when saving the ZipEntry. This method is called from the place that - calculates the CRC, and also from the method that does the encryption of - the file data. - - - - The first time through, this method sets the _sourceStreamOriginalPosition - field. Subsequent calls to this method seek to that position. - - - - - - Copy metadata that may have been changed by the app. We do this when - resetting the zipFile instance. If the app calls Save() on a ZipFile, then - tries to party on that file some more, we may need to Reset() it , which - means re-reading the entries and then copying the metadata. I think. - - - - - Set the input stream and get its length, if possible. The length is - used for progress updates, AND, to allow an optimization in case of - a stream/file of zero length. In that case we skip the Encrypt and - compression Stream. (like DeflateStream or BZip2OutputStream) - - - - - Prepare the given stream for output - wrap it in a CountingStream, and - then in a CRC stream, and an encryptor and deflator as appropriate. - - - - Previously this was used in ZipEntry.Write(), but in an effort to - introduce some efficiencies in that method I've refactored to put the - code inline. This method still gets called by ZipOutputStream. - - - - - - True if the referenced entry is a directory. - - - - - Provides a human-readable string with information about the ZipEntry. - - - - - The time and date at which the file indicated by the ZipEntry was - last modified. - - - - - The DotNetZip library sets the LastModified value for an entry, equal to - the Last Modified time of the file in the filesystem. If an entry is - added from a stream, the library uses System.DateTime.Now for this - value, for the given entry. - - - - This property allows the application to retrieve and possibly set the - LastModified value on an entry, to an arbitrary value. values with a - setting of DateTimeKind.Unspecified are taken to be expressed as - DateTimeKind.Local. - - - - Be aware that because of the way PKWare's - Zip specification describes how times are stored in the zip file, - the full precision of the System.DateTime datatype is not stored - for the last modified time when saving zip files. For more information on - how times are formatted, see the PKZip specification. - - - - The actual last modified time of a file can be stored in multiple ways in - the zip file, and they are not mutually exclusive: - - - - - In the so-called "DOS" format, which has a 2-second precision. Values - are rounded to the nearest even second. For example, if the time on the - file is 12:34:43, then it will be stored as 12:34:44. This first value - is accessible via the LastModified property. This value is always - present in the metadata for each zip entry. In some cases the value is - invalid, or zero. - - - - In the so-called "Windows" or "NTFS" format, as an 8-byte integer - quantity expressed as the number of 1/10 milliseconds (in other words - the number of 100 nanosecond units) since January 1, 1601 (UTC). This - format is how Windows represents file times. This time is accessible - via the ModifiedTime property. - - - - In the "Unix" format, a 4-byte quantity specifying the number of seconds since - January 1, 1970 UTC. - - - - In an older format, now deprecated but still used by some current - tools. This format is also a 4-byte quantity specifying the number of - seconds since January 1, 1970 UTC. - - - - - - Zip tools and libraries will always at least handle (read or write) the - DOS time, and may also handle the other time formats. Keep in mind that - while the names refer to particular operating systems, there is nothing in - the time formats themselves that prevents their use on other operating - systems. - - - - When reading ZIP files, the DotNetZip library reads the Windows-formatted - time, if it is stored in the entry, and sets both LastModified and - ModifiedTime to that value. When writing ZIP files, the DotNetZip - library by default will write both time quantities. It can also emit the - Unix-formatted time if desired (See .) - - - - The last modified time of the file created upon a call to - ZipEntry.Extract() may be adjusted during extraction to compensate - for differences in how the .NET Base Class Library deals with daylight - saving time (DST) versus how the Windows filesystem deals with daylight - saving time. Raymond Chen provides - some good context. - - - - In a nutshell: Daylight savings time rules change regularly. In 2007, for - example, the inception week of DST changed. In 1977, DST was in place all - year round. In 1945, likewise. And so on. Win32 does not attempt to - guess which time zone rules were in effect at the time in question. It - will render a time as "standard time" and allow the app to change to DST - as necessary. .NET makes a different choice. - - - - Compare the output of FileInfo.LastWriteTime.ToString("f") with what you - see in the Windows Explorer property sheet for a file that was last - written to on the other side of the DST transition. For example, suppose - the file was last modified on October 17, 2003, during DST but DST is not - currently in effect. Explorer's file properties reports Thursday, October - 17, 2003, 8:45:38 AM, but .NETs FileInfo reports Thursday, October 17, - 2003, 9:45 AM. - - - - Win32 says, "Thursday, October 17, 2002 8:45:38 AM PST". Note: Pacific - STANDARD Time. Even though October 17 of that year occurred during Pacific - Daylight Time, Win32 displays the time as standard time because that's - what time it is NOW. - - - - .NET BCL assumes that the current DST rules were in place at the time in - question. So, .NET says, "Well, if the rules in effect now were also in - effect on October 17, 2003, then that would be daylight time" so it - displays "Thursday, October 17, 2003, 9:45 AM PDT" - daylight time. - - - - So .NET gives a value which is more intuitively correct, but is also - potentially incorrect, and which is not invertible. Win32 gives a value - which is intuitively incorrect, but is strictly correct. - - - - Because of this funkiness, this library adds one hour to the LastModified - time on the extracted file, if necessary. That is to say, if the time in - question had occurred in what the .NET Base Class Library assumed to be - DST. This assumption may be wrong given the constantly changing DST rules, - but it is the best we can do. - - - - - - - - Last Modified time for the file represented by the entry. - - - - - - This value corresponds to the "last modified" time in the NTFS file times - as described in the Zip - specification. When getting this property, the value may be - different from . When setting the property, - the property also gets set, but with a lower - precision. - - - - Let me explain. It's going to take a while, so get - comfortable. Originally, waaaaay back in 1989 when the ZIP specification - was originally described by the esteemed Mr. Phil Katz, the dominant - operating system of the time was MS-DOS. MSDOS stored file times with a - 2-second precision, because, c'mon, who is ever going to need better - resolution than THAT? And so ZIP files, regardless of the platform on - which the zip file was created, store file times in exactly the same format that DOS used - in 1989. - - - - Since then, the ZIP spec has evolved, but the internal format for file - timestamps remains the same. Despite the fact that the way times are - stored in a zip file is rooted in DOS heritage, any program on any - operating system can format a time in this way, and most zip tools and - libraries DO - they round file times to the nearest even second and store - it just like DOS did 25+ years ago. - - - - PKWare extended the ZIP specification to allow a zip file to store what - are called "NTFS Times" and "Unix(tm) times" for a file. These are the - last write, last access, and file creation - times of a particular file. These metadata are not actually specific - to NTFS or Unix. They are tracked for each file by NTFS and by various - Unix filesystems, but they are also tracked by other filesystems, too. - The key point is that the times are formatted in the zip file - in the same way that NTFS formats the time (ticks since win32 epoch), - or in the same way that Unix formats the time (seconds since Unix - epoch). As with the DOS time, any tool or library running on any - operating system is capable of formatting a time in one of these ways - and embedding it into the zip file. - - - - These extended times are higher precision quantities than the DOS time. - As described above, the (DOS) LastModified has a precision of 2 seconds. - The Unix time is stored with a precision of 1 second. The NTFS time is - stored with a precision of 0.0000001 seconds. The quantities are easily - convertible, except for the loss of precision you may incur. - - - - A zip archive can store the {C,A,M} times in NTFS format, in Unix format, - or not at all. Often a tool running on Unix or Mac will embed the times - in Unix format (1 second precision), while WinZip running on Windows might - embed the times in NTFS format (precision of of 0.0000001 seconds). When - reading a zip file with these "extended" times, in either format, - DotNetZip represents the values with the - ModifiedTime, AccessedTime and CreationTime - properties on the ZipEntry. - - - - While any zip application or library, regardless of the platform it - runs on, could use any of the time formats allowed by the ZIP - specification, not all zip tools or libraries do support all these - formats. Storing the higher-precision times for each entry is - optional for zip files, and many tools and libraries don't use the - higher precision quantities at all. The old DOS time, represented by - , is guaranteed to be present, though it - sometimes unset. - - - - Ok, getting back to the question about how the LastModified - property relates to this ModifiedTime - property... LastModified is always set, while - ModifiedTime is not. (The other times stored in the NTFS - times extension, CreationTime and AccessedTime also - may not be set on an entry that is read from an existing zip file.) - When reading a zip file, then LastModified takes the DOS time - that is stored with the file. If the DOS time has been stored as zero - in the zipfile, then this library will use DateTime.Now for the - LastModified value. If the ZIP file was created by an evolved - tool, then there will also be higher precision NTFS or Unix times in - the zip file. In that case, this library will read those times, and - set LastModified and ModifiedTime to the same value, the - one corresponding to the last write time of the file. If there are no - higher precision times stored for the entry, then ModifiedTime - remains unset (likewise AccessedTime and CreationTime), - and LastModified keeps its DOS time. - - - - When creating zip files with this library, by default the extended time - properties (ModifiedTime, AccessedTime, and - CreationTime) are set on the ZipEntry instance, and these data are - stored in the zip archive for each entry, in NTFS format. If you add an - entry from an actual filesystem file, then the entry gets the actual file - times for that file, to NTFS-level precision. If you add an entry from a - stream, or a string, then the times get the value DateTime.Now. In - this case LastModified and ModifiedTime will be identical, - to 2 seconds of precision. You can explicitly set the - CreationTime, AccessedTime, and ModifiedTime of an - entry using the property setters. If you want to set all of those - quantities, it's more efficient to use the method. Those - changes are not made permanent in the zip file until you call or one of its cousins. - - - - When creating a zip file, you can override the default behavior of - this library for formatting times in the zip file, disabling the - embedding of file times in NTFS format or enabling the storage of file - times in Unix format, or both. You may want to do this, for example, - when creating a zip file on Windows, that will be consumed on a Mac, - by an application that is not hip to the "NTFS times" format. To do - this, use the and - properties. A valid zip - file may store the file times in both formats. But, there are no - guarantees that a program running on Mac or Linux will gracefully - handle the NTFS-formatted times when Unix times are present, or that a - non-DotNetZip-powered application running on Windows will be able to - handle file times in Unix format. DotNetZip will always do something - reasonable; other libraries or tools may not. When in doubt, test. - - - - I'll bet you didn't think one person could type so much about time, eh? - And reading it was so enjoyable, too! Well, in appreciation, maybe you - should donate? - - - - - - - - - - - Last Access time for the file represented by the entry. - - - This value may or may not be meaningful. If the ZipEntry was read from an existing - Zip archive, this information may not be available. For an explanation of why, see - . - - - - - - - - The file creation time for the file represented by the entry. - - - - This value may or may not be meaningful. If the ZipEntry was read - from an existing zip archive, and the creation time was not set on the entry - when the zip file was created, then this property may be meaningless. For an - explanation of why, see . - - - - - - - - Specifies whether the Creation, Access, and Modified times for the given - entry will be emitted in "Windows format" when the zip archive is saved. - - - - - An application creating a zip archive can use this flag to explicitly - specify that the file times for the entry should or should not be stored - in the zip archive in the format used by Windows. The default value of - this property is true. - - - - When adding an entry from a file or directory, the Creation (), Access (), and Modified - () times for the given entry are automatically - set from the filesystem values. When adding an entry from a stream or - string, all three values are implicitly set to DateTime.Now. Applications - can also explicitly set those times by calling . - - - - PKWARE's - zip specification describes multiple ways to format these times in a - zip file. One is the format Windows applications normally use: 100ns ticks - since Jan 1, 1601 UTC. The other is a format Unix applications typically - use: seconds since January 1, 1970 UTC. Each format can be stored in an - "extra field" in the zip entry when saving the zip archive. The former - uses an extra field with a Header Id of 0x000A, while the latter uses a - header ID of 0x5455. - - - - Not all zip tools and libraries can interpret these fields. Windows - compressed folders is one that can read the Windows Format timestamps, - while I believe the Infozip - tools can read the Unix format timestamps. Although the time values are - easily convertible, subject to a loss of precision, some tools and - libraries may be able to read only one or the other. DotNetZip can read or - write times in either or both formats. - - - - The times stored are taken from , , and . - - - - This property is not mutually exclusive from the property. It is - possible that a zip entry can embed the timestamps in both forms, one - form, or neither. But, there are no guarantees that a program running on - Mac or Linux will gracefully handle NTFS Formatted times, or that a - non-DotNetZip-powered application running on Windows will be able to - handle file times in Unix format. When in doubt, test. - - - - Normally you will use the ZipFile.EmitTimesInWindowsFormatWhenSaving - property, to specify the behavior for all entries in a zip, rather than - the property on each individual entry. - - - - - - - - - - - - - Specifies whether the Creation, Access, and Modified times for the given - entry will be emitted in "Unix(tm) format" when the zip archive is saved. - - - - - An application creating a zip archive can use this flag to explicitly - specify that the file times for the entry should or should not be stored - in the zip archive in the format used by Unix. By default this flag is - false, meaning the Unix-format times are not stored in the zip - archive. - - - - When adding an entry from a file or directory, the Creation (), Access (), and Modified - () times for the given entry are automatically - set from the filesystem values. When adding an entry from a stream or - string, all three values are implicitly set to DateTime.Now. Applications - can also explicitly set those times by calling . - - - - PKWARE's - zip specification describes multiple ways to format these times in a - zip file. One is the format Windows applications normally use: 100ns ticks - since Jan 1, 1601 UTC. The other is a format Unix applications typically - use: seconds since Jan 1, 1970 UTC. Each format can be stored in an - "extra field" in the zip entry when saving the zip archive. The former - uses an extra field with a Header Id of 0x000A, while the latter uses a - header ID of 0x5455. - - - - Not all tools and libraries can interpret these fields. Windows - compressed folders is one that can read the Windows Format timestamps, - while I believe the Infozip - tools can read the Unix format timestamps. Although the time values are - easily convertible, subject to a loss of precision, some tools and - libraries may be able to read only one or the other. DotNetZip can read or - write times in either or both formats. - - - - The times stored are taken from , , and . - - - - This property is not mutually exclusive from the property. It is - possible that a zip entry can embed the timestamps in both forms, one - form, or neither. But, there are no guarantees that a program running on - Mac or Linux will gracefully handle NTFS Formatted times, or that a - non-DotNetZip-powered application running on Windows will be able to - handle file times in Unix format. When in doubt, test. - - - - Normally you will use the ZipFile.EmitTimesInUnixFormatWhenSaving - property, to specify the behavior for all entries, rather than the - property on each individual entry. - - - - - - - - - - - - - The type of timestamp attached to the ZipEntry. - - - - This property is valid only for a ZipEntry that was read from a zip archive. - It indicates the type of timestamp attached to the entry. - - - - - - - - The file attributes for the entry. - - - - - - The attributes in NTFS include - ReadOnly, Archive, Hidden, System, and Indexed. When adding a - ZipEntry to a ZipFile, these attributes are set implicitly when - adding an entry from the filesystem. When adding an entry from a stream - or string, the Attributes are not set implicitly. Regardless of the way - an entry was added to a ZipFile, you can set the attributes - explicitly if you like. - - - - When reading a ZipEntry from a ZipFile, the attributes are - set according to the data stored in the ZipFile. If you extract the - entry from the archive to a filesystem file, DotNetZip will set the - attributes on the resulting file accordingly. - - - - The attributes can be set explicitly by the application. For example the - application may wish to set the FileAttributes.ReadOnly bit for all - entries added to an archive, so that on unpack, this attribute will be set - on the extracted file. Any changes you make to this property are made - permanent only when you call a Save() method on the ZipFile - instance that contains the ZipEntry. - - - - For example, an application may wish to zip up a directory and set the - ReadOnly bit on every file in the archive, so that upon later extraction, - the resulting files will be marked as ReadOnly. Not every extraction tool - respects these attributes, but if you unpack with DotNetZip, as for - example in a self-extracting archive, then the attributes will be set as - they are stored in the ZipFile. - - - - These attributes may not be interesting or useful if the resulting archive - is extracted on a non-Windows platform. How these attributes get used - upon extraction depends on the platform and tool used. - - - - This property is only partially supported in the Silverlight version - of the library: applications can read attributes on entries within - ZipFiles. But extracting entries within Silverlight will not set the - attributes on the extracted files. - - - - - - - The name of the filesystem file, referred to by the ZipEntry. - - - - - This property specifies the thing-to-be-zipped on disk, and is set only - when the ZipEntry is being created from a filesystem file. If the - ZipFile is instantiated by reading an existing .zip archive, then - the LocalFileName will be null (Nothing in VB). - - - - When it is set, the value of this property may be different than , which is the path used in the archive itself. If you - call Zip.AddFile("foop.txt", AlternativeDirectory), then the path - used for the ZipEntry within the zip archive will be different - than this path. - - - - If the entry is being added from a stream, then this is null (Nothing in VB). - - - - - - - - The name of the file contained in the ZipEntry. - - - - - - This is the name of the entry in the ZipFile itself. When creating - a zip archive, if the ZipEntry has been created from a filesystem - file, via a call to or , or a related overload, the value - of this property is derived from the name of that file. The - FileName property does not include drive letters, and may include a - different directory path, depending on the value of the - directoryPathInArchive parameter used when adding the entry into - the ZipFile. - - - - In some cases there is no related filesystem file - for example when a - ZipEntry is created using or one of the similar overloads. In this case, the value of - this property is derived from the fileName and the directory path passed - to that method. - - - - When reading a zip file, this property takes the value of the entry name - as stored in the zip file. If you extract such an entry, the extracted - file will take the name given by this property. - - - - Applications can set this property when creating new zip archives or when - reading existing archives. When setting this property, the actual value - that is set will replace backslashes with forward slashes, in accordance - with the Zip - specification, for compatibility with Unix(tm) and ... get - this.... Amiga! - - - - If an application reads a ZipFile via or a related overload, and then explicitly - sets the FileName on an entry contained within the ZipFile, and - then calls , the application will effectively - rename the entry within the zip archive. - - - - If an application sets the value of FileName, then calls - Extract() on the entry, the entry is extracted to a file using the - newly set value as the filename. The FileName value is made - permanent in the zip archive only after a call to one of the - ZipFile.Save() methods on the ZipFile that contains the - ZipEntry. - - - - If an application attempts to set the FileName to a value that - would result in a duplicate entry in the ZipFile, an exception is - thrown. - - - - When a ZipEntry is contained within a ZipFile, applications - cannot rename the entry within the context of a foreach (For - Each in VB) loop, because of the way the ZipFile stores - entries. If you need to enumerate through all the entries and rename one - or more of them, use ZipFile.EntriesSorted as the - collection. See also, ZipFile.GetEnumerator(). - - - - - - - The stream that provides content for the ZipEntry. - - - - - - The application can use this property to set the input stream for an - entry on a just-in-time basis. Imagine a scenario where the application - creates a ZipFile comprised of content obtained from hundreds of - files, via calls to AddFile(). The DotNetZip library opens streams - on these files on a just-in-time basis, only when writing the entry out to - an external store within the scope of a ZipFile.Save() call. Only - one input stream is opened at a time, as each entry is being written out. - - - - Now imagine a different application that creates a ZipFile - with content obtained from hundreds of streams, added through . Normally the - application would supply an open stream to that call. But when large - numbers of streams are being added, this can mean many open streams at one - time, unnecessarily. - - - - To avoid this, call and specify delegates that open and close the stream at - the time of Save. - - - - - Setting the value of this property when the entry was not added from a - stream (for example, when the ZipEntry was added with or , or when the entry was added by - reading an existing zip archive) will throw an exception. - - - - - - - - A flag indicating whether the InputStream was provided Just-in-time. - - - - - - When creating a zip archive, an application can obtain content for one or - more of the ZipEntry instances from streams, using the method. At the time - of calling that method, the application can supply null as the value of - the stream parameter. By doing so, the application indicates to the - library that it will provide a stream for the entry on a just-in-time - basis, at the time one of the ZipFile.Save() methods is called and - the data for the various entries are being compressed and written out. - - - - In this case, the application can set the - property, typically within the SaveProgress event (event type: ) for that entry. - - - - The application will later want to call Close() and Dispose() on that - stream. In the SaveProgress event, when the event type is , the application can - do so. This flag indicates that the stream has been provided by the - application on a just-in-time basis and that it is the application's - responsibility to call Close/Dispose on that stream. - - - - - - - - An enum indicating the source of the ZipEntry. - - - - - The version of the zip engine needed to read the ZipEntry. - - - - - This is a readonly property, indicating the version of the Zip - specification that the extracting tool or library must support to - extract the given entry. Generally higher versions indicate newer - features. Older zip engines obviously won't know about new features, and - won't be able to extract entries that depend on those newer features. - - - - - value - Features - - - - 20 - a basic Zip Entry, potentially using PKZIP encryption. - - - - - 45 - The ZIP64 extension is used on the entry. - - - - - 46 - File is compressed using BZIP2 compression* - - - - 50 - File is encrypted using PkWare's DES, 3DES, (broken) RC2 or RC4 - - - - 51 - File is encrypted using PKWare's AES encryption or corrected RC2 encryption. - - - - 52 - File is encrypted using corrected RC2-64 encryption** - - - - 61 - File is encrypted using non-OAEP key wrapping*** - - - - 63 - File is compressed using LZMA, PPMd+, Blowfish, or Twofish - - - - - - There are other values possible, not listed here. DotNetZip supports - regular PKZip encryption, and ZIP64 extensions. DotNetZip cannot extract - entries that require a zip engine higher than 45. - - - - This value is set upon reading an existing zip file, or after saving a zip - archive. - - - - - - The comment attached to the ZipEntry. - - - - - Each entry in a zip file can optionally have a comment associated to - it. The comment might be displayed by a zip tool during extraction, for - example. - - - - By default, the Comment is encoded in IBM437 code page. You can - specify an alternative with and - . - - - - - - - - Indicates whether the entry requires ZIP64 extensions. - - - - - - This property is null (Nothing in VB) until a Save() method on the - containing instance has been called. The property is - non-null (HasValue is true) only after a Save() method has - been called. - - - - After the containing ZipFile has been saved, the Value of this - property is true if any of the following three conditions holds: the - uncompressed size of the entry is larger than 0xFFFFFFFF; the compressed - size of the entry is larger than 0xFFFFFFFF; the relative offset of the - entry within the zip archive is larger than 0xFFFFFFFF. These quantities - are not known until a Save() is attempted on the zip archive and - the compression is applied. - - - - If none of the three conditions holds, then the Value is false. - - - - A Value of false does not indicate that the entry, as saved in the - zip archive, does not use ZIP64. It merely indicates that ZIP64 is - not required. An entry may use ZIP64 even when not required if - the property on the containing - ZipFile instance is set to , or if - the property on the containing - ZipFile instance is set to - and the output stream was not seekable. - - - - - - - - Indicates whether the entry actually used ZIP64 extensions, as it was most - recently written to the output file or stream. - - - - - - This Nullable property is null (Nothing in VB) until a Save() - method on the containing instance has been - called. HasValue is true only after a Save() method has been - called. - - - - The value of this property for a particular ZipEntry may change - over successive calls to Save() methods on the containing ZipFile, - even if the file that corresponds to the ZipEntry does not. This - may happen if other entries contained in the ZipFile expand, - causing the offset for this particular entry to exceed 0xFFFFFFFF. - - - - - - - The bitfield for the entry as defined in the zip spec. You probably - never need to look at this. - - - - - You probably do not need to concern yourself with the contents of this - property, but in case you do: - - - - - bit - meaning - - - - 0 - set if encryption is used. - - - - 1-2 - - set to determine whether normal, max, fast deflation. DotNetZip library - always leaves these bits unset when writing (indicating "normal" - deflation"), but can read an entry with any value here. - - - - - 3 - - Indicates that the Crc32, Compressed and Uncompressed sizes are zero in the - local header. This bit gets set on an entry during writing a zip file, when - it is saved to a non-seekable output stream. - - - - - - 4 - reserved for "enhanced deflating". This library doesn't do enhanced deflating. - - - - 5 - set to indicate the zip is compressed patched data. This library doesn't do that. - - - - 6 - - set if PKWare's strong encryption is used (must also set bit 1 if bit 6 is - set). This bit is not set if WinZip's AES encryption is set. - - - - 7 - not used - - - - 8 - not used - - - - 9 - not used - - - - 10 - not used - - - - 11 - - Language encoding flag (EFS). If this bit is set, the filename and comment - fields for this file must be encoded using UTF-8. This library currently - does not support UTF-8. - - - - - 12 - Reserved by PKWARE for enhanced compression. - - - - 13 - - Used when encrypting the Central Directory to indicate selected data - values in the Local Header are masked to hide their actual values. See - the section in the Zip - specification describing the Strong Encryption Specification for - details. - - - - - 14 - Reserved by PKWARE. - - - - 15 - Reserved by PKWARE. - - - - - - - - - The compression method employed for this ZipEntry. - - - - - - The - Zip specification allows a variety of compression methods. This - library supports just two: 0x08 = Deflate. 0x00 = Store (no compression), - for reading or writing. - - - - When reading an entry from an existing zipfile, the value you retrieve - here indicates the compression method used on the entry by the original - creator of the zip. When writing a zipfile, you can specify either 0x08 - (Deflate) or 0x00 (None). If you try setting something else, you will get - an exception. - - - - You may wish to set CompressionMethod to CompressionMethod.None (0) - when zipping already-compressed data like a jpg, png, or mp3 file. - This can save time and cpu cycles. - - - - When setting this property on a ZipEntry that is read from an - existing zip file, calling ZipFile.Save() will cause the new - CompressionMethod to be used on the entry in the newly saved zip file. - - - - Setting this property may have the side effect of modifying the - CompressionLevel property. If you set the CompressionMethod to a - value other than None, and CompressionLevel is previously - set to None, then CompressionLevel will be set to - Default. - - - - - - - In this example, the first entry added to the zip archive uses the default - behavior - compression is used where it makes sense. The second entry, - the MP3 file, is added to the archive without being compressed. - - using (ZipFile zip = new ZipFile(ZipFileToCreate)) - { - ZipEntry e1= zip.AddFile(@"notes\Readme.txt"); - ZipEntry e2= zip.AddFile(@"music\StopThisTrain.mp3"); - e2.CompressionMethod = CompressionMethod.None; - zip.Save(); - } - - - - Using zip As New ZipFile(ZipFileToCreate) - zip.AddFile("notes\Readme.txt") - Dim e2 as ZipEntry = zip.AddFile("music\StopThisTrain.mp3") - e2.CompressionMethod = CompressionMethod.None - zip.Save - End Using - - - - - - Sets the compression level to be used for the entry when saving the zip - archive. This applies only for CompressionMethod = DEFLATE. - - - - - When using the DEFLATE compression method, Varying the compression - level used on entries can affect the size-vs-speed tradeoff when - compression and decompressing data streams or files. - - - - If you do not set this property, the default compression level is used, - which normally gives a good balance of compression efficiency and - compression speed. In some tests, using BestCompression can - double the time it takes to compress, while delivering just a small - increase in compression efficiency. This behavior will vary with the - type of data you compress. If you are in doubt, just leave this setting - alone, and accept the default. - - - - When setting this property on a ZipEntry that is read from an - existing zip file, calling ZipFile.Save() will cause the new - CompressionLevel to be used on the entry in the newly saved zip file. - - - - Setting this property may have the side effect of modifying the - CompressionMethod property. If you set the CompressionLevel - to a value other than None, CompressionMethod will be set - to Deflate, if it was previously None. - - - - Setting this property has no effect if the CompressionMethod is something - other than Deflate or None. - - - - - - - - The compressed size of the file, in bytes, within the zip archive. - - - - When reading a ZipFile, this value is read in from the existing - zip file. When creating or updating a ZipFile, the compressed - size is computed during compression. Therefore the value on a - ZipEntry is valid after a call to Save() (or one of its - overloads) in that case. - - - - - - - The size of the file, in bytes, before compression, or after extraction. - - - - When reading a ZipFile, this value is read in from the existing - zip file. When creating or updating a ZipFile, the uncompressed - size is computed during compression. Therefore the value on a - ZipEntry is valid after a call to Save() (or one of its - overloads) in that case. - - - - - - - The ratio of compressed size to uncompressed size of the ZipEntry. - - - - - This is a ratio of the compressed size to the uncompressed size of the - entry, expressed as a double in the range of 0 to 100+. A value of 100 - indicates no compression at all. It could be higher than 100 when the - compression algorithm actually inflates the data, as may occur for small - files, or uncompressible data that is encrypted. - - - - You could format it for presentation to a user via a format string of - "{3,5:F0}%" to see it as a percentage. - - - - If the size of the original uncompressed file is 0, implying a - denominator of 0, the return value will be zero. - - - - This property is valid after reading in an existing zip file, or after - saving the ZipFile that contains the ZipEntry. You cannot know the - effect of a compression transform until you try it. - - - - - - - The 32-bit CRC (Cyclic Redundancy Check) on the contents of the ZipEntry. - - - - - You probably don't need to concern yourself with this. It is used - internally by DotNetZip to verify files or streams upon extraction. - - The value is a 32-bit - CRC using 0xEDB88320 for the polynomial. This is the same CRC-32 used in - PNG, MPEG-2, and other protocols and formats. It is a read-only property; when - creating a Zip archive, the CRC for each entry is set only after a call to - Save() on the containing ZipFile. When reading an existing zip file, the value - of this property reflects the stored CRC for the entry. - - - - - - True if the entry is a directory (not a file). - This is a readonly property on the entry. - - - - - A derived property that is true if the entry uses encryption. - - - - - This is a readonly property on the entry. When reading a zip file, - the value for the ZipEntry is determined by the data read - from the zip file. After saving a ZipFile, the value of this - property for each ZipEntry indicates whether encryption was - actually used (which will have been true if the was set and the property - was something other than . - - - - - - Set this to specify which encryption algorithm to use for the entry when - saving it to a zip archive. - - - - - - Set this property in order to encrypt the entry when the ZipFile is - saved. When setting this property, you must also set a on the entry. If you set a value other than on this property and do not set a - Password then the entry will not be encrypted. The ZipEntry - data is encrypted as the ZipFile is saved, when you call or one of its cousins on the containing - ZipFile instance. You do not need to specify the Encryption - when extracting entries from an archive. - - - - The Zip specification from PKWare defines a set of encryption algorithms, - and the data formats for the zip archive that support them, and PKWare - supports those algorithms in the tools it produces. Other vendors of tools - and libraries, such as WinZip or Xceed, typically support a - subset of the algorithms specified by PKWare. These tools can - sometimes support additional different encryption algorithms and data - formats, not specified by PKWare. The AES Encryption specified and - supported by WinZip is the most popular example. This library supports a - subset of the complete set of algorithms specified by PKWare and other - vendors. - - - - There is no common, ubiquitous multi-vendor standard for strong encryption - within zip files. There is broad support for so-called "traditional" Zip - encryption, sometimes called Zip 2.0 encryption, as specified - by PKWare, but this encryption is considered weak and - breakable. This library currently supports the Zip 2.0 "weak" encryption, - and also a stronger WinZip-compatible AES encryption, using either 128-bit - or 256-bit key strength. If you want DotNetZip to support an algorithm - that is not currently supported, call the author of this library and maybe - we can talk business. - - - - The class also has a property. In most cases you will use - that property when setting encryption. This property takes - precedence over any Encryption set on the ZipFile itself. - Typically, you would use the per-entry Encryption when most entries in the - zip archive use one encryption algorithm, and a few entries use a - different one. If all entries in the zip file use the same Encryption, - then it is simpler to just set this property on the ZipFile itself, when - creating a zip archive. - - - - Some comments on updating archives: If you read a ZipFile, you can - modify the Encryption on an encrypted entry: you can remove encryption - from an entry that was encrypted; you can encrypt an entry that was not - encrypted previously; or, you can change the encryption algorithm. The - changes in encryption are not made permanent until you call Save() on the - ZipFile. To effect changes in encryption, the entry content is - streamed through several transformations, depending on the modification - the application has requested. For example if the entry is not encrypted - and the application sets Encryption to PkzipWeak, then at - the time of Save(), the original entry is read and decompressed, - then re-compressed and encrypted. Conversely, if the original entry is - encrypted with PkzipWeak encryption, and the application sets the - Encryption property to WinZipAes128, then at the time of - Save(), the original entry is decrypted via PKZIP encryption and - decompressed, then re-compressed and re-encrypted with AES. This all - happens automatically within the library, but it can be time-consuming for - large entries. - - - - Additionally, when updating archives, it is not possible to change the - password when changing the encryption algorithm. To change both the - algorithm and the password, you need to Save() the zipfile twice. First - set the Encryption to None, then call Save(). Then set the - Encryption to the new value (not "None"), then call Save() - once again. - - - - The WinZip AES encryption algorithms are not supported on the .NET Compact - Framework. - - - - - - This example creates a zip archive that uses encryption, and then extracts - entries from the archive. When creating the zip archive, the ReadMe.txt - file is zipped without using a password or encryption. The other file - uses encryption. - - - // Create a zip archive with AES Encryption. - using (ZipFile zip = new ZipFile()) - { - zip.AddFile("ReadMe.txt") - ZipEntry e1= zip.AddFile("2008-Regional-Sales-Report.pdf"); - e1.Encryption= EncryptionAlgorithm.WinZipAes256; - e1.Password= "Top.Secret.No.Peeking!"; - zip.Save("EncryptedArchive.zip"); - } - - // Extract a zip archive that uses AES Encryption. - // You do not need to specify the algorithm during extraction. - using (ZipFile zip = ZipFile.Read("EncryptedArchive.zip")) - { - // Specify the password that is used during extraction, for - // all entries that require a password: - zip.Password= "Top.Secret.No.Peeking!"; - zip.ExtractAll("extractDirectory"); - } - - - - ' Create a zip that uses Encryption. - Using zip As New ZipFile() - zip.AddFile("ReadMe.txt") - Dim e1 as ZipEntry - e1= zip.AddFile("2008-Regional-Sales-Report.pdf") - e1.Encryption= EncryptionAlgorithm.WinZipAes256 - e1.Password= "Top.Secret.No.Peeking!" - zip.Save("EncryptedArchive.zip") - End Using - - ' Extract a zip archive that uses AES Encryption. - ' You do not need to specify the algorithm during extraction. - Using (zip as ZipFile = ZipFile.Read("EncryptedArchive.zip")) - ' Specify the password that is used during extraction, for - ' all entries that require a password: - zip.Password= "Top.Secret.No.Peeking!" - zip.ExtractAll("extractDirectory") - End Using - - - - - - Thrown in the setter if EncryptionAlgorithm.Unsupported is specified. - - - ZipEntry.Password - ZipFile.Encryption - - - - The Password to be used when encrypting a ZipEntry upon - ZipFile.Save(), or when decrypting an entry upon Extract(). - - - - - This is a write-only property on the entry. Set this to request that the - entry be encrypted when writing the zip archive, or set it to specify the - password to be used when extracting an existing entry that is encrypted. - - - - The password set here is implicitly used to encrypt the entry during the - operation, or to decrypt during the or operation. If you set - the Password on a ZipEntry after calling Save(), there is no - effect. - - - - Consider setting the property when using a - password. Answering concerns that the standard password protection - supported by all zip tools is weak, WinZip has extended the ZIP - specification with a way to use AES Encryption to protect entries in the - Zip file. Unlike the "PKZIP 2.0" encryption specified in the PKZIP - specification, AES - Encryption uses a standard, strong, tested, encryption - algorithm. DotNetZip can create zip archives that use WinZip-compatible - AES encryption, if you set the property. But, - archives created that use AES encryption may not be readable by all other - tools and libraries. For example, Windows Explorer cannot read a - "compressed folder" (a zip file) that uses AES encryption, though it can - read a zip file that uses "PKZIP encryption." - - - - The class also has a - property. This property takes precedence over any password set on the - ZipFile itself. Typically, you would use the per-entry Password when most - entries in the zip archive use one password, and a few entries use a - different password. If all entries in the zip file use the same password, - then it is simpler to just set this property on the ZipFile itself, - whether creating a zip archive or extracting a zip archive. - - - - Some comments on updating archives: If you read a ZipFile, you - cannot modify the password on any encrypted entry, except by extracting - the entry with the original password (if any), removing the original entry - via , and then adding a new - entry with a new Password. - - - - For example, suppose you read a ZipFile, and there is an encrypted - entry. Setting the Password property on that ZipEntry and then - calling Save() on the ZipFile does not update the password - on that entry in the archive. Neither is an exception thrown. Instead, - what happens during the Save() is the existing entry is copied - through to the new zip archive, in its original encrypted form. Upon - re-reading that archive, the entry can be decrypted with its original - password. - - - - If you read a ZipFile, and there is an un-encrypted entry, you can set the - Password on the entry and then call Save() on the ZipFile, and get - encryption on that entry. - - - - - - - This example creates a zip file with two entries, and then extracts the - entries from the zip file. When creating the zip file, the two files are - added to the zip file using password protection. Each entry uses a - different password. During extraction, each file is extracted with the - appropriate password. - - - // create a file with encryption - using (ZipFile zip = new ZipFile()) - { - ZipEntry entry; - entry= zip.AddFile("Declaration.txt"); - entry.Password= "123456!"; - entry = zip.AddFile("Report.xls"); - entry.Password= "1Secret!"; - zip.Save("EncryptedArchive.zip"); - } - - // extract entries that use encryption - using (ZipFile zip = ZipFile.Read("EncryptedArchive.zip")) - { - ZipEntry entry; - entry = zip["Declaration.txt"]; - entry.Password = "123456!"; - entry.Extract("extractDir"); - entry = zip["Report.xls"]; - entry.Password = "1Secret!"; - entry.Extract("extractDir"); - } - - - - - Using zip As New ZipFile - Dim entry as ZipEntry - entry= zip.AddFile("Declaration.txt") - entry.Password= "123456!" - entry = zip.AddFile("Report.xls") - entry.Password= "1Secret!" - zip.Save("EncryptedArchive.zip") - End Using - - - ' extract entries that use encryption - Using (zip as ZipFile = ZipFile.Read("EncryptedArchive.zip")) - Dim entry as ZipEntry - entry = zip("Declaration.txt") - entry.Password = "123456!" - entry.Extract("extractDir") - entry = zip("Report.xls") - entry.Password = "1Secret!" - entry.Extract("extractDir") - End Using - - - - - - - ZipFile.Password - - - - The action the library should take when extracting a file that already exists. - - - - - This property affects the behavior of the Extract methods (one of the - Extract() or ExtractWithPassword() overloads), when - extraction would would overwrite an existing filesystem file. If you do - not set this property, the library throws an exception when extracting - an entry would overwrite an existing file. - - - - This property has no effect when extracting to a stream, or when the file to be - extracted does not already exist. - - - - - - - This example shows how to set the ExtractExistingFile property in - an ExtractProgress event, in response to user input. The - ExtractProgress event is invoked if and only if the - ExtractExistingFile property was previously set to - ExtractExistingFileAction.InvokeExtractProgressEvent. - - public static void ExtractProgress(object sender, ExtractProgressEventArgs e) - { - if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) - Console.WriteLine("extract {0} ", e.CurrentEntry.FileName); - - else if (e.EventType == ZipProgressEventType.Extracting_ExtractEntryWouldOverwrite) - { - ZipEntry entry = e.CurrentEntry; - string response = null; - // Ask the user if he wants overwrite the file - do - { - Console.Write("Overwrite {0} in {1} ? (y/n/C) ", entry.FileName, e.ExtractLocation); - response = Console.ReadLine(); - Console.WriteLine(); - - } while (response != null && response[0]!='Y' && - response[0]!='N' && response[0]!='C'); - - if (response[0]=='C') - e.Cancel = true; - else if (response[0]=='Y') - entry.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently; - else - entry.ExtractExistingFile= ExtractExistingFileAction.DoNotOverwrite; - } - } - - - - - - The action to take when an error is encountered while - opening or reading files as they are saved into a zip archive. - - - - - Errors can occur within a call to ZipFile.Save, as the various files contained - in a ZipFile are being saved into the zip archive. During the - Save, DotNetZip will perform a File.Open on the file - associated to the ZipEntry, and then will read the entire contents of - the file as it is zipped. Either the open or the Read may fail, because - of lock conflicts or other reasons. Using this property, you can - specify the action to take when such errors occur. - - - - Typically you will NOT set this property on individual ZipEntry - instances. Instead, you will set the ZipFile.ZipErrorAction property on - the ZipFile instance, before adding any entries to the - ZipFile. If you do this, errors encountered on behalf of any of - the entries in the ZipFile will be handled the same way. - - - - But, if you use a handler, you will want - to set this property on the ZipEntry within the handler, to - communicate back to DotNetZip what you would like to do with the - particular error. - - - - - - - - - Indicates whether the entry was included in the most recent save. - - - An entry can be excluded or skipped from a save if there is an error - opening or reading the entry. - - - - - - A callback that allows the application to specify the compression to use - for a given entry that is about to be added to the zip archive. - - - - - See - - - - - - Set to indicate whether to use UTF-8 encoding for filenames and comments. - - - - - - If this flag is set, the comment and filename for the entry will be - encoded with UTF-8, as described in the Zip - specification, if necessary. "Necessary" means, the filename or - entry comment (if any) cannot be reflexively encoded and decoded using the - default code page, IBM437. - - - - Setting this flag to true is equivalent to setting to System.Text.Encoding.UTF8. - - - - This flag has no effect or relation to the text encoding used within the - file itself. - - - - - - - The text encoding to use for the FileName and Comment on this ZipEntry, - when the default encoding is insufficient. - - - - - - Don't use this property. See . - - - - - - - Specifies the alternate text encoding used by this ZipEntry - - - - The default text encoding used in Zip files for encoding filenames and - comments is IBM437, which is something like a superset of ASCII. In - cases where this is insufficient, applications can specify an - alternate encoding. - - - When creating a zip file, the usage of the alternate encoding is - governed by the property. - Typically you would set both properties to tell DotNetZip to employ an - encoding that is not IBM437 in the zipfile you are creating. - - - Keep in mind that because the ZIP specification states that the only - valid encodings to use are IBM437 and UTF-8, if you use something - other than that, then zip tools and libraries may not be able to - successfully read the zip archive you generate. - - - The zip specification states that applications should presume that - IBM437 is in use, except when a special bit is set, which indicates - UTF-8. There is no way to specify an arbitrary code page, within the - zip file itself. When you create a zip file encoded with gb2312 or - ibm861 or anything other than IBM437 or UTF-8, then the application - that reads the zip file needs to "know" which code page to use. In - some cases, the code page used when reading is chosen implicitly. For - example, WinRar uses the ambient code page for the host desktop - operating system. The pitfall here is that if you create a zip in - Copenhagen and send it to Tokyo, the reader of the zipfile may not be - able to decode successfully. - - - - This example shows how to create a zipfile encoded with a - language-specific encoding: - - using (var zip = new ZipFile()) - { - zip.AlternateEnoding = System.Text.Encoding.GetEncoding("ibm861"); - zip.AlternateEnodingUsage = ZipOption.Always; - zip.AddFileS(arrayOfFiles); - zip.Save("Myarchive-Encoded-in-IBM861.zip"); - } - - - - - - - Describes if and when this instance should apply - AlternateEncoding to encode the FileName and Comment, when - saving. - - - - - - Indicates whether an entry is marked as a text file. Be careful when - using on this property. Unless you have a good reason, you should - probably ignore this property. - - - - - The ZIP format includes a provision for specifying whether an entry in - the zip archive is a text or binary file. This property exposes that - metadata item. Be careful when using this property: It's not clear - that this property as a firm meaning, across tools and libraries. - - - - To be clear, when reading a zip file, the property value may or may - not be set, and its value may or may not be valid. Not all entries - that you may think of as "text" entries will be so marked, and entries - marked as "text" are not guaranteed in any way to be text entries. - Whether the value is set and set correctly depends entirely on the - application that produced the zip file. - - - - There are many zip tools available, and when creating zip files, some - of them "respect" the IsText metadata field, and some of them do not. - Unfortunately, even when an application tries to do "the right thing", - it's not always clear what "the right thing" is. - - - - There's no firm definition of just what it means to be "a text file", - and the zip specification does not help in this regard. Twenty years - ago, text was ASCII, each byte was less than 127. IsText meant, all - bytes in the file were less than 127. These days, it is not the case - that all text files have all bytes less than 127. Any unicode file - may have bytes that are above 0x7f. The zip specification has nothing - to say on this topic. Therefore, it's not clear what IsText really - means. - - - - This property merely tells a reading application what is stored in the - metadata for an entry, without guaranteeing its validity or its - meaning. - - - - When DotNetZip is used to create a zipfile, it attempts to set this - field "correctly." For example, if a file ends in ".txt", this field - will be set. Your application may override that default setting. When - writing a zip file, you must set the property before calling - Save() on the ZipFile. - - - - When reading a zip file, a more general way to decide just what kind - of file is contained in a particular entry is to use the file type - database stored in the operating system. The operating system stores - a table that says, a file with .jpg extension is a JPG image file, a - file with a .xml extension is an XML document, a file with a .txt is a - pure ASCII text document, and so on. To get this information on - Windows, you - need to read and parse the registry. - - - - - using (var zip = new ZipFile()) - { - var e = zip.UpdateFile("Descriptions.mme", ""); - e.IsText = true; - zip.Save(zipPath); - } - - - - Using zip As New ZipFile - Dim e2 as ZipEntry = zip.AddFile("Descriptions.mme", "") - e.IsText= True - zip.Save(zipPath) - End Using - - - - - - An enum that specifies the type of timestamp available on the ZipEntry. - - - - - - The last modified time of a file can be stored in multiple ways in - a zip file, and they are not mutually exclusive: - - - - - In the so-called "DOS" format, which has a 2-second precision. Values - are rounded to the nearest even second. For example, if the time on the - file is 12:34:43, then it will be stored as 12:34:44. This first value - is accessible via the LastModified property. This value is always - present in the metadata for each zip entry. In some cases the value is - invalid, or zero. - - - - In the so-called "Windows" or "NTFS" format, as an 8-byte integer - quantity expressed as the number of 1/10 milliseconds (in other words - the number of 100 nanosecond units) since January 1, 1601 (UTC). This - format is how Windows represents file times. This time is accessible - via the ModifiedTime property. - - - - In the "Unix" format, a 4-byte quantity specifying the number of seconds since - January 1, 1970 UTC. - - - - In an older format, now deprecated but still used by some current - tools. This format is also a 4-byte quantity specifying the number of - seconds since January 1, 1970 UTC. - - - - - - This bit field describes which of the formats were found in a ZipEntry that was read. - - - - - - - Default value. - - - - - A DOS timestamp with 2-second precision. - - - - - A Windows timestamp with 100-ns precision. - - - - - A Unix timestamp with 1-second precision. - - - - - A Unix timestamp with 1-second precision, stored in InfoZip v1 format. This - format is outdated and is supported for reading archives only. - - - - - The method of compression to use for a particular ZipEntry. - - - - PKWare's - ZIP Specification describes a number of distinct - cmopression methods that can be used within a zip - file. DotNetZip supports a subset of them. - - - - - No compression at all. For COM environments, the value is 0 (zero). - - - - - DEFLATE compression, as described in IETF RFC - 1951. This is the "normal" compression used in zip - files. For COM environments, the value is 8. - - - - - BZip2 compression, a compression algorithm developed by Julian Seward. - For COM environments, the value is 12. - - - - - The ZipFile type represents a zip archive file. - - - - - This is the main type in the DotNetZip class library. This class reads and - writes zip files, as defined in the specification - for zip files described by PKWare. The compression for this - implementation is provided by a managed-code version of Zlib, included with - DotNetZip in the classes in the Ionic.Zlib namespace. - - - - This class provides a general purpose zip file capability. Use it to read, - create, or update zip files. When you want to create zip files using a - Stream type to write the zip file, you may want to consider the class. - - - - Both the ZipOutputStream class and the ZipFile class can - be used to create zip files. Both of them support many of the common zip - features, including Unicode, different compression methods and levels, - and ZIP64. They provide very similar performance when creating zip - files. - - - - The ZipFile class is generally easier to use than - ZipOutputStream and should be considered a higher-level interface. For - example, when creating a zip file via calls to the PutNextEntry() and - Write() methods on the ZipOutputStream class, the caller is - responsible for opening the file, reading the bytes from the file, writing - those bytes into the ZipOutputStream, setting the attributes on the - ZipEntry, and setting the created, last modified, and last accessed - timestamps on the zip entry. All of these things are done automatically by a - call to ZipFile.AddFile(). - For this reason, the ZipOutputStream is generally recommended for use - only when your application emits arbitrary data, not necessarily data from a - filesystem file, directly into a zip file, and does so using a Stream - metaphor. - - - - Aside from the differences in programming model, there are other - differences in capability between the two classes. - - - - - ZipFile can be used to read and extract zip files, in addition to - creating zip files. ZipOutputStream cannot read zip files. If you want - to use a stream to read zip files, check out the class. - - - - ZipOutputStream does not support the creation of segmented or spanned - zip files. - - - - ZipOutputStream cannot produce a self-extracting archive. - - - - - Be aware that the ZipFile class implements the interface. In order for ZipFile to - produce a valid zip file, you use use it within a using clause (Using - in VB), or call the Dispose() method explicitly. See the examples - for how to employ a using clause. - - - - - - - Adds an item, either a file or a directory, to a zip file archive. - - - - - This method is handy if you are adding things to zip archive and don't - want to bother distinguishing between directories or files. Any files are - added as single entries. A directory added through this method is added - recursively: all files and subdirectories contained within the directory - are added to the ZipFile. - - - - The name of the item may be a relative path or a fully-qualified - path. Remember, the items contained in ZipFile instance get written - to the disk only when you call or a similar - save method. - - - - The directory name used for the file within the archive is the same - as the directory name (potentially a relative path) specified in the - . - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to the - ZipEntry added. - - - - - - - - - This method has two overloads. - - the name of the file or directory to add. - - The ZipEntry added. - - - - Adds an item, either a file or a directory, to a zip file archive, - explicitly specifying the directory path to be used in the archive. - - - - - If adding a directory, the add is recursive on all files and - subdirectories contained within it. - - - The name of the item may be a relative path or a fully-qualified path. - The item added by this call to the ZipFile is not read from the - disk nor written to the zip file archive until the application calls - Save() on the ZipFile. - - - - This version of the method allows the caller to explicitly specify the - directory path to be used in the archive, which would override the - "natural" path of the filesystem file. - - - - Encryption will be used on the file data if the Password has - been set on the ZipFile object, prior to calling this method. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to the - ZipEntry added. - - - - - - Thrown if the file or directory passed in does not exist. - - - the name of the file or directory to add. - - - - The name of the directory path to use within the zip archive. This path - need not refer to an extant directory in the current filesystem. If the - files within the zip are later extracted, this is the path used for the - extracted file. Passing null (Nothing in VB) will use the - path on the fileOrDirectoryName. Passing the empty string ("") will - insert the item at the root path within the archive. - - - - - - - - This example shows how to zip up a set of files into a flat hierarchy, - regardless of where in the filesystem the files originated. The resulting - zip archive will contain a toplevel directory named "flat", which itself - will contain files Readme.txt, MyProposal.docx, and Image1.jpg. A - subdirectory under "flat" called SupportFiles will contain all the files - in the "c:\SupportFiles" directory on disk. - - - String[] itemnames= { - "c:\\fixedContent\\Readme.txt", - "MyProposal.docx", - "c:\\SupportFiles", // a directory - "images\\Image1.jpg" - }; - - try - { - using (ZipFile zip = new ZipFile()) - { - for (int i = 1; i < itemnames.Length; i++) - { - // will add Files or Dirs, recurses and flattens subdirectories - zip.AddItem(itemnames[i],"flat"); - } - zip.Save(ZipToCreate); - } - } - catch (System.Exception ex1) - { - System.Console.Error.WriteLine("exception: {0}", ex1); - } - - - - Dim itemnames As String() = _ - New String() { "c:\fixedContent\Readme.txt", _ - "MyProposal.docx", _ - "SupportFiles", _ - "images\Image1.jpg" } - Try - Using zip As New ZipFile - Dim i As Integer - For i = 1 To itemnames.Length - 1 - ' will add Files or Dirs, recursing and flattening subdirectories. - zip.AddItem(itemnames(i), "flat") - Next i - zip.Save(ZipToCreate) - End Using - Catch ex1 As Exception - Console.Error.WriteLine("exception: {0}", ex1.ToString()) - End Try - - - The ZipEntry added. - - - - Adds a File to a Zip file archive. - - - - - This call collects metadata for the named file in the filesystem, - including the file attributes and the timestamp, and inserts that metadata - into the resulting ZipEntry. Only when the application calls Save() on - the ZipFile, does DotNetZip read the file from the filesystem and - then write the content to the zip file archive. - - - - This method will throw an exception if an entry with the same name already - exists in the ZipFile. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to the - ZipEntry added. - - - - - - - In this example, three files are added to a Zip archive. The ReadMe.txt - file will be placed in the root of the archive. The .png file will be - placed in a folder within the zip called photos\personal. The pdf file - will be included into a folder within the zip called Desktop. - - - try - { - using (ZipFile zip = new ZipFile()) - { - zip.AddFile("c:\\photos\\personal\\7440-N49th.png"); - zip.AddFile("c:\\Desktop\\2008-Regional-Sales-Report.pdf"); - zip.AddFile("ReadMe.txt"); - - zip.Save("Package.zip"); - } - } - catch (System.Exception ex1) - { - System.Console.Error.WriteLine("exception: " + ex1); - } - - - - Try - Using zip As ZipFile = New ZipFile - zip.AddFile("c:\photos\personal\7440-N49th.png") - zip.AddFile("c:\Desktop\2008-Regional-Sales-Report.pdf") - zip.AddFile("ReadMe.txt") - zip.Save("Package.zip") - End Using - Catch ex1 As Exception - Console.Error.WriteLine("exception: {0}", ex1.ToString) - End Try - - - - This method has two overloads. - - - - - - - The name of the file to add. It should refer to a file in the filesystem. - The name of the file may be a relative path or a fully-qualified path. - - The ZipEntry corresponding to the File added. - - - - Adds a File to a Zip file archive, potentially overriding the path to be - used within the zip archive. - - - - - The file added by this call to the ZipFile is not written to the - zip file archive until the application calls Save() on the ZipFile. - - - - This method will throw an exception if an entry with the same name already - exists in the ZipFile. - - - - This version of the method allows the caller to explicitly specify the - directory path to be used in the archive. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to the - ZipEntry added. - - - - - - - In this example, three files are added to a Zip archive. The ReadMe.txt - file will be placed in the root of the archive. The .png file will be - placed in a folder within the zip called images. The pdf file will be - included into a folder within the zip called files\docs, and will be - encrypted with the given password. - - - try - { - using (ZipFile zip = new ZipFile()) - { - // the following entry will be inserted at the root in the archive. - zip.AddFile("c:\\datafiles\\ReadMe.txt", ""); - // this image file will be inserted into the "images" directory in the archive. - zip.AddFile("c:\\photos\\personal\\7440-N49th.png", "images"); - // the following will result in a password-protected file called - // files\\docs\\2008-Regional-Sales-Report.pdf in the archive. - zip.Password = "EncryptMe!"; - zip.AddFile("c:\\Desktop\\2008-Regional-Sales-Report.pdf", "files\\docs"); - zip.Save("Archive.zip"); - } - } - catch (System.Exception ex1) - { - System.Console.Error.WriteLine("exception: {0}", ex1); - } - - - - Try - Using zip As ZipFile = New ZipFile - ' the following entry will be inserted at the root in the archive. - zip.AddFile("c:\datafiles\ReadMe.txt", "") - ' this image file will be inserted into the "images" directory in the archive. - zip.AddFile("c:\photos\personal\7440-N49th.png", "images") - ' the following will result in a password-protected file called - ' files\\docs\\2008-Regional-Sales-Report.pdf in the archive. - zip.Password = "EncryptMe!" - zip.AddFile("c:\Desktop\2008-Regional-Sales-Report.pdf", "files\documents") - zip.Save("Archive.zip") - End Using - Catch ex1 As Exception - Console.Error.WriteLine("exception: {0}", ex1) - End Try - - - - - - - - - The name of the file to add. The name of the file may be a relative path - or a fully-qualified path. - - - - Specifies a directory path to use to override any path in the fileName. - This path may, or may not, correspond to a real directory in the current - filesystem. If the files within the zip are later extracted, this is the - path used for the extracted file. Passing null (Nothing in - VB) will use the path on the fileName, if any. Passing the empty string - ("") will insert the item at the root path within the archive. - - - The ZipEntry corresponding to the file added. - - - - This method removes a collection of entries from the ZipFile. - - - - A collection of ZipEntry instances from this zip file to be removed. For - example, you can pass in an array of ZipEntry instances; or you can call - SelectEntries(), and then add or remove entries from that - ICollection<ZipEntry> (ICollection(Of ZipEntry) in VB), and pass - that ICollection to this method. - - - - - - - - This method removes a collection of entries from the ZipFile, by name. - - - - A collection of strings that refer to names of entries to be removed - from the ZipFile. For example, you can pass in an array or a - List of Strings that provide the names of entries to be removed. - - - - - - - - This method adds a set of files to the ZipFile. - - - - - Use this method to add a set of files to the zip archive, in one call. - For example, a list of files received from - System.IO.Directory.GetFiles() can be added to a zip archive in one - call. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to each - ZipEntry added. - - - - - The collection of names of the files to add. Each string should refer to a - file in the filesystem. The name of the file may be a relative path or a - fully-qualified path. - - - - This example shows how to create a zip file, and add a few files into it. - - String ZipFileToCreate = "archive1.zip"; - String DirectoryToZip = "c:\\reports"; - using (ZipFile zip = new ZipFile()) - { - // Store all files found in the top level directory, into the zip archive. - String[] filenames = System.IO.Directory.GetFiles(DirectoryToZip); - zip.AddFiles(filenames); - zip.Save(ZipFileToCreate); - } - - - - Dim ZipFileToCreate As String = "archive1.zip" - Dim DirectoryToZip As String = "c:\reports" - Using zip As ZipFile = New ZipFile - ' Store all files found in the top level directory, into the zip archive. - Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip) - zip.AddFiles(filenames) - zip.Save(ZipFileToCreate) - End Using - - - - - - - - Adds or updates a set of files in the ZipFile. - - - - - Any files that already exist in the archive are updated. Any files that - don't yet exist in the archive are added. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to each - ZipEntry added. - - - - - The collection of names of the files to update. Each string should refer to a file in - the filesystem. The name of the file may be a relative path or a fully-qualified path. - - - - - - Adds a set of files to the ZipFile, using the - specified directory path in the archive. - - - - - Any directory structure that may be present in the - filenames contained in the list is "flattened" in the - archive. Each file in the list is added to the archive in - the specified top-level directory. - - - - For ZipFile properties including , , , , , , and , their respective values at the - time of this call will be applied to each ZipEntry added. - - - - - The names of the files to add. Each string should refer to - a file in the filesystem. The name of the file may be a - relative path or a fully-qualified path. - - - - Specifies a directory path to use to override any path in the file name. - Th is path may, or may not, correspond to a real directory in the current - filesystem. If the files within the zip are later extracted, this is the - path used for the extracted file. Passing null (Nothing in - VB) will use the path on each of the fileNames, if any. Passing - the empty string ("") will insert the item at the root path within the - archive. - - - - - - - Adds a set of files to the ZipFile, using the specified directory - path in the archive, and preserving the full directory structure in the - filenames. - - - - - If preserveDirHierarchy is true, any directory structure present in the - filenames contained in the list is preserved in the archive. On the other - hand, if preserveDirHierarchy is false, any directory structure that may - be present in the filenames contained in the list is "flattened" in the - archive; Each file in the list is added to the archive in the specified - top-level directory. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to each - ZipEntry added. - - - - - - The names of the files to add. Each string should refer to a file in the - filesystem. The name of the file may be a relative path or a - fully-qualified path. - - - - Specifies a directory path to use to override any path in the file name. - This path may, or may not, correspond to a real directory in the current - filesystem. If the files within the zip are later extracted, this is the - path used for the extracted file. Passing null (Nothing in - VB) will use the path on each of the fileNames, if any. Passing - the empty string ("") will insert the item at the root path within the - archive. - - - - whether the entries in the zip archive will reflect the directory - hierarchy that is present in the various filenames. For example, if - includes two paths, \Animalia\Chordata\Mammalia\Info.txt and - \Plantae\Magnoliophyta\Dicotyledon\Info.txt, then calling this method with - = false will result in an - exception because of a duplicate entry name, while calling this method - with = true will result in the - full direcory paths being included in the entries added to the ZipFile. - - - - - - Adds or updates a set of files to the ZipFile, using the specified - directory path in the archive. - - - - - - Any files that already exist in the archive are updated. Any files that - don't yet exist in the archive are added. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to each - ZipEntry added. - - - - - The names of the files to add or update. Each string should refer to a - file in the filesystem. The name of the file may be a relative path or a - fully-qualified path. - - - - Specifies a directory path to use to override any path in the file name. - This path may, or may not, correspond to a real directory in the current - filesystem. If the files within the zip are later extracted, this is the - path used for the extracted file. Passing null (Nothing in - VB) will use the path on each of the fileNames, if any. Passing - the empty string ("") will insert the item at the root path within the - archive. - - - - - - - Adds or Updates a File in a Zip file archive. - - - - - This method adds a file to a zip archive, or, if the file already exists - in the zip archive, this method Updates the content of that given filename - in the zip archive. The UpdateFile method might more accurately be - called "AddOrUpdateFile". - - - - Upon success, there is no way for the application to learn whether the file - was added versus updated. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to the - ZipEntry added. - - - - - - This example shows how to Update an existing entry in a zipfile. The first - call to UpdateFile adds the file to the newly-created zip archive. The - second call to UpdateFile updates the content for that file in the zip - archive. - - - using (ZipFile zip1 = new ZipFile()) - { - // UpdateFile might more accurately be called "AddOrUpdateFile" - zip1.UpdateFile("MyDocuments\\Readme.txt"); - zip1.UpdateFile("CustomerList.csv"); - zip1.Comment = "This zip archive has been created."; - zip1.Save("Content.zip"); - } - - using (ZipFile zip2 = ZipFile.Read("Content.zip")) - { - zip2.UpdateFile("Updates\\Readme.txt"); - zip2.Comment = "This zip archive has been updated: The Readme.txt file has been changed."; - zip2.Save(); - } - - - - Using zip1 As New ZipFile - ' UpdateFile might more accurately be called "AddOrUpdateFile" - zip1.UpdateFile("MyDocuments\Readme.txt") - zip1.UpdateFile("CustomerList.csv") - zip1.Comment = "This zip archive has been created." - zip1.Save("Content.zip") - End Using - - Using zip2 As ZipFile = ZipFile.Read("Content.zip") - zip2.UpdateFile("Updates\Readme.txt") - zip2.Comment = "This zip archive has been updated: The Readme.txt file has been changed." - zip2.Save - End Using - - - - - - - - - The name of the file to add or update. It should refer to a file in the - filesystem. The name of the file may be a relative path or a - fully-qualified path. - - - - The ZipEntry corresponding to the File that was added or updated. - - - - - Adds or Updates a File in a Zip file archive. - - - - - This method adds a file to a zip archive, or, if the file already exists - in the zip archive, this method Updates the content of that given filename - in the zip archive. - - - - This version of the method allows the caller to explicitly specify the - directory path to be used in the archive. The entry to be added or - updated is found by using the specified directory path, combined with the - basename of the specified filename. - - - - Upon success, there is no way for the application to learn if the file was - added versus updated. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to the - ZipEntry added. - - - - - - - - - The name of the file to add or update. It should refer to a file in the - filesystem. The name of the file may be a relative path or a - fully-qualified path. - - - - Specifies a directory path to use to override any path in the - fileName. This path may, or may not, correspond to a real - directory in the current filesystem. If the files within the zip are - later extracted, this is the path used for the extracted file. Passing - null (Nothing in VB) will use the path on the - fileName, if any. Passing the empty string ("") will insert the - item at the root path within the archive. - - - - The ZipEntry corresponding to the File that was added or updated. - - - - - Add or update a directory in a zip archive. - - - - If the specified directory does not exist in the archive, then this method - is equivalent to calling AddDirectory(). If the specified - directory already exists in the archive, then this method updates any - existing entries, and adds any new entries. Any entries that are in the - zip archive but not in the specified directory, are left alone. In other - words, the contents of the zip file will be a union of the previous - contents and the new files. - - - - - - - - The path to the directory to be added to the zip archive, or updated in - the zip archive. - - - - The ZipEntry corresponding to the Directory that was added or updated. - - - - - Add or update a directory in the zip archive at the specified root - directory in the archive. - - - - If the specified directory does not exist in the archive, then this method - is equivalent to calling AddDirectory(). If the specified - directory already exists in the archive, then this method updates any - existing entries, and adds any new entries. Any entries that are in the - zip archive but not in the specified directory, are left alone. In other - words, the contents of the zip file will be a union of the previous - contents and the new files. - - - - - - - - The path to the directory to be added to the zip archive, or updated - in the zip archive. - - - - Specifies a directory path to use to override any path in the - directoryName. This path may, or may not, correspond to a real - directory in the current filesystem. If the files within the zip are - later extracted, this is the path used for the extracted file. Passing - null (Nothing in VB) will use the path on the - directoryName, if any. Passing the empty string ("") will insert - the item at the root path within the archive. - - - - The ZipEntry corresponding to the Directory that was added or updated. - - - - - Add or update a file or directory in the zip archive. - - - - - This is useful when the application is not sure or does not care if the - item to be added is a file or directory, and does not know or does not - care if the item already exists in the ZipFile. Calling this method - is equivalent to calling RemoveEntry() if an entry by the same name - already exists, followed calling by AddItem(). - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to the - ZipEntry added. - - - - - - - - - the path to the file or directory to be added or updated. - - - - - Add or update a file or directory. - - - - - This method is useful when the application is not sure or does not care if - the item to be added is a file or directory, and does not know or does not - care if the item already exists in the ZipFile. Calling this method - is equivalent to calling RemoveEntry(), if an entry by that name - exists, and then calling AddItem(). - - - - This version of the method allows the caller to explicitly specify the - directory path to be used for the item being added to the archive. The - entry or entries that are added or updated will use the specified - DirectoryPathInArchive. Extracting the entry from the archive will - result in a file stored in that directory path. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to the - ZipEntry added. - - - - - - - - - The path for the File or Directory to be added or updated. - - - Specifies a directory path to use to override any path in the - itemName. This path may, or may not, correspond to a real - directory in the current filesystem. If the files within the zip are - later extracted, this is the path used for the extracted file. Passing - null (Nothing in VB) will use the path on the - itemName, if any. Passing the empty string ("") will insert the - item at the root path within the archive. - - - - - Adds a named entry into the zip archive, taking content for the entry - from a string. - - - - Calling this method creates an entry using the given fileName and - directory path within the archive. There is no need for a file by the - given name to exist in the filesystem; the name is used within the zip - archive only. The content for the entry is encoded using the default text - encoding for the machine, or on Silverlight, using UTF-8. - - - - The content of the file, should it be extracted from the zip. - - - - The name, including any path, to use for the entry within the archive. - - - The ZipEntry added. - - - - This example shows how to add an entry to the zipfile, using a string as - content for that entry. - - - string Content = "This string will be the content of the Readme.txt file in the zip archive."; - using (ZipFile zip1 = new ZipFile()) - { - zip1.AddFile("MyDocuments\\Resume.doc", "files"); - zip1.AddEntry("Readme.txt", Content); - zip1.Comment = "This zip file was created at " + System.DateTime.Now.ToString("G"); - zip1.Save("Content.zip"); - } - - - - Public Sub Run() - Dim Content As String = "This string will be the content of the Readme.txt file in the zip archive." - Using zip1 As ZipFile = New ZipFile - zip1.AddEntry("Readme.txt", Content) - zip1.AddFile("MyDocuments\Resume.doc", "files") - zip1.Comment = ("This zip file was created at " & DateTime.Now.ToString("G")) - zip1.Save("Content.zip") - End Using - End Sub - - - - - - Adds a named entry into the zip archive, taking content for the entry - from a string, and using the specified text encoding. - - - - - - Calling this method creates an entry using the given fileName and - directory path within the archive. There is no need for a file by the - given name to exist in the filesystem; the name is used within the zip - archive only. - - - - The content for the entry, a string value, is encoded using the given - text encoding. A BOM (byte-order-mark) is emitted into the file, if the - Encoding parameter is set for that. - - - - Most Encoding classes support a constructor that accepts a boolean, - indicating whether to emit a BOM or not. For example see . - - - - - - The name, including any path, to use within the archive for the entry. - - - - The content of the file, should it be extracted from the zip. - - - - The text encoding to use when encoding the string. Be aware: This is - distinct from the text encoding used to encode the fileName, as specified - in . - - - The ZipEntry added. - - - - - Create an entry in the ZipFile using the given Stream - as input. The entry will have the given filename. - - - - - - The application should provide an open, readable stream; in this case it - will be read during the call to or one of - its overloads. - - - - The passed stream will be read from its current position. If - necessary, callers should set the position in the stream before - calling AddEntry(). This might be appropriate when using this method - with a MemoryStream, for example. - - - - In cases where a large number of streams will be added to the - ZipFile, the application may wish to avoid maintaining all of the - streams open simultaneously. To handle this situation, the application - should use the - overload. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to the - ZipEntry added. - - - - - - - This example adds a single entry to a ZipFile via a Stream. - - - - String zipToCreate = "Content.zip"; - String fileNameInArchive = "Content-From-Stream.bin"; - using (System.IO.Stream streamToRead = MyStreamOpener()) - { - using (ZipFile zip = new ZipFile()) - { - ZipEntry entry= zip.AddEntry(fileNameInArchive, streamToRead); - zip.AddFile("Readme.txt"); - zip.Save(zipToCreate); // the stream is read implicitly here - } - } - - - - Dim zipToCreate As String = "Content.zip" - Dim fileNameInArchive As String = "Content-From-Stream.bin" - Using streamToRead as System.IO.Stream = MyStreamOpener() - Using zip As ZipFile = New ZipFile() - Dim entry as ZipEntry = zip.AddEntry(fileNameInArchive, streamToRead) - zip.AddFile("Readme.txt") - zip.Save(zipToCreate) '' the stream is read implicitly, here - End Using - End Using - - - - - - - The name, including any path, which is shown in the zip file for the added - entry. - - - The input stream from which to grab content for the file - - The ZipEntry added. - - - - Add a ZipEntry for which content is written directly by the application. - - - - - When the application needs to write the zip entry data, use this - method to add the ZipEntry. For example, in the case that the - application wishes to write the XML representation of a DataSet into - a ZipEntry, the application can use this method to do so. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to the - ZipEntry added. - - - - About progress events: When using the WriteDelegate, DotNetZip does - not issue any SaveProgress events with EventType = - Saving_EntryBytesRead. (This is because it is the - application's code that runs in WriteDelegate - there's no way for - DotNetZip to know when to issue a EntryBytesRead event.) - Applications that want to update a progress bar or similar status - indicator should do so from within the WriteDelegate - itself. DotNetZip will issue the other SaveProgress events, - including - Saving_Started, - - Saving_BeforeWriteEntry, and - Saving_AfterWriteEntry. - - - - Note: When you use PKZip encryption, it's normally necessary to - compute the CRC of the content to be encrypted, before compressing or - encrypting it. Therefore, when using PKZip encryption with a - WriteDelegate, the WriteDelegate CAN BE called twice: once to compute - the CRC, and the second time to potentially compress and - encrypt. Surprising, but true. This is because PKWARE specified that - the encryption initialization data depends on the CRC. - If this happens, for each call of the delegate, your - application must stream the same entry data in its entirety. If your - application writes different data during the second call, it will - result in a corrupt zip file. - - - - The double-read behavior happens with all types of entries, not only - those that use WriteDelegate. It happens if you add an entry from a - filesystem file, or using a string, or a stream, or an opener/closer - pair. But in those cases, DotNetZip takes care of reading twice; in - the case of the WriteDelegate, the application code gets invoked - twice. Be aware. - - - - As you can imagine, this can cause performance problems for large - streams, and it can lead to correctness problems when you use a - WriteDelegate. This is a pretty big pitfall. There are two - ways to avoid it. First, and most preferred: don't use PKZIP - encryption. If you use the WinZip AES encryption, this problem - doesn't occur, because the encryption protocol doesn't require the CRC - up front. Second: if you do choose to use PKZIP encryption, write out - to a non-seekable stream (like standard output, or the - Response.OutputStream in an ASP.NET application). In this case, - DotNetZip will use an alternative encryption protocol that does not - rely on the CRC of the content. This also implies setting bit 3 in - the zip entry, which still presents problems for some zip tools. - - - - In the future I may modify DotNetZip to *always* use bit 3 when PKZIP - encryption is in use. This seems like a win overall, but there will - be some work involved. If you feel strongly about it, visit the - DotNetZip forums and vote up the Workitem - tracking this issue. - - - - - the name of the entry to add - the delegate which will write the entry content - the ZipEntry added - - - - This example shows an application filling a DataSet, then saving the - contents of that DataSet as XML, into a ZipEntry in a ZipFile, using an - anonymous delegate in C#. The DataSet XML is never saved to a disk file. - - - var c1= new System.Data.SqlClient.SqlConnection(connstring1); - var da = new System.Data.SqlClient.SqlDataAdapter() - { - SelectCommand= new System.Data.SqlClient.SqlCommand(strSelect, c1) - }; - - DataSet ds1 = new DataSet(); - da.Fill(ds1, "Invoices"); - - using(Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile()) - { - zip.AddEntry(zipEntryName, (name,stream) => ds1.WriteXml(stream) ); - zip.Save(zipFileName); - } - - - - - - This example uses an anonymous method in C# as the WriteDelegate to provide - the data for the ZipEntry. The example is a bit contrived - the - AddFile() method is a simpler way to insert the contents of a file - into an entry in a zip file. On the other hand, if there is some sort of - processing or transformation of the file contents required before writing, - the application could use the WriteDelegate to do it, in this way. - - - using (var input = File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite )) - { - using(Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile()) - { - zip.AddEntry(zipEntryName, (name,output) => - { - byte[] buffer = new byte[BufferSize]; - int n; - while ((n = input.Read(buffer, 0, buffer.Length)) != 0) - { - // could transform the data here... - output.Write(buffer, 0, n); - // could update a progress bar here - } - }); - - zip.Save(zipFileName); - } - } - - - - - - This example uses a named delegate in VB to write data for the given - ZipEntry (VB9 does not have anonymous delegates). The example here is a bit - contrived - a simpler way to add the contents of a file to a ZipEntry is to - simply use the appropriate AddFile() method. The key scenario for - which the WriteDelegate makes sense is saving a DataSet, in XML - format, to the zip file. The DataSet can write XML to a stream, and the - WriteDelegate is the perfect place to write into the zip file. There may be - other data structures that can write to a stream, but cannot be read as a - stream. The WriteDelegate would be appropriate for those cases as - well. - - - Private Sub WriteEntry (ByVal name As String, ByVal output As Stream) - Using input As FileStream = File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) - Dim n As Integer = -1 - Dim buffer As Byte() = New Byte(BufferSize){} - Do While n <> 0 - n = input.Read(buffer, 0, buffer.Length) - output.Write(buffer, 0, n) - Loop - End Using - End Sub - - Public Sub Run() - Using zip = New ZipFile - zip.AddEntry(zipEntryName, New WriteDelegate(AddressOf WriteEntry)) - zip.Save(zipFileName) - End Using - End Sub - - - - - - Add an entry, for which the application will provide a stream, - just-in-time. - - - - - In cases where the application wishes to open the stream that holds - the content for the ZipEntry, on a just-in-time basis, the application - can use this method and provide delegates to open and close the - stream. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to the - ZipEntry added. - - - - - - - This example uses anonymous methods in C# to open and close the - source stream for the content for a zip entry. In a real - application, the logic for the OpenDelegate would probably be more - involved. - - - using(Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile()) - { - zip.AddEntry(zipEntryName, - (name) => File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite ), - (name, stream) => stream.Close() - ); - - zip.Save(zipFileName); - } - - - - - - - This example uses delegates in VB.NET to open and close the - the source stream for the content for a zip entry. VB 9.0 lacks - support for "Sub" lambda expressions, and so the CloseDelegate must - be an actual, named Sub. - - - - Function MyStreamOpener(ByVal entryName As String) As Stream - '' This simply opens a file. You probably want to do somethinig - '' more involved here: open a stream to read from a database, - '' open a stream on an HTTP connection, and so on. - Return File.OpenRead(entryName) - End Function - - Sub MyStreamCloser(entryName As String, stream As Stream) - stream.Close() - End Sub - - Public Sub Run() - Dim dirToZip As String = "fodder" - Dim zipFileToCreate As String = "Archive.zip" - Dim opener As OpenDelegate = AddressOf MyStreamOpener - Dim closer As CloseDelegate = AddressOf MyStreamCloser - Dim numFilestoAdd As Int32 = 4 - Using zip As ZipFile = New ZipFile - Dim i As Integer - For i = 0 To numFilesToAdd - 1 - zip.AddEntry(String.Format("content-{0:000}.txt"), opener, closer) - Next i - zip.Save(zipFileToCreate) - End Using - End Sub - - - - - the name of the entry to add - - the delegate that will be invoked to open the stream - - - the delegate that will be invoked to close the stream - - the ZipEntry added - - - - - Updates the given entry in the ZipFile, using the given - string as content for the ZipEntry. - - - - - - Calling this method is equivalent to removing the ZipEntry for - the given file name and directory path, if it exists, and then calling - . See the documentation for - that method for further explanation. The string content is encoded - using the default encoding for the machine, or on Silverlight, using - UTF-8. This encoding is distinct from the encoding used for the - filename itself. See . - - - - - - The name, including any path, to use within the archive for the entry. - - - - The content of the file, should it be extracted from the zip. - - - The ZipEntry added. - - - - - Updates the given entry in the ZipFile, using the given string as - content for the ZipEntry. - - - - Calling this method is equivalent to removing the ZipEntry for the - given file name and directory path, if it exists, and then calling . See the - documentation for that method for further explanation. - - - - The name, including any path, to use within the archive for the entry. - - - - The content of the file, should it be extracted from the zip. - - - - The text encoding to use when encoding the string. Be aware: This is - distinct from the text encoding used to encode the filename. See . - - - The ZipEntry added. - - - - - Updates the given entry in the ZipFile, using the given delegate - as the source for content for the ZipEntry. - - - - Calling this method is equivalent to removing the ZipEntry for the - given file name and directory path, if it exists, and then calling . See the - documentation for that method for further explanation. - - - - The name, including any path, to use within the archive for the entry. - - - the delegate which will write the entry content. - - The ZipEntry added. - - - - - Updates the given entry in the ZipFile, using the given delegates - to open and close the stream that provides the content for the ZipEntry. - - - - Calling this method is equivalent to removing the ZipEntry for the - given file name and directory path, if it exists, and then calling . See the - documentation for that method for further explanation. - - - - The name, including any path, to use within the archive for the entry. - - - - the delegate that will be invoked to open the stream - - - the delegate that will be invoked to close the stream - - - The ZipEntry added or updated. - - - - - Updates the given entry in the ZipFile, using the given stream as - input, and the given filename and given directory Path. - - - - - Calling the method is equivalent to calling RemoveEntry() if an - entry by the same name already exists, and then calling AddEntry() - with the given fileName and stream. - - - - The stream must be open and readable during the call to - ZipFile.Save. You can dispense the stream on a just-in-time basis - using the property. Check the - documentation of that property for more information. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to the - ZipEntry added. - - - - - - - - - The name, including any path, to use within the archive for the entry. - - - The input stream from which to read file data. - The ZipEntry added. - - - - Add an entry into the zip archive using the given filename and - directory path within the archive, and the given content for the - file. No file is created in the filesystem. - - - The data to use for the entry. - - - The name, including any path, to use within the archive for the entry. - - - The ZipEntry added. - - - - Updates the given entry in the ZipFile, using the given byte - array as content for the entry. - - - - Calling this method is equivalent to removing the ZipEntry - for the given filename and directory path, if it exists, and then - calling . See the - documentation for that method for further explanation. - - - - The name, including any path, to use within the archive for the entry. - - - The content to use for the ZipEntry. - - The ZipEntry added. - - - - - Adds the contents of a filesystem directory to a Zip file archive. - - - - - - The name of the directory may be a relative path or a fully-qualified - path. Any files within the named directory are added to the archive. Any - subdirectories within the named directory are also added to the archive, - recursively. - - - - Top-level entries in the named directory will appear as top-level entries - in the zip archive. Entries in subdirectories in the named directory will - result in entries in subdirectories in the zip archive. - - - - If you want the entries to appear in a containing directory in the zip - archive itself, then you should call the AddDirectory() overload that - allows you to explicitly specify a directory path for use in the archive. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to each - ZipEntry added. - - - - - - - - - - This method has 2 overloads. - - The name of the directory to add. - The ZipEntry added. - - - - Adds the contents of a filesystem directory to a Zip file archive, - overriding the path to be used for entries in the archive. - - - - - The name of the directory may be a relative path or a fully-qualified - path. The add operation is recursive, so that any files or subdirectories - within the name directory are also added to the archive. - - - - Top-level entries in the named directory will appear as top-level entries - in the zip archive. Entries in subdirectories in the named directory will - result in entries in subdirectories in the zip archive. - - - - For ZipFile properties including , , , , , - , and , their - respective values at the time of this call will be applied to each - ZipEntry added. - - - - - - - In this code, calling the ZipUp() method with a value of "c:\reports" for - the directory parameter will result in a zip file structure in which all - entries are contained in a toplevel "reports" directory. - - - - public void ZipUp(string targetZip, string directory) - { - using (var zip = new ZipFile()) - { - zip.AddDirectory(directory, System.IO.Path.GetFileName(directory)); - zip.Save(targetZip); - } - } - - - - - - - - The name of the directory to add. - - - Specifies a directory path to use to override any path in the - DirectoryName. This path may, or may not, correspond to a real directory - in the current filesystem. If the zip is later extracted, this is the - path used for the extracted file or directory. Passing null - (Nothing in VB) or the empty string ("") will insert the items at - the root path within the archive. - - - The ZipEntry added. - - - - Creates a directory in the zip archive. - - - - - - Use this when you want to create a directory in the archive but there is - no corresponding filesystem representation for that directory. - - - - You will probably not need to do this in your code. One of the only times - you will want to do this is if you want an empty directory in the zip - archive. The reason: if you add a file to a zip archive that is stored - within a multi-level directory, all of the directory tree is implicitly - created in the zip archive. - - - - - - The name of the directory to create in the archive. - - The ZipEntry added. - - - - Checks a zip file to see if its directory is consistent. - - - - - - In cases of data error, the directory within a zip file can get out - of synch with the entries in the zip file. This method checks the - given zip file and returns true if this has occurred. - - - This method may take a long time to run for large zip files. - - - This method is not supported in the Reduced or Compact Framework - versions of DotNetZip. - - - - Developers using COM can use the ComHelper.CheckZip(String) - method. - - - - - The filename to of the zip file to check. - - true if the named zip file checks OK. Otherwise, false. - - - - - - - Checks a zip file to see if its directory is consistent, - and optionally fixes the directory if necessary. - - - - - - In cases of data error, the directory within a zip file can get out of - synch with the entries in the zip file. This method checks the given - zip file, and returns true if this has occurred. It also optionally - fixes the zipfile, saving the fixed copy in Name_Fixed.zip. - - - - This method may take a long time to run for large zip files. It - will take even longer if the file actually needs to be fixed, and if - fixIfNecessary is true. - - - - This method is not supported in the Reduced or Compact - Framework versions of DotNetZip. - - - - - The filename to of the zip file to check. - - If true, the method will fix the zip file if - necessary. - - - a TextWriter in which messages generated while checking will be written. - - - true if the named zip is OK; false if the file needs to be fixed. - - - - - - - Rewrite the directory within a zipfile. - - - - - - In cases of data error, the directory in a zip file can get out of - synch with the entries in the zip file. This method attempts to fix - the zip file if this has occurred. - - - This can take a long time for large zip files. - - This won't work if the zip file uses a non-standard - code page - neither IBM437 nor UTF-8. - - - This method is not supported in the Reduced or Compact Framework - versions of DotNetZip. - - - - Developers using COM can use the ComHelper.FixZipDirectory(String) - method. - - - - - The filename to of the zip file to fix. - - - - - - - Verify the password on a zip file. - - - - - Keep in mind that passwords in zipfiles are applied to - zip entries, not to the entire zip file. So testing a - zipfile for a particular password doesn't work in the - general case. On the other hand, it's often the case - that a single password will be used on all entries in a - zip file. This method works for that case. - - - There is no way to check a password without doing the - decryption. So this code decrypts and extracts the given - zipfile into - - - - The filename to of the zip file to fix. - - The password to check. - - a bool indicating whether the password matches. - - - - Returns true if an entry by the given name exists in the ZipFile. - - - the name of the entry to find - true if an entry with the given name exists; otherwise false. - - - - Provides a string representation of the instance. - a string representation of the instance. - - - - Creates a new ZipFile instance, using the specified filename. - - - - - Applications can use this constructor to create a new ZipFile for writing, - or to slurp in an existing zip archive for read and update purposes. - - - - To create a new zip archive, an application can call this constructor, - passing the name of a file that does not exist. The name may be a fully - qualified path. Then the application can add directories or files to the - ZipFile via AddDirectory(), AddFile(), AddItem() - and then write the zip archive to the disk by calling Save(). The - zip file is not actually opened and written to the disk until the - application calls ZipFile.Save(). At that point the new zip file - with the given name is created. - - - - If you won't know the name of the Zipfile until the time you call - ZipFile.Save(), or if you plan to save to a stream (which has no - name), then you should use the no-argument constructor. - - - - The application can also call this constructor to read an existing zip - archive. passing the name of a valid zip file that does exist. But, it's - better form to use the static method, - passing the name of the zip file, because using ZipFile.Read() in - your code communicates very clearly what you are doing. In either case, - the file is then read into the ZipFile instance. The app can then - enumerate the entries or can modify the zip file, for example adding - entries, removing entries, changing comments, and so on. - - - - One advantage to this parameterized constructor: it allows applications to - use the same code to add items to a zip archive, regardless of whether the - zip file exists. - - - - Instances of the ZipFile class are not multi-thread safe. You may - not party on a single instance with multiple threads. You may have - multiple threads that each use a distinct ZipFile instance, or you - can synchronize multi-thread access to a single instance. - - - - By the way, since DotNetZip is so easy to use, don't you think you should - donate $5 or $10? - - - - - - Thrown if name refers to an existing file that is not a valid zip file. - - - - This example shows how to create a zipfile, and add a few files into it. - - String ZipFileToCreate = "archive1.zip"; - String DirectoryToZip = "c:\\reports"; - using (ZipFile zip = new ZipFile()) - { - // Store all files found in the top level directory, into the zip archive. - String[] filenames = System.IO.Directory.GetFiles(DirectoryToZip); - zip.AddFiles(filenames, "files"); - zip.Save(ZipFileToCreate); - } - - - - Dim ZipFileToCreate As String = "archive1.zip" - Dim DirectoryToZip As String = "c:\reports" - Using zip As ZipFile = New ZipFile() - Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip) - zip.AddFiles(filenames, "files") - zip.Save(ZipFileToCreate) - End Using - - - - The filename to use for the new zip archive. - - - - - Creates a new ZipFile instance, using the specified name for the - filename, and the specified Encoding. - - - - - See the documentation on the ZipFile - constructor that accepts a single string argument for basic - information on all the ZipFile constructors. - - - - The Encoding is used as the default alternate encoding for entries with - filenames or comments that cannot be encoded with the IBM437 code page. - This is equivalent to setting the property on the ZipFile - instance after construction. - - - - Instances of the ZipFile class are not multi-thread safe. You may - not party on a single instance with multiple threads. You may have - multiple threads that each use a distinct ZipFile instance, or you - can synchronize multi-thread access to a single instance. - - - - - - Thrown if name refers to an existing file that is not a valid zip file. - - - The filename to use for the new zip archive. - The Encoding is used as the default alternate - encoding for entries with filenames or comments that cannot be encoded - with the IBM437 code page. - - - - Create a zip file, without specifying a target filename or stream to save to. - - - - - See the documentation on the ZipFile - constructor that accepts a single string argument for basic - information on all the ZipFile constructors. - - - - After instantiating with this constructor and adding entries to the - archive, the application should call or - to save to a file or a - stream, respectively. The application can also set the - property and then call the no-argument method. (This - is the preferred approach for applications that use the library through - COM interop.) If you call the no-argument method - without having set the Name of the ZipFile, either through - the parameterized constructor or through the explicit property , the - Save() will throw, because there is no place to save the file. - - - Instances of the ZipFile class are not multi-thread safe. You may - have multiple threads that each use a distinct ZipFile instance, or - you can synchronize multi-thread access to a single instance. - - - - - This example creates a Zip archive called Backup.zip, containing all the files - in the directory DirectoryToZip. Files within subdirectories are not zipped up. - - using (ZipFile zip = new ZipFile()) - { - // Store all files found in the top level directory, into the zip archive. - // note: this code does not recurse subdirectories! - String[] filenames = System.IO.Directory.GetFiles(DirectoryToZip); - zip.AddFiles(filenames, "files"); - zip.Save("Backup.zip"); - } - - - - Using zip As New ZipFile - ' Store all files found in the top level directory, into the zip archive. - ' note: this code does not recurse subdirectories! - Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip) - zip.AddFiles(filenames, "files") - zip.Save("Backup.zip") - End Using - - - - - - Create a zip file, specifying a text Encoding, but without specifying a - target filename or stream to save to. - - - - - See the documentation on the ZipFile - constructor that accepts a single string argument for basic - information on all the ZipFile constructors. - - - - - - The Encoding is used as the default alternate encoding for entries with - filenames or comments that cannot be encoded with the IBM437 code page. - - - - - Creates a new ZipFile instance, using the specified name for the - filename, and the specified status message writer. - - - - - See the documentation on the ZipFile - constructor that accepts a single string argument for basic - information on all the ZipFile constructors. - - - - This version of the constructor allows the caller to pass in a TextWriter, - to which verbose messages will be written during extraction or creation of - the zip archive. A console application may wish to pass - System.Console.Out to get messages on the Console. A graphical or headless - application may wish to capture the messages in a different - TextWriter, for example, a StringWriter, and then display - the messages in a TextBox, or generate an audit log of ZipFile operations. - - - - To encrypt the data for the files added to the ZipFile instance, - set the Password property after creating the ZipFile instance. - - - - Instances of the ZipFile class are not multi-thread safe. You may - not party on a single instance with multiple threads. You may have - multiple threads that each use a distinct ZipFile instance, or you - can synchronize multi-thread access to a single instance. - - - - - - Thrown if name refers to an existing file that is not a valid zip file. - - - - - using (ZipFile zip = new ZipFile("Backup.zip", Console.Out)) - { - // Store all files found in the top level directory, into the zip archive. - // note: this code does not recurse subdirectories! - // Status messages will be written to Console.Out - String[] filenames = System.IO.Directory.GetFiles(DirectoryToZip); - zip.AddFiles(filenames); - zip.Save(); - } - - - - Using zip As New ZipFile("Backup.zip", Console.Out) - ' Store all files found in the top level directory, into the zip archive. - ' note: this code does not recurse subdirectories! - ' Status messages will be written to Console.Out - Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip) - zip.AddFiles(filenames) - zip.Save() - End Using - - - - The filename to use for the new zip archive. - A TextWriter to use for writing - verbose status messages. - - - - Creates a new ZipFile instance, using the specified name for the - filename, the specified status message writer, and the specified Encoding. - - - - - This constructor works like the ZipFile - constructor that accepts a single string argument. See that - reference for detail on what this constructor does. - - - - This version of the constructor allows the caller to pass in a - TextWriter, and an Encoding. The TextWriter will collect - verbose messages that are generated by the library during extraction or - creation of the zip archive. A console application may wish to pass - System.Console.Out to get messages on the Console. A graphical or - headless application may wish to capture the messages in a different - TextWriter, for example, a StringWriter, and then display - the messages in a TextBox, or generate an audit log of - ZipFile operations. - - - - The Encoding is used as the default alternate encoding for entries - with filenames or comments that cannot be encoded with the IBM437 code - page. This is a equivalent to setting the property on the ZipFile - instance after construction. - - - - To encrypt the data for the files added to the ZipFile instance, - set the Password property after creating the ZipFile - instance. - - - - Instances of the ZipFile class are not multi-thread safe. You may - not party on a single instance with multiple threads. You may have - multiple threads that each use a distinct ZipFile instance, or you - can synchronize multi-thread access to a single instance. - - - - - - Thrown if fileName refers to an existing file that is not a valid zip file. - - - The filename to use for the new zip archive. - A TextWriter to use for writing verbose - status messages. - - The Encoding is used as the default alternate encoding for entries with - filenames or comments that cannot be encoded with the IBM437 code page. - - - - - Initialize a ZipFile instance by reading in a zip file. - - - - - - This method is primarily useful from COM Automation environments, when - reading or extracting zip files. In COM, it is not possible to invoke - parameterized constructors for a class. A COM Automation application can - update a zip file by using the default (no argument) - constructor, then calling Initialize() to read the contents - of an on-disk zip archive into the ZipFile instance. - - - - .NET applications are encouraged to use the ZipFile.Read() methods - for better clarity. - - - - the name of the existing zip file to read in. - - - - Removes the given ZipEntry from the zip archive. - - - - - After calling RemoveEntry, the application must call Save to - make the changes permanent. - - - - - Thrown if the specified ZipEntry does not exist in the ZipFile. - - - - In this example, all entries in the zip archive dating from before - December 31st, 2007, are removed from the archive. This is actually much - easier if you use the RemoveSelectedEntries method. But I needed an - example for RemoveEntry, so here it is. - - String ZipFileToRead = "ArchiveToModify.zip"; - System.DateTime Threshold = new System.DateTime(2007,12,31); - using (ZipFile zip = ZipFile.Read(ZipFileToRead)) - { - var EntriesToRemove = new System.Collections.Generic.List<ZipEntry>(); - foreach (ZipEntry e in zip) - { - if (e.LastModified < Threshold) - { - // We cannot remove the entry from the list, within the context of - // an enumeration of said list. - // So we add the doomed entry to a list to be removed later. - EntriesToRemove.Add(e); - } - } - - // actually remove the doomed entries. - foreach (ZipEntry zombie in EntriesToRemove) - zip.RemoveEntry(zombie); - - zip.Comment= String.Format("This zip archive was updated at {0}.", - System.DateTime.Now.ToString("G")); - - // save with a different name - zip.Save("Archive-Updated.zip"); - } - - - - Dim ZipFileToRead As String = "ArchiveToModify.zip" - Dim Threshold As New DateTime(2007, 12, 31) - Using zip As ZipFile = ZipFile.Read(ZipFileToRead) - Dim EntriesToRemove As New System.Collections.Generic.List(Of ZipEntry) - Dim e As ZipEntry - For Each e In zip - If (e.LastModified < Threshold) Then - ' We cannot remove the entry from the list, within the context of - ' an enumeration of said list. - ' So we add the doomed entry to a list to be removed later. - EntriesToRemove.Add(e) - End If - Next - - ' actually remove the doomed entries. - Dim zombie As ZipEntry - For Each zombie In EntriesToRemove - zip.RemoveEntry(zombie) - Next - zip.Comment = String.Format("This zip archive was updated at {0}.", DateTime.Now.ToString("G")) - 'save as a different name - zip.Save("Archive-Updated.zip") - End Using - - - - - The ZipEntry to remove from the zip. - - - - - - - - Removes the ZipEntry with the given filename from the zip archive. - - - - - After calling RemoveEntry, the application must call Save to - make the changes permanent. - - - - - - Thrown if the ZipFile is not updatable. - - - - Thrown if a ZipEntry with the specified filename does not exist in - the ZipFile. - - - - - This example shows one way to remove an entry with a given filename from - an existing zip archive. - - - String zipFileToRead= "PackedDocuments.zip"; - string candidate = "DatedMaterial.xps"; - using (ZipFile zip = ZipFile.Read(zipFileToRead)) - { - if (zip.EntryFilenames.Contains(candidate)) - { - zip.RemoveEntry(candidate); - zip.Comment= String.Format("The file '{0}' has been removed from this archive.", - Candidate); - zip.Save(); - } - } - - - Dim zipFileToRead As String = "PackedDocuments.zip" - Dim candidate As String = "DatedMaterial.xps" - Using zip As ZipFile = ZipFile.Read(zipFileToRead) - If zip.EntryFilenames.Contains(candidate) Then - zip.RemoveEntry(candidate) - zip.Comment = String.Format("The file '{0}' has been removed from this archive.", Candidate) - zip.Save - End If - End Using - - - - - The name of the file, including any directory path, to remove from the zip. - The filename match is not case-sensitive by default; you can use the - CaseSensitiveRetrieval property to change this behavior. The - pathname can use forward-slashes or backward slashes. - - - - - - Closes the read and write streams associated - to the ZipFile, if necessary. - - - - The Dispose() method is generally employed implicitly, via a using(..) {..} - statement. (Using...End Using in VB) If you do not employ a using - statement, insure that your application calls Dispose() explicitly. For - example, in a Powershell application, or an application that uses the COM - interop interface, you must call Dispose() explicitly. - - - - This example extracts an entry selected by name, from the Zip file to the - Console. - - using (ZipFile zip = ZipFile.Read(zipfile)) - { - foreach (ZipEntry e in zip) - { - if (WantThisEntry(e.FileName)) - zip.Extract(e.FileName, Console.OpenStandardOutput()); - } - } // Dispose() is called implicitly here. - - - - Using zip As ZipFile = ZipFile.Read(zipfile) - Dim e As ZipEntry - For Each e In zip - If WantThisEntry(e.FileName) Then - zip.Extract(e.FileName, Console.OpenStandardOutput()) - End If - Next - End Using ' Dispose is implicity called here - - - - - - Disposes any managed resources, if the flag is set, then marks the - instance disposed. This method is typically not called explicitly from - application code. - - - - Applications should call the no-arg Dispose method. - - - - indicates whether the method should dispose streams or not. - - - - - Default size of the buffer used for IO. - - - - - Extracts all of the items in the zip archive, to the specified path in the - filesystem. The path can be relative or fully-qualified. - - - - - This method will extract all entries in the ZipFile to the - specified path. - - - - If an extraction of a file from the zip archive would overwrite an - existing file in the filesystem, the action taken is dictated by the - ExtractExistingFile property, which overrides any setting you may have - made on individual ZipEntry instances. By default, if you have not - set that property on the ZipFile instance, the entry will not - be extracted, the existing file will not be overwritten and an - exception will be thrown. To change this, set the property, or use the - overload that allows you to - specify an ExtractExistingFileAction parameter. - - - - The action to take when an extract would overwrite an existing file - applies to all entries. If you want to set this on a per-entry basis, - then you must use one of the ZipEntry.Extract methods. - - - - This method will send verbose output messages to the , if it is set on the ZipFile - instance. - - - - You may wish to take advantage of the ExtractProgress event. - - - - About timestamps: When extracting a file entry from a zip archive, the - extracted file gets the last modified time of the entry as stored in - the archive. The archive may also store extended file timestamp - information, including last accessed and created times. If these are - present in the ZipEntry, then the extracted file will also get - these times. - - - - A Directory entry is somewhat different. It will get the times as - described for a file entry, but, if there are file entries in the zip - archive that, when extracted, appear in the just-created directory, - then when those file entries are extracted, the last modified and last - accessed times of the directory will change, as a side effect. The - result is that after an extraction of a directory and a number of - files within the directory, the last modified and last accessed - timestamps on the directory will reflect the time that the last file - was extracted into the directory, rather than the time stored in the - zip archive for the directory. - - - - To compensate, when extracting an archive with ExtractAll, - DotNetZip will extract all the file and directory entries as described - above, but it will then make a second pass on the directories, and - reset the times on the directories to reflect what is stored in the - zip archive. - - - - This compensation is performed only within the context of an - ExtractAll. If you call ZipEntry.Extract on a directory - entry, the timestamps on directory in the filesystem will reflect the - times stored in the zip. If you then call ZipEntry.Extract on - a file entry, which is extracted into the directory, the timestamps on - the directory will be updated to the current time. - - - - - This example extracts all the entries in a zip archive file, to the - specified target directory. The extraction will overwrite any - existing files silently. - - - String TargetDirectory= "unpack"; - using(ZipFile zip= ZipFile.Read(ZipFileToExtract)) - { - zip.ExtractExistingFile= ExtractExistingFileAction.OverwriteSilently; - zip.ExtractAll(TargetDirectory); - } - - - - Dim TargetDirectory As String = "unpack" - Using zip As ZipFile = ZipFile.Read(ZipFileToExtract) - zip.ExtractExistingFile= ExtractExistingFileAction.OverwriteSilently - zip.ExtractAll(TargetDirectory) - End Using - - - - - - - - The path to which the contents of the zipfile will be extracted. - The path can be relative or fully-qualified. - - - - - - Extracts all of the items in the zip archive, to the specified path in the - filesystem, using the specified behavior when extraction would overwrite an - existing file. - - - - - - This method will extract all entries in the ZipFile to the specified - path. For an extraction that would overwrite an existing file, the behavior - is dictated by , which overrides any - setting you may have made on individual ZipEntry instances. - - - - The action to take when an extract would overwrite an existing file - applies to all entries. If you want to set this on a per-entry basis, - then you must use or one of the similar methods. - - - - Calling this method is equivalent to setting the property and then calling . - - - - This method will send verbose output messages to the - , if it is set on the ZipFile instance. - - - - - This example extracts all the entries in a zip archive file, to the - specified target directory. It does not overwrite any existing files. - - String TargetDirectory= "c:\\unpack"; - using(ZipFile zip= ZipFile.Read(ZipFileToExtract)) - { - zip.ExtractAll(TargetDirectory, ExtractExistingFileAction.DontOverwrite); - } - - - - Dim TargetDirectory As String = "c:\unpack" - Using zip As ZipFile = ZipFile.Read(ZipFileToExtract) - zip.ExtractAll(TargetDirectory, ExtractExistingFileAction.DontOverwrite) - End Using - - - - - The path to which the contents of the zipfile will be extracted. - The path can be relative or fully-qualified. - - - - The action to take if extraction would overwrite an existing file. - - - - - - Reads a zip file archive and returns the instance. - - - - - The stream is read using the default System.Text.Encoding, which is the - IBM437 codepage. - - - - - Thrown if the ZipFile cannot be read. The implementation of this method - relies on System.IO.File.OpenRead, which can throw a variety of exceptions, - including specific exceptions if a file is not found, an unauthorized access - exception, exceptions for poorly formatted filenames, and so on. - - - - The name of the zip archive to open. This can be a fully-qualified or relative - pathname. - - - . - - The instance read from the zip archive. - - - - - Reads a zip file archive from the named filesystem file using the - specified options. - - - - - This version of the Read() method allows the caller to pass - in a TextWriter an Encoding, via an instance of the - ReadOptions class. The ZipFile is read in using the - specified encoding for entries where UTF-8 encoding is not - explicitly specified. - - - - - - - This example shows how to read a zip file using the Big-5 Chinese - code page (950), and extract each entry in the zip file, while - sending status messages out to the Console. - - - - For this code to work as intended, the zipfile must have been - created using the big5 code page (CP950). This is typical, for - example, when using WinRar on a machine with CP950 set as the - default code page. In that case, the names of entries within the - Zip archive will be stored in that code page, and reading the zip - archive must be done using that code page. If the application did - not use the correct code page in ZipFile.Read(), then names of - entries within the zip archive would not be correctly retrieved. - - - - string zipToExtract = "MyArchive.zip"; - string extractDirectory = "extract"; - var options = new ReadOptions - { - StatusMessageWriter = System.Console.Out, - Encoding = System.Text.Encoding.GetEncoding(950) - }; - using (ZipFile zip = ZipFile.Read(zipToExtract, options)) - { - foreach (ZipEntry e in zip) - { - e.Extract(extractDirectory); - } - } - - - - - Dim zipToExtract as String = "MyArchive.zip" - Dim extractDirectory as String = "extract" - Dim options as New ReadOptions - options.Encoding = System.Text.Encoding.GetEncoding(950) - options.StatusMessageWriter = System.Console.Out - Using zip As ZipFile = ZipFile.Read(zipToExtract, options) - Dim e As ZipEntry - For Each e In zip - e.Extract(extractDirectory) - Next - End Using - - - - - - - - This example shows how to read a zip file using the default - code page, to remove entries that have a modified date before a given threshold, - sending status messages out to a StringWriter. - - - - var options = new ReadOptions - { - StatusMessageWriter = new System.IO.StringWriter() - }; - using (ZipFile zip = ZipFile.Read("PackedDocuments.zip", options)) - { - var Threshold = new DateTime(2007,7,4); - // We cannot remove the entry from the list, within the context of - // an enumeration of said list. - // So we add the doomed entry to a list to be removed later. - // pass 1: mark the entries for removal - var MarkedEntries = new System.Collections.Generic.List<ZipEntry>(); - foreach (ZipEntry e in zip) - { - if (e.LastModified < Threshold) - MarkedEntries.Add(e); - } - // pass 2: actually remove the entry. - foreach (ZipEntry zombie in MarkedEntries) - zip.RemoveEntry(zombie); - zip.Comment = "This archive has been updated."; - zip.Save(); - } - // can now use contents of sw, eg store in an audit log - - - - Dim options as New ReadOptions - options.StatusMessageWriter = New System.IO.StringWriter - Using zip As ZipFile = ZipFile.Read("PackedDocuments.zip", options) - Dim Threshold As New DateTime(2007, 7, 4) - ' We cannot remove the entry from the list, within the context of - ' an enumeration of said list. - ' So we add the doomed entry to a list to be removed later. - ' pass 1: mark the entries for removal - Dim MarkedEntries As New System.Collections.Generic.List(Of ZipEntry) - Dim e As ZipEntry - For Each e In zip - If (e.LastModified < Threshold) Then - MarkedEntries.Add(e) - End If - Next - ' pass 2: actually remove the entry. - Dim zombie As ZipEntry - For Each zombie In MarkedEntries - zip.RemoveEntry(zombie) - Next - zip.Comment = "This archive has been updated." - zip.Save - End Using - ' can now use contents of sw, eg store in an audit log - - - - - Thrown if the zipfile cannot be read. The implementation of - this method relies on System.IO.File.OpenRead, which - can throw a variety of exceptions, including specific - exceptions if a file is not found, an unauthorized access - exception, exceptions for poorly formatted filenames, and so - on. - - - - The name of the zip archive to open. - This can be a fully-qualified or relative pathname. - - - - The set of options to use when reading the zip file. - - - The ZipFile instance read from the zip archive. - - - - - - - Reads a zip file archive using the specified text encoding, the specified - TextWriter for status messages, and the specified ReadProgress event handler, - and returns the instance. - - - - The name of the zip archive to open. - This can be a fully-qualified or relative pathname. - - - - An event handler for Read operations. - - - - The System.IO.TextWriter to use for writing verbose status messages - during operations on the zip archive. A console application may wish to - pass System.Console.Out to get messages on the Console. A graphical - or headless application may wish to capture the messages in a different - TextWriter, such as a System.IO.StringWriter. - - - - The System.Text.Encoding to use when reading in the zip archive. Be - careful specifying the encoding. If the value you use here is not the same - as the Encoding used when the zip archive was created (possibly by a - different archiver) you will get unexpected results and possibly exceptions. - - - The instance read from the zip archive. - - - - - Reads a zip archive from a stream. - - - - - - When reading from a file, it's probably easier to just use - ZipFile.Read(String, ReadOptions). This - overload is useful when when the zip archive content is - available from an already-open stream. The stream must be - open and readable and seekable when calling this method. The - stream is left open when the reading is completed. - - - - Using this overload, the stream is read using the default - System.Text.Encoding, which is the IBM437 - codepage. If you want to specify the encoding to use when - reading the zipfile content, see - ZipFile.Read(Stream, ReadOptions). This - - - - Reading of zip content begins at the current position in the - stream. This means if you have a stream that concatenates - regular data and zip data, if you position the open, readable - stream at the start of the zip data, you will be able to read - the zip archive using this constructor, or any of the ZipFile - constructors that accept a as - input. Some examples of where this might be useful: the zip - content is concatenated at the end of a regular EXE file, as - some self-extracting archives do. (Note: SFX files produced - by DotNetZip do not work this way; they can be read as normal - ZIP files). Another example might be a stream being read from - a database, where the zip content is embedded within an - aggregate stream of data. - - - - - - - This example shows how to Read zip content from a stream, and - extract one entry into a different stream. In this example, - the filename "NameOfEntryInArchive.doc", refers only to the - name of the entry within the zip archive. A file by that - name is not created in the filesystem. The I/O is done - strictly with the given streams. - - - - using (ZipFile zip = ZipFile.Read(InputStream)) - { - zip.Extract("NameOfEntryInArchive.doc", OutputStream); - } - - - - Using zip as ZipFile = ZipFile.Read(InputStream) - zip.Extract("NameOfEntryInArchive.doc", OutputStream) - End Using - - - - the stream containing the zip data. - - The ZipFile instance read from the stream - - - - - Reads a zip file archive from the given stream using the - specified options. - - - - - - When reading from a file, it's probably easier to just use - ZipFile.Read(String, ReadOptions). This - overload is useful when when the zip archive content is - available from an already-open stream. The stream must be - open and readable and seekable when calling this method. The - stream is left open when the reading is completed. - - - - Reading of zip content begins at the current position in the - stream. This means if you have a stream that concatenates - regular data and zip data, if you position the open, readable - stream at the start of the zip data, you will be able to read - the zip archive using this constructor, or any of the ZipFile - constructors that accept a as - input. Some examples of where this might be useful: the zip - content is concatenated at the end of a regular EXE file, as - some self-extracting archives do. (Note: SFX files produced - by DotNetZip do not work this way; they can be read as normal - ZIP files). Another example might be a stream being read from - a database, where the zip content is embedded within an - aggregate stream of data. - - - - the stream containing the zip data. - - - The set of options to use when reading the zip file. - - - - Thrown if the zip archive cannot be read. - - - The ZipFile instance read from the stream. - - - - - - - Reads a zip archive from a stream, using the specified text Encoding, the - specified TextWriter for status messages, - and the specified ReadProgress event handler. - - - - - Reading of zip content begins at the current position in the stream. This - means if you have a stream that concatenates regular data and zip data, if - you position the open, readable stream at the start of the zip data, you - will be able to read the zip archive using this constructor, or any of the - ZipFile constructors that accept a as - input. Some examples of where this might be useful: the zip content is - concatenated at the end of a regular EXE file, as some self-extracting - archives do. (Note: SFX files produced by DotNetZip do not work this - way). Another example might be a stream being read from a database, where - the zip content is embedded within an aggregate stream of data. - - - - the stream containing the zip data. - - - The System.IO.TextWriter to which verbose status messages are written - during operations on the ZipFile. For example, in a console - application, System.Console.Out works, and will get a message for each entry - added to the ZipFile. If the TextWriter is null, no verbose messages - are written. - - - - The text encoding to use when reading entries that do not have the UTF-8 - encoding bit set. Be careful specifying the encoding. If the value you use - here is not the same as the Encoding used when the zip archive was created - (possibly by a different archiver) you will get unexpected results and - possibly exceptions. See the - property for more information. - - - - An event handler for Read operations. - - - an instance of ZipFile - - - - Checks the given file to see if it appears to be a valid zip file. - - - - - Calling this method is equivalent to calling with the testExtract parameter set to false. - - - - The file to check. - true if the file appears to be a zip file. - - - - Checks a file to see if it is a valid zip file. - - - - - This method opens the specified zip file, reads in the zip archive, - verifying the ZIP metadata as it reads. - - - - If everything succeeds, then the method returns true. If anything fails - - for example if an incorrect signature or CRC is found, indicating a - corrupt file, the the method returns false. This method also returns - false for a file that does not exist. - - - - If is true, as part of its check, this - method reads in the content for each entry, expands it, and checks CRCs. - This provides an additional check beyond verifying the zip header and - directory data. - - - - If is true, and if any of the zip entries - are protected with a password, this method will return false. If you want - to verify a ZipFile that has entries which are protected with a - password, you will need to do that manually. - - - - - The zip file to check. - true if the caller wants to extract each entry. - true if the file contains a valid zip file. - - - - Checks a stream to see if it contains a valid zip archive. - - - - - This method reads the zip archive contained in the specified stream, verifying - the ZIP metadata as it reads. If testExtract is true, this method also extracts - each entry in the archive, dumping all the bits into . - - - - If everything succeeds, then the method returns true. If anything fails - - for example if an incorrect signature or CRC is found, indicating a corrupt - file, the the method returns false. This method also returns false for a - file that does not exist. - - - - If testExtract is true, this method reads in the content for each - entry, expands it, and checks CRCs. This provides an additional check - beyond verifying the zip header data. - - - - If testExtract is true, and if any of the zip entries are protected - with a password, this method will return false. If you want to verify a - ZipFile that has entries which are protected with a password, you will need - to do that manually. - - - - - - The stream to check. - true if the caller wants to extract each entry. - true if the stream contains a valid zip archive. - - - - Delete file with retry on UnauthorizedAccessException. - - - - - When calling File.Delete() on a file that has been "recently" - created, the call sometimes fails with - UnauthorizedAccessException. This method simply retries the Delete 3 - times with a sleep between tries. - - - - the name of the file to be deleted - - - - Saves the Zip archive to a file, specified by the Name property of the - ZipFile. - - - - - The ZipFile instance is written to storage, typically a zip file - in a filesystem, only when the caller calls Save. In the typical - case, the Save operation writes the zip content to a temporary file, and - then renames the temporary file to the desired name. If necessary, this - method will delete a pre-existing file before the rename. - - - - The property is specified either explicitly, - or implicitly using one of the parameterized ZipFile constructors. For - COM Automation clients, the Name property must be set explicitly, - because COM Automation clients cannot call parameterized constructors. - - - - When using a filesystem file for the Zip output, it is possible to call - Save multiple times on the ZipFile instance. With each - call the zip content is re-written to the same output file. - - - - Data for entries that have been added to the ZipFile instance is - written to the output when the Save method is called. This means - that the input streams for those entries must be available at the time - the application calls Save. If, for example, the application - adds entries with AddEntry using a dynamically-allocated - MemoryStream, the memory stream must not have been disposed - before the call to Save. See the property for more discussion of the - availability requirements of the input stream for an entry, and an - approach for providing just-in-time stream lifecycle management. - - - - - - - - Thrown if you haven't specified a location or stream for saving the zip, - either in the constructor or by setting the Name property, or if you try - to save a regular zip archive to a filename with a .exe extension. - - - - Thrown if is non-zero, and the number - of segments that would be generated for the spanned zip file during the - save operation exceeds 99. If this happens, you need to increase the - segment size. - - - - - - Save the file to a new zipfile, with the given name. - - - - - This method allows the application to explicitly specify the name of the zip - file when saving. Use this when creating a new zip file, or when - updating a zip archive. - - - - An application can also save a zip archive in several places by calling this - method multiple times in succession, with different filenames. - - - - The ZipFile instance is written to storage, typically a zip file in a - filesystem, only when the caller calls Save. The Save operation writes - the zip content to a temporary file, and then renames the temporary file - to the desired name. If necessary, this method will delete a pre-existing file - before the rename. - - - - - - Thrown if you specify a directory for the filename. - - - - The name of the zip archive to save to. Existing files will - be overwritten with great prejudice. - - - - This example shows how to create and Save a zip file. - - using (ZipFile zip = new ZipFile()) - { - zip.AddDirectory(@"c:\reports\January"); - zip.Save("January.zip"); - } - - - - Using zip As New ZipFile() - zip.AddDirectory("c:\reports\January") - zip.Save("January.zip") - End Using - - - - - - This example shows how to update a zip file. - - using (ZipFile zip = ZipFile.Read("ExistingArchive.zip")) - { - zip.AddFile("NewData.csv"); - zip.Save("UpdatedArchive.zip"); - } - - - - Using zip As ZipFile = ZipFile.Read("ExistingArchive.zip") - zip.AddFile("NewData.csv") - zip.Save("UpdatedArchive.zip") - End Using - - - - - - - Save the zip archive to the specified stream. - - - - - The ZipFile instance is written to storage - typically a zip file - in a filesystem, but using this overload, the storage can be anything - accessible via a writable stream - only when the caller calls Save. - - - - Use this method to save the zip content to a stream directly. A common - scenario is an ASP.NET application that dynamically generates a zip file - and allows the browser to download it. The application can call - Save(Response.OutputStream) to write a zipfile directly to the - output stream, without creating a zip file on the disk on the ASP.NET - server. - - - - Be careful when saving a file to a non-seekable stream, including - Response.OutputStream. When DotNetZip writes to a non-seekable - stream, the zip archive is formatted in such a way that may not be - compatible with all zip tools on all platforms. It's a perfectly legal - and compliant zip file, but some people have reported problems opening - files produced this way using the Mac OS archive utility. - - - - - - - This example saves the zipfile content into a MemoryStream, and - then gets the array of bytes from that MemoryStream. - - - using (var zip = new Ionic.Zip.ZipFile()) - { - zip.CompressionLevel= Ionic.Zlib.CompressionLevel.BestCompression; - zip.Password = "VerySecret."; - zip.Encryption = EncryptionAlgorithm.WinZipAes128; - zip.AddFile(sourceFileName); - MemoryStream output = new MemoryStream(); - zip.Save(output); - - byte[] zipbytes = output.ToArray(); - } - - - - - - This example shows a pitfall you should avoid. DO NOT read - from a stream, then try to save to the same stream. DO - NOT DO THIS: - - - - using (var fs = new FileSteeam(filename, FileMode.Open)) - { - using (var zip = Ionic.Zip.ZipFile.Read(inputStream)) - { - zip.AddEntry("Name1.txt", "this is the content"); - zip.Save(inputStream); // NO NO NO!! - } - } - - - - Better like this: - - - - using (var zip = Ionic.Zip.ZipFile.Read(filename)) - { - zip.AddEntry("Name1.txt", "this is the content"); - zip.Save(); // YES! - } - - - - - - The System.IO.Stream to write to. It must be - writable. If you created the ZipFile instanct by calling - ZipFile.Read(), this stream must not be the same stream - you passed to ZipFile.Read(). - - - - - Adds to the ZipFile a set of files from the current working directory on - disk, that conform to the specified criteria. - - - - - This method selects files from the the current working directory matching - the specified criteria, and adds them to the ZipFile. - - - - Specify the criteria in statements of 3 elements: a noun, an operator, and - a value. Consider the string "name != *.doc" . The noun is "name". The - operator is "!=", implying "Not Equal". The value is "*.doc". That - criterion, in English, says "all files with a name that does not end in - the .doc extension." - - - - Supported nouns include "name" (or "filename") for the filename; "atime", - "mtime", and "ctime" for last access time, last modfied time, and created - time of the file, respectively; "attributes" (or "attrs") for the file - attributes; "size" (or "length") for the file length (uncompressed), and - "type" for the type of object, either a file or a directory. The - "attributes", "name" and "type" nouns both support = and != as operators. - The "size", "atime", "mtime", and "ctime" nouns support = and !=, and - >, >=, <, <= as well. The times are taken to be expressed in - local time. - - - - Specify values for the file attributes as a string with one or more of the - characters H,R,S,A,I,L in any order, implying file attributes of Hidden, - ReadOnly, System, Archive, NotContextIndexed, and ReparsePoint (symbolic - link) respectively. - - - - To specify a time, use YYYY-MM-DD-HH:mm:ss or YYYY/MM/DD-HH:mm:ss as the - format. If you omit the HH:mm:ss portion, it is assumed to be 00:00:00 - (midnight). - - - - The value for a size criterion is expressed in integer quantities of bytes, - kilobytes (use k or kb after the number), megabytes (m or mb), or gigabytes - (g or gb). - - - - The value for a name is a pattern to match against the filename, potentially - including wildcards. The pattern follows CMD.exe glob rules: * implies one - or more of any character, while ? implies one character. If the name - pattern contains any slashes, it is matched to the entire filename, - including the path; otherwise, it is matched against only the filename - without the path. This means a pattern of "*\*.*" matches all files one - directory level deep, while a pattern of "*.*" matches all files in all - directories. - - - - To specify a name pattern that includes spaces, use single quotes around the - pattern. A pattern of "'* *.*'" will match all files that have spaces in - the filename. The full criteria string for that would be "name = '* *.*'" . - - - - The value for a type criterion is either F (implying a file) or D (implying - a directory). - - - - Some examples: - - - - - criteria - Files retrieved - - - - name != *.xls - any file with an extension that is not .xls - - - - - name = *.mp3 - any file with a .mp3 extension. - - - - - *.mp3 - (same as above) any file with a .mp3 extension. - - - - - attributes = A - all files whose attributes include the Archive bit. - - - - - attributes != H - all files whose attributes do not include the Hidden bit. - - - - - mtime > 2009-01-01 - all files with a last modified time after January 1st, 2009. - - - - - size > 2gb - all files whose uncompressed size is greater than 2gb. - - - - - type = D - all directories in the filesystem. - - - - - - You can combine criteria with the conjunctions AND or OR. Using a string - like "name = *.txt AND size >= 100k" for the selectionCriteria retrieves - entries whose names end in .txt, and whose uncompressed size is greater than - or equal to 100 kilobytes. - - - - For more complex combinations of criteria, you can use parenthesis to group - clauses in the boolean logic. Without parenthesis, the precedence of the - criterion atoms is determined by order of appearance. Unlike the C# - language, the AND conjunction does not take precendence over the logical OR. - This is important only in strings that contain 3 or more criterion atoms. - In other words, "name = *.txt and size > 1000 or attributes = H" implies - "((name = *.txt AND size > 1000) OR attributes = H)" while "attributes = - H OR name = *.txt and size > 1000" evaluates to "((attributes = H OR name - = *.txt) AND size > 1000)". When in doubt, use parenthesis. - - - - Using time properties requires some extra care. If you want to retrieve all - entries that were last updated on 2009 February 14, specify a time range - like so:"mtime >= 2009-02-14 AND mtime < 2009-02-15". Read this to - say: all files updated after 12:00am on February 14th, until 12:00am on - February 15th. You can use the same bracketing approach to specify any time - period - a year, a month, a week, and so on. - - - - The syntax allows one special case: if you provide a string with no spaces, it is - treated as a pattern to match for the filename. Therefore a string like "*.xls" - will be equivalent to specifying "name = *.xls". - - - - There is no logic in this method that insures that the file inclusion - criteria are internally consistent. For example, it's possible to specify - criteria that says the file must have a size of less than 100 bytes, as well - as a size that is greater than 1000 bytes. Obviously no file will ever - satisfy such criteria, but this method does not detect such logical - inconsistencies. The caller is responsible for insuring the criteria are - sensible. - - - - Using this method, the file selection does not recurse into - subdirectories, and the full path of the selected files is included in the - entries added into the zip archive. If you don't like these behaviors, - see the other overloads of this method. - - - - - This example zips up all *.csv files in the current working directory. - - using (ZipFile zip = new ZipFile()) - { - // To just match on filename wildcards, - // use the shorthand form of the selectionCriteria string. - zip.AddSelectedFiles("*.csv"); - zip.Save(PathToZipArchive); - } - - - Using zip As ZipFile = New ZipFile() - zip.AddSelectedFiles("*.csv") - zip.Save(PathToZipArchive) - End Using - - - - The criteria for file selection - - - - Adds to the ZipFile a set of files from the disk that conform to the - specified criteria, optionally recursing into subdirectories. - - - - - This method selects files from the the current working directory matching - the specified criteria, and adds them to the ZipFile. If - recurseDirectories is true, files are also selected from - subdirectories, and the directory structure in the filesystem is - reproduced in the zip archive, rooted at the current working directory. - - - - Using this method, the full path of the selected files is included in the - entries added into the zip archive. If you don't want this behavior, use - one of the overloads of this method that allows the specification of a - directoryInArchive. - - - - For details on the syntax for the selectionCriteria parameter, see . - - - - - - - This example zips up all *.xml files in the current working directory, or any - subdirectory, that are larger than 1mb. - - - using (ZipFile zip = new ZipFile()) - { - // Use a compound expression in the selectionCriteria string. - zip.AddSelectedFiles("name = *.xml and size > 1024kb", true); - zip.Save(PathToZipArchive); - } - - - Using zip As ZipFile = New ZipFile() - ' Use a compound expression in the selectionCriteria string. - zip.AddSelectedFiles("name = *.xml and size > 1024kb", true) - zip.Save(PathToZipArchive) - End Using - - - - The criteria for file selection - - - If true, the file selection will recurse into subdirectories. - - - - - Adds to the ZipFile a set of files from a specified directory in the - filesystem, that conform to the specified criteria. - - - - - This method selects files that conform to the specified criteria, from the - the specified directory on disk, and adds them to the ZipFile. The search - does not recurse into subdirectores. - - - - Using this method, the full filesystem path of the files on disk is - reproduced on the entries added to the zip file. If you don't want this - behavior, use one of the other overloads of this method. - - - - For details on the syntax for the selectionCriteria parameter, see . - - - - - - - This example zips up all *.xml files larger than 1mb in the directory - given by "d:\rawdata". - - - using (ZipFile zip = new ZipFile()) - { - // Use a compound expression in the selectionCriteria string. - zip.AddSelectedFiles("name = *.xml and size > 1024kb", "d:\\rawdata"); - zip.Save(PathToZipArchive); - } - - - - Using zip As ZipFile = New ZipFile() - ' Use a compound expression in the selectionCriteria string. - zip.AddSelectedFiles("name = *.xml and size > 1024kb", "d:\rawdata) - zip.Save(PathToZipArchive) - End Using - - - - The criteria for file selection - - - The name of the directory on the disk from which to select files. - - - - - Adds to the ZipFile a set of files from the specified directory on disk, - that conform to the specified criteria. - - - - - - This method selects files from the the specified disk directory matching - the specified selection criteria, and adds them to the ZipFile. If - recurseDirectories is true, files are also selected from - subdirectories. - - - - The full directory structure in the filesystem is reproduced on the - entries added to the zip archive. If you don't want this behavior, use - one of the overloads of this method that allows the specification of a - directoryInArchive. - - - - For details on the syntax for the selectionCriteria parameter, see . - - - - - - This example zips up all *.csv files in the "files" directory, or any - subdirectory, that have been saved since 2009 February 14th. - - - using (ZipFile zip = new ZipFile()) - { - // Use a compound expression in the selectionCriteria string. - zip.AddSelectedFiles("name = *.csv and mtime > 2009-02-14", "files", true); - zip.Save(PathToZipArchive); - } - - - Using zip As ZipFile = New ZipFile() - ' Use a compound expression in the selectionCriteria string. - zip.AddSelectedFiles("name = *.csv and mtime > 2009-02-14", "files", true) - zip.Save(PathToZipArchive) - End Using - - - - - This example zips up all files in the current working - directory, and all its child directories, except those in - the excludethis subdirectory. - - Using Zip As ZipFile = New ZipFile(zipfile) - Zip.AddSelectedFfiles("name != 'excludethis\*.*'", datapath, True) - Zip.Save() - End Using - - - - The criteria for file selection - - - The filesystem path from which to select files. - - - - If true, the file selection will recurse into subdirectories. - - - - - Adds to the ZipFile a selection of files from the specified directory on - disk, that conform to the specified criteria, and using a specified root - path for entries added to the zip archive. - - - - - This method selects files from the specified disk directory matching the - specified selection criteria, and adds those files to the ZipFile, using - the specified directory path in the archive. The search does not recurse - into subdirectories. For details on the syntax for the selectionCriteria - parameter, see . - - - - - - - This example zips up all *.psd files in the "photos" directory that have - been saved since 2009 February 14th, and puts them all in a zip file, - using the directory name of "content" in the zip archive itself. When the - zip archive is unzipped, the folder containing the .psd files will be - named "content". - - - using (ZipFile zip = new ZipFile()) - { - // Use a compound expression in the selectionCriteria string. - zip.AddSelectedFiles("name = *.psd and mtime > 2009-02-14", "photos", "content"); - zip.Save(PathToZipArchive); - } - - - Using zip As ZipFile = New ZipFile - zip.AddSelectedFiles("name = *.psd and mtime > 2009-02-14", "photos", "content") - zip.Save(PathToZipArchive) - End Using - - - - - The criteria for selection of files to add to the ZipFile. - - - - The path to the directory in the filesystem from which to select files. - - - - Specifies a directory path to use to in place of the - directoryOnDisk. This path may, or may not, correspond to a real - directory in the current filesystem. If the files within the zip are - later extracted, this is the path used for the extracted file. Passing - null (nothing in VB) will use the path on the file name, if any; in other - words it would use directoryOnDisk, plus any subdirectory. Passing - the empty string ("") will insert the item at the root path within the - archive. - - - - - Adds to the ZipFile a selection of files from the specified directory on - disk, that conform to the specified criteria, optionally recursing through - subdirectories, and using a specified root path for entries added to the - zip archive. - - - - This method selects files from the specified disk directory that match the - specified selection criteria, and adds those files to the ZipFile, using - the specified directory path in the archive. If recurseDirectories - is true, files are also selected from subdirectories, and the directory - structure in the filesystem is reproduced in the zip archive, rooted at - the directory specified by directoryOnDisk. For details on the - syntax for the selectionCriteria parameter, see . - - - - - This example zips up all files that are NOT *.pst files, in the current - working directory and any subdirectories. - - - using (ZipFile zip = new ZipFile()) - { - zip.AddSelectedFiles("name != *.pst", SourceDirectory, "backup", true); - zip.Save(PathToZipArchive); - } - - - Using zip As ZipFile = New ZipFile - zip.AddSelectedFiles("name != *.pst", SourceDirectory, "backup", true) - zip.Save(PathToZipArchive) - End Using - - - - - The criteria for selection of files to add to the ZipFile. - - - - The path to the directory in the filesystem from which to select files. - - - - Specifies a directory path to use to in place of the - directoryOnDisk. This path may, or may not, correspond to a real - directory in the current filesystem. If the files within the zip are - later extracted, this is the path used for the extracted file. Passing - null (nothing in VB) will use the path on the file name, if any; in other - words it would use directoryOnDisk, plus any subdirectory. Passing - the empty string ("") will insert the item at the root path within the - archive. - - - - If true, the method also scans subdirectories for files matching the - criteria. - - - - - Updates the ZipFile with a selection of files from the disk that conform - to the specified criteria. - - - - This method selects files from the specified disk directory that match the - specified selection criteria, and Updates the ZipFile with those - files, using the specified directory path in the archive. If - recurseDirectories is true, files are also selected from - subdirectories, and the directory structure in the filesystem is - reproduced in the zip archive, rooted at the directory specified by - directoryOnDisk. For details on the syntax for the - selectionCriteria parameter, see . - - - - The criteria for selection of files to add to the ZipFile. - - - - The path to the directory in the filesystem from which to select files. - - - - Specifies a directory path to use to in place of the - directoryOnDisk. This path may, or may not, correspond to a - real directory in the current filesystem. If the files within the zip - are later extracted, this is the path used for the extracted file. - Passing null (nothing in VB) will use the path on the file name, if - any; in other words it would use directoryOnDisk, plus any - subdirectory. Passing the empty string ("") will insert the item at - the root path within the archive. - - - - If true, the method also scans subdirectories for files matching the criteria. - - - - - - - Retrieve entries from the zipfile by specified criteria. - - - - - This method allows callers to retrieve the collection of entries from the zipfile - that fit the specified criteria. The criteria are described in a string format, and - can include patterns for the filename; constraints on the size of the entry; - constraints on the last modified, created, or last accessed time for the file - described by the entry; or the attributes of the entry. - - - - For details on the syntax for the selectionCriteria parameter, see . - - - - This method is intended for use with a ZipFile that has been read from storage. - When creating a new ZipFile, this method will work only after the ZipArchive has - been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip - archive from storage.) Calling SelectEntries on a ZipFile that has not yet been - saved will deliver undefined results. - - - - - Thrown if selectionCriteria has an invalid syntax. - - - - This example selects all the PhotoShop files from within an archive, and extracts them - to the current working directory. - - using (ZipFile zip1 = ZipFile.Read(ZipFileName)) - { - var PhotoShopFiles = zip1.SelectEntries("*.psd"); - foreach (ZipEntry psd in PhotoShopFiles) - { - psd.Extract(); - } - } - - - Using zip1 As ZipFile = ZipFile.Read(ZipFileName) - Dim PhotoShopFiles as ICollection(Of ZipEntry) - PhotoShopFiles = zip1.SelectEntries("*.psd") - Dim psd As ZipEntry - For Each psd In PhotoShopFiles - psd.Extract - Next - End Using - - - the string that specifies which entries to select - a collection of ZipEntry objects that conform to the inclusion spec - - - - Retrieve entries from the zipfile by specified criteria. - - - - - This method allows callers to retrieve the collection of entries from the zipfile - that fit the specified criteria. The criteria are described in a string format, and - can include patterns for the filename; constraints on the size of the entry; - constraints on the last modified, created, or last accessed time for the file - described by the entry; or the attributes of the entry. - - - - For details on the syntax for the selectionCriteria parameter, see . - - - - This method is intended for use with a ZipFile that has been read from storage. - When creating a new ZipFile, this method will work only after the ZipArchive has - been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip - archive from storage.) Calling SelectEntries on a ZipFile that has not yet been - saved will deliver undefined results. - - - - - Thrown if selectionCriteria has an invalid syntax. - - - - - using (ZipFile zip1 = ZipFile.Read(ZipFileName)) - { - var UpdatedPhotoShopFiles = zip1.SelectEntries("*.psd", "UpdatedFiles"); - foreach (ZipEntry e in UpdatedPhotoShopFiles) - { - // prompt for extract here - if (WantExtract(e.FileName)) - e.Extract(); - } - } - - - Using zip1 As ZipFile = ZipFile.Read(ZipFileName) - Dim UpdatedPhotoShopFiles As ICollection(Of ZipEntry) = zip1.SelectEntries("*.psd", "UpdatedFiles") - Dim e As ZipEntry - For Each e In UpdatedPhotoShopFiles - ' prompt for extract here - If Me.WantExtract(e.FileName) Then - e.Extract - End If - Next - End Using - - - the string that specifies which entries to select - - - the directory in the archive from which to select entries. If null, then - all directories in the archive are used. - - - a collection of ZipEntry objects that conform to the inclusion spec - - - - Remove entries from the zipfile by specified criteria. - - - - - This method allows callers to remove the collection of entries from the zipfile - that fit the specified criteria. The criteria are described in a string format, and - can include patterns for the filename; constraints on the size of the entry; - constraints on the last modified, created, or last accessed time for the file - described by the entry; or the attributes of the entry. - - - - For details on the syntax for the selectionCriteria parameter, see . - - - - This method is intended for use with a ZipFile that has been read from storage. - When creating a new ZipFile, this method will work only after the ZipArchive has - been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip - archive from storage.) Calling SelectEntries on a ZipFile that has not yet been - saved will deliver undefined results. - - - - - Thrown if selectionCriteria has an invalid syntax. - - - - This example removes all entries in a zip file that were modified prior to January 1st, 2008. - - using (ZipFile zip1 = ZipFile.Read(ZipFileName)) - { - // remove all entries from prior to Jan 1, 2008 - zip1.RemoveEntries("mtime < 2008-01-01"); - // don't forget to save the archive! - zip1.Save(); - } - - - Using zip As ZipFile = ZipFile.Read(ZipFileName) - ' remove all entries from prior to Jan 1, 2008 - zip1.RemoveEntries("mtime < 2008-01-01") - ' do not forget to save the archive! - zip1.Save - End Using - - - the string that specifies which entries to select - the number of entries removed - - - - Remove entries from the zipfile by specified criteria, and within the specified - path in the archive. - - - - - This method allows callers to remove the collection of entries from the zipfile - that fit the specified criteria. The criteria are described in a string format, and - can include patterns for the filename; constraints on the size of the entry; - constraints on the last modified, created, or last accessed time for the file - described by the entry; or the attributes of the entry. - - - - For details on the syntax for the selectionCriteria parameter, see . - - - - This method is intended for use with a ZipFile that has been read from storage. - When creating a new ZipFile, this method will work only after the ZipArchive has - been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip - archive from storage.) Calling SelectEntries on a ZipFile that has not yet been - saved will deliver undefined results. - - - - - Thrown if selectionCriteria has an invalid syntax. - - - - - using (ZipFile zip1 = ZipFile.Read(ZipFileName)) - { - // remove all entries from prior to Jan 1, 2008 - zip1.RemoveEntries("mtime < 2008-01-01", "documents"); - // a call to ZipFile.Save will make the modifications permanent - zip1.Save(); - } - - - Using zip As ZipFile = ZipFile.Read(ZipFileName) - ' remove all entries from prior to Jan 1, 2008 - zip1.RemoveEntries("mtime < 2008-01-01", "documents") - ' a call to ZipFile.Save will make the modifications permanent - zip1.Save - End Using - - - - the string that specifies which entries to select - - the directory in the archive from which to select entries. If null, then - all directories in the archive are used. - - the number of entries removed - - - - Selects and Extracts a set of Entries from the ZipFile. - - - - - The entries are extracted into the current working directory. - - - - If any of the files to be extracted already exist, then the action taken is as - specified in the property on the - corresponding ZipEntry instance. By default, the action taken in this case is to - throw an exception. - - - - For information on the syntax of the selectionCriteria string, - see . - - - - - This example shows how extract all XML files modified after 15 January 2009. - - using (ZipFile zip = ZipFile.Read(zipArchiveName)) - { - zip.ExtractSelectedEntries("name = *.xml and mtime > 2009-01-15"); - } - - - the selection criteria for entries to extract. - - - - - - Selects and Extracts a set of Entries from the ZipFile. - - - - - The entries are extracted into the current working directory. When extraction would would - overwrite an existing filesystem file, the action taken is as specified in the - parameter. - - - - For information on the syntax of the string describing the entry selection criteria, - see . - - - - - This example shows how extract all XML files modified after 15 January 2009, - overwriting any existing files. - - using (ZipFile zip = ZipFile.Read(zipArchiveName)) - { - zip.ExtractSelectedEntries("name = *.xml and mtime > 2009-01-15", - ExtractExistingFileAction.OverwriteSilently); - } - - - - the selection criteria for entries to extract. - - - The action to take if extraction would overwrite an existing file. - - - - - Selects and Extracts a set of Entries from the ZipFile. - - - - - The entries are selected from the specified directory within the archive, and then - extracted into the current working directory. - - - - If any of the files to be extracted already exist, then the action taken is as - specified in the property on the - corresponding ZipEntry instance. By default, the action taken in this case is to - throw an exception. - - - - For information on the syntax of the string describing the entry selection criteria, - see . - - - - - This example shows how extract all XML files modified after 15 January 2009, - and writes them to the "unpack" directory. - - using (ZipFile zip = ZipFile.Read(zipArchiveName)) - { - zip.ExtractSelectedEntries("name = *.xml and mtime > 2009-01-15","unpack"); - } - - - - the selection criteria for entries to extract. - - - the directory in the archive from which to select entries. If null, then - all directories in the archive are used. - - - - - - - Selects and Extracts a set of Entries from the ZipFile. - - - - - The entries are extracted into the specified directory. If any of the files to be - extracted already exist, an exception will be thrown. - - - For information on the syntax of the string describing the entry selection criteria, - see . - - - - the selection criteria for entries to extract. - - - the directory in the archive from which to select entries. If null, then - all directories in the archive are used. - - - - the directory on the disk into which to extract. It will be created - if it does not exist. - - - - - Selects and Extracts a set of Entries from the ZipFile. - - - - - The entries are extracted into the specified directory. When extraction would would - overwrite an existing filesystem file, the action taken is as specified in the - parameter. - - - - For information on the syntax of the string describing the entry selection criteria, - see . - - - - - This example shows how extract all files with an XML extension or with a size larger than 100,000 bytes, - and puts them in the unpack directory. For any files that already exist in - that destination directory, they will not be overwritten. - - using (ZipFile zip = ZipFile.Read(zipArchiveName)) - { - zip.ExtractSelectedEntries("name = *.xml or size > 100000", - null, - "unpack", - ExtractExistingFileAction.DontOverwrite); - } - - - - the selection criteria for entries to extract. - - - The directory on the disk into which to extract. It will be created if it does not exist. - - - - The directory in the archive from which to select entries. If null, then - all directories in the archive are used. - - - - The action to take if extraction would overwrite an existing file. - - - - - - Saves the ZipFile instance to a self-extracting zip archive. - - - - - - The generated exe image will execute on any machine that has the .NET - Framework 2.0 installed on it. The generated exe image is also a - valid ZIP file, readable with DotNetZip or another Zip library or tool - such as WinZip. - - - - There are two "flavors" of self-extracting archive. The - WinFormsApplication version will pop up a GUI and allow the - user to select a target directory into which to extract. There's also - a checkbox allowing the user to specify to overwrite existing files, - and another checkbox to allow the user to request that Explorer be - opened to see the extracted files after extraction. The other flavor - is ConsoleApplication. A self-extractor generated with that - flavor setting will run from the command line. It accepts command-line - options to set the overwrite behavior, and to specify the target - extraction directory. - - - - There are a few temporary files created during the saving to a - self-extracting zip. These files are created in the directory pointed - to by , which defaults to . These temporary files are - removed upon successful completion of this method. - - - - When a user runs the WinForms SFX, the user's personal directory (Environment.SpecialFolder.Personal) - will be used as the default extract location. If you want to set the - default extract location, you should use the other overload of - SaveSelfExtractor()/ The user who runs the SFX will have the - opportunity to change the extract directory before extracting. When - the user runs the Command-Line SFX, the user must explicitly specify - the directory to which to extract. The .NET Framework 2.0 is required - on the computer when the self-extracting archive is run. - - - - NB: This method is not available in the version of DotNetZip build for - the .NET Compact Framework, nor in the "Reduced" DotNetZip library. - - - - - - - string DirectoryPath = "c:\\Documents\\Project7"; - using (ZipFile zip = new ZipFile()) - { - zip.AddDirectory(DirectoryPath, System.IO.Path.GetFileName(DirectoryPath)); - zip.Comment = "This will be embedded into a self-extracting console-based exe"; - zip.SaveSelfExtractor("archive.exe", SelfExtractorFlavor.ConsoleApplication); - } - - - Dim DirectoryPath As String = "c:\Documents\Project7" - Using zip As New ZipFile() - zip.AddDirectory(DirectoryPath, System.IO.Path.GetFileName(DirectoryPath)) - zip.Comment = "This will be embedded into a self-extracting console-based exe" - zip.SaveSelfExtractor("archive.exe", SelfExtractorFlavor.ConsoleApplication) - End Using - - - - - a pathname, possibly fully qualified, to be created. Typically it - will end in an .exe extension. - - Indicates whether a Winforms or Console self-extractor is - desired. - - - - Saves the ZipFile instance to a self-extracting zip archive, using - the specified save options. - - - - - This method saves a self extracting archive, using the specified save - options. These options include the flavor of the SFX, the default extract - directory, the icon file, and so on. See the documentation - for for more - details. - - - - The user who runs the SFX will have the opportunity to change the extract - directory before extracting. If at the time of extraction, the specified - directory does not exist, the SFX will create the directory before - extracting the files. - - - - - - This example saves a WinForms-based self-extracting archive EXE that - will use c:\ExtractHere as the default extract location. The C# code - shows syntax for .NET 3.0, which uses an object initializer for - the SelfExtractorOptions object. - - string DirectoryPath = "c:\\Documents\\Project7"; - using (ZipFile zip = new ZipFile()) - { - zip.AddDirectory(DirectoryPath, System.IO.Path.GetFileName(DirectoryPath)); - zip.Comment = "This will be embedded into a self-extracting WinForms-based exe"; - var options = new SelfExtractorOptions - { - Flavor = SelfExtractorFlavor.WinFormsApplication, - DefaultExtractDirectory = "%USERPROFILE%\\ExtractHere", - PostExtractCommandLine = ExeToRunAfterExtract, - SfxExeWindowTitle = "My Custom Window Title", - RemoveUnpackedFilesAfterExecute = true - }; - zip.SaveSelfExtractor("archive.exe", options); - } - - - Dim DirectoryPath As String = "c:\Documents\Project7" - Using zip As New ZipFile() - zip.AddDirectory(DirectoryPath, System.IO.Path.GetFileName(DirectoryPath)) - zip.Comment = "This will be embedded into a self-extracting console-based exe" - Dim options As New SelfExtractorOptions() - options.Flavor = SelfExtractorFlavor.WinFormsApplication - options.DefaultExtractDirectory = "%USERPROFILE%\\ExtractHere" - options.PostExtractCommandLine = ExeToRunAfterExtract - options.SfxExeWindowTitle = "My Custom Window Title" - options.RemoveUnpackedFilesAfterExecute = True - zip.SaveSelfExtractor("archive.exe", options) - End Using - - - - The name of the EXE to generate. - provides the options for creating the - Self-extracting archive. - - - - Generic IEnumerator support, for use of a ZipFile in an enumeration. - - - - You probably do not want to call GetEnumerator explicitly. Instead - it is implicitly called when you use a loop in C#, or a - For Each loop in VB.NET. - - - - This example reads a zipfile of a given name, then enumerates the - entries in that zip file, and displays the information about each - entry on the Console. - - using (ZipFile zip = ZipFile.Read(zipfile)) - { - bool header = true; - foreach (ZipEntry e in zip) - { - if (header) - { - System.Console.WriteLine("Zipfile: {0}", zip.Name); - System.Console.WriteLine("Version Needed: 0x{0:X2}", e.VersionNeeded); - System.Console.WriteLine("BitField: 0x{0:X2}", e.BitField); - System.Console.WriteLine("Compression Method: 0x{0:X2}", e.CompressionMethod); - System.Console.WriteLine("\n{1,-22} {2,-6} {3,4} {4,-8} {0}", - "Filename", "Modified", "Size", "Ratio", "Packed"); - System.Console.WriteLine(new System.String('-', 72)); - header = false; - } - - System.Console.WriteLine("{1,-22} {2,-6} {3,4:F0}% {4,-8} {0}", - e.FileName, - e.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), - e.UncompressedSize, - e.CompressionRatio, - e.CompressedSize); - - e.Extract(); - } - } - - - - Dim ZipFileToExtract As String = "c:\foo.zip" - Using zip As ZipFile = ZipFile.Read(ZipFileToExtract) - Dim header As Boolean = True - Dim e As ZipEntry - For Each e In zip - If header Then - Console.WriteLine("Zipfile: {0}", zip.Name) - Console.WriteLine("Version Needed: 0x{0:X2}", e.VersionNeeded) - Console.WriteLine("BitField: 0x{0:X2}", e.BitField) - Console.WriteLine("Compression Method: 0x{0:X2}", e.CompressionMethod) - Console.WriteLine(ChrW(10) & "{1,-22} {2,-6} {3,4} {4,-8} {0}", _ - "Filename", "Modified", "Size", "Ratio", "Packed" ) - Console.WriteLine(New String("-"c, 72)) - header = False - End If - Console.WriteLine("{1,-22} {2,-6} {3,4:F0}% {4,-8} {0}", _ - e.FileName, _ - e.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), _ - e.UncompressedSize, _ - e.CompressionRatio, _ - e.CompressedSize ) - e.Extract - Next - End Using - - - - A generic enumerator suitable for use within a foreach loop. - - - - An IEnumerator, for use of a ZipFile in a foreach construct. - - - - This method is included for COM support. An application generally does not call - this method directly. It is called implicitly by COM clients when enumerating - the entries in the ZipFile instance. In VBScript, this is done with a For Each - statement. In Javascript, this is done with new Enumerator(zipfile). - - - - The IEnumerator over the entries in the ZipFile. - - - - - Provides a human-readable string with information about the ZipFile. - - - - - The information string contains 10 lines or so, about each ZipEntry, - describing whether encryption is in use, the compressed and uncompressed - length of the entry, the offset of the entry, and so on. As a result the - information string can be very long for zip files that contain many - entries. - - - This information is mostly useful for diagnostic purposes. - - - - - - Indicates whether to perform a full scan of the zip file when reading it. - - - - - - You almost never want to use this property. - - - - When reading a zip file, if this flag is true (True in - VB), the entire zip archive will be scanned and searched for entries. - For large archives, this can take a very, long time. The much more - efficient default behavior is to read the zip directory, which is - stored at the end of the zip file. But, in some cases the directory is - corrupted and you need to perform a full scan of the zip file to - determine the contents of the zip file. This property lets you do - that, when necessary. - - - - This flag is effective only when calling . Normally you would read a ZipFile with the - static ZipFile.Read - method. But you can't set the FullScan property on the - ZipFile instance when you use a static factory method like - ZipFile.Read. - - - - - - - This example shows how to read a zip file using the full scan approach, - and then save it, thereby producing a corrected zip file. - - - using (var zip = new ZipFile()) - { - zip.FullScan = true; - zip.Initialize(zipFileName); - zip.Save(newName); - } - - - - Using zip As New ZipFile - zip.FullScan = True - zip.Initialize(zipFileName) - zip.Save(newName) - End Using - - - - - - - Whether to sort the ZipEntries before saving the file. - - - - The default is false. If you have a large number of zip entries, the sort - alone can consume significant time. - - - - - using (var zip = new ZipFile()) - { - zip.AddFiles(filesToAdd); - zip.SortEntriesBeforeSaving = true; - zip.Save(name); - } - - - - Using zip As New ZipFile - zip.AddFiles(filesToAdd) - zip.SortEntriesBeforeSaving = True - zip.Save(name) - End Using - - - - - - - Indicates whether NTFS Reparse Points, like junctions, should be - traversed during calls to AddDirectory(). - - - - By default, calls to AddDirectory() will traverse NTFS reparse - points, like mounted volumes, and directory junctions. An example - of a junction is the "My Music" directory in Windows Vista. In some - cases you may not want DotNetZip to traverse those directories. In - that case, set this property to false. - - - - - using (var zip = new ZipFile()) - { - zip.AddDirectoryWillTraverseReparsePoints = false; - zip.AddDirectory(dirToZip,"fodder"); - zip.Save(zipFileToCreate); - } - - - - - - Size of the IO buffer used while saving. - - - - - - First, let me say that you really don't need to bother with this. It is - here to allow for optimizations that you probably won't make! It will work - fine if you don't set or get this property at all. Ok? - - - - Now that we have that out of the way, the fine print: This - property affects the size of the buffer that is used for I/O for each - entry contained in the zip file. When a file is read in to be compressed, - it uses a buffer given by the size here. When you update a zip file, the - data for unmodified entries is copied from the first zip file to the - other, through a buffer given by the size here. - - - - Changing the buffer size affects a few things: first, for larger buffer - sizes, the memory used by the ZipFile, obviously, will be larger - during I/O operations. This may make operations faster for very much - larger files. Last, for any given entry, when you use a larger buffer - there will be fewer progress events during I/O operations, because there's - one progress event generated for each time the buffer is filled and then - emptied. - - - - The default buffer size is 8k. Increasing the buffer size may speed - things up as you compress larger files. But there are no hard-and-fast - rules here, eh? You won't know til you test it. And there will be a - limit where ever larger buffers actually slow things down. So as I said - in the beginning, it's probably best if you don't set or get this property - at all. - - - - - - This example shows how you might set a large buffer size for efficiency when - dealing with zip entries that are larger than 1gb. - - using (ZipFile zip = new ZipFile()) - { - zip.SaveProgress += this.zip1_SaveProgress; - zip.AddDirectory(directoryToZip, ""); - zip.UseZip64WhenSaving = Zip64Option.Always; - zip.BufferSize = 65536*8; // 65536 * 8 = 512k - zip.Save(ZipFileToCreate); - } - - - - - - Size of the work buffer to use for the ZLIB codec during compression. - - - - - When doing ZLIB or Deflate compression, the library fills a buffer, - then passes it to the compressor for compression. Then the library - reads out the compressed bytes. This happens repeatedly until there - is no more uncompressed data to compress. This property sets the - size of the buffer that will be used for chunk-wise compression. In - order for the setting to take effect, your application needs to set - this property before calling one of the ZipFile.Save() - overloads. - - - Setting this affects the performance and memory efficiency of - compression and decompression. For larger files, setting this to a - larger size may improve compression performance, but the exact - numbers vary depending on available memory, the size of the streams - you are compressing, and a bunch of other variables. I don't have - good firm recommendations on how to set it. You'll have to test it - yourself. Or just leave it alone and accept the default. - - - - - - Indicates whether extracted files should keep their paths as - stored in the zip archive. - - - - - This property affects Extraction. It is not used when creating zip - archives. - - - - With this property set to false, the default, extracting entries - from a zip file will create files in the filesystem that have the full - path associated to the entry within the zip file. With this property set - to true, extracting entries from the zip file results in files - with no path: the folders are "flattened." - - - - An example: suppose the zip file contains entries /directory1/file1.txt and - /directory2/file2.txt. With FlattenFoldersOnExtract set to false, - the files created will be \directory1\file1.txt and \directory2\file2.txt. - With the property set to true, the files created are file1.txt and file2.txt. - - - - - - - The compression strategy to use for all entries. - - - - Set the Strategy used by the ZLIB-compatible compressor, when - compressing entries using the DEFLATE method. Different compression - strategies work better on different sorts of data. The strategy - parameter can affect the compression ratio and the speed of - compression but not the correctness of the compresssion. For more - information see Ionic.Zlib.CompressionStrategy. - - - - - The name of the ZipFile, on disk. - - - - - - When the ZipFile instance was created by reading an archive using - one of the ZipFile.Read methods, this property represents the name - of the zip file that was read. When the ZipFile instance was - created by using the no-argument constructor, this value is null - (Nothing in VB). - - - - If you use the no-argument constructor, and you then explicitly set this - property, when you call , this name will - specify the name of the zip file created. Doing so is equivalent to - calling . When instantiating a - ZipFile by reading from a stream or byte array, the Name - property remains null. When saving to a stream, the Name - property is implicitly set to null. - - - - - - Sets the compression level to be used for entries subsequently added to - the zip archive. - - - - - Varying the compression level used on entries can affect the - size-vs-speed tradeoff when compression and decompressing data streams - or files. - - - - As with some other properties on the ZipFile class, like , , and , setting this property on a ZipFile - instance will cause the specified CompressionLevel to be used on all - items that are subsequently added to the - ZipFile instance. If you set this property after you have added - items to the ZipFile, but before you have called Save(), - those items will not use the specified compression level. - - - - If you do not set this property, the default compression level is used, - which normally gives a good balance of compression efficiency and - compression speed. In some tests, using BestCompression can - double the time it takes to compress, while delivering just a small - increase in compression efficiency. This behavior will vary with the - type of data you compress. If you are in doubt, just leave this setting - alone, and accept the default. - - - - - - The compression method for the zipfile. - - - - By default, the compression method is CompressionMethod.Deflate. - - - - - - - A comment attached to the zip archive. - - - - - - This property is read/write. It allows the application to specify a - comment for the ZipFile, or read the comment for the - ZipFile. After setting this property, changes are only made - permanent when you call a Save() method. - - - - According to PKWARE's - zip specification, the comment is not encrypted, even if there is a - password set on the zip file. - - - - The specification does not describe how to indicate the encoding used - on a comment string. Many "compliant" zip tools and libraries use - IBM437 as the code page for comments; DotNetZip, too, follows that - practice. On the other hand, there are situations where you want a - Comment to be encoded with something else, for example using code page - 950 "Big-5 Chinese". To fill that need, DotNetZip will encode the - comment following the same procedure it follows for encoding - filenames: (a) if is - Never, it uses the default encoding (IBM437). (b) if is Always, it always uses the - alternate encoding (). (c) if is AsNecessary, it uses the - alternate encoding only if the default encoding is not sufficient for - encoding the comment - in other words if decoding the result does not - produce the original string. This decision is taken at the time of - the call to ZipFile.Save(). - - - - When creating a zip archive using this library, it is possible to change - the value of between each - entry you add, and between adding entries and the call to - Save(). Don't do this. It will likely result in a zip file that is - not readable by any tool or application. For best interoperability, leave - alone, or specify it only - once, before adding any entries to the ZipFile instance. - - - - - - - Specifies whether the Creation, Access, and Modified times for entries - added to the zip file will be emitted in “Windows format” - when the zip archive is saved. - - - - - An application creating a zip archive can use this flag to explicitly - specify that the file times for the entries should or should not be stored - in the zip archive in the format used by Windows. By default this flag is - true, meaning the Windows-format times are stored in the zip - archive. - - - - When adding an entry from a file or directory, the Creation (), Access (), and Modified () times for the given entry are - automatically set from the filesystem values. When adding an entry from a - stream or string, all three values are implicitly set to - DateTime.Now. Applications can also explicitly set those times by - calling . - - - - PKWARE's - zip specification describes multiple ways to format these times in a - zip file. One is the format Windows applications normally use: 100ns ticks - since January 1, 1601 UTC. The other is a format Unix applications typically - use: seconds since January 1, 1970 UTC. Each format can be stored in an - "extra field" in the zip entry when saving the zip archive. The former - uses an extra field with a Header Id of 0x000A, while the latter uses a - header ID of 0x5455, although you probably don't need to know that. - - - - Not all tools and libraries can interpret these fields. Windows - compressed folders is one that can read the Windows Format timestamps, - while I believe the Infozip - tools can read the Unix format timestamps. Some tools and libraries - may be able to read only one or the other. DotNetZip can read or write - times in either or both formats. - - - - The times stored are taken from , , and . - - - - The value set here applies to all entries subsequently added to the - ZipFile. - - - - This property is not mutually exclusive of the property. It is possible and - legal and valid to produce a zip file that contains timestamps encoded in - the Unix format as well as in the Windows format, in addition to the LastModified time attached to each - entry in the archive, a time that is always stored in "DOS format". And, - notwithstanding the names PKWare uses for these time formats, any of them - can be read and written by any computer, on any operating system. But, - there are no guarantees that a program running on Mac or Linux will - gracefully handle a zip file with "Windows" formatted times, or that an - application that does not use DotNetZip but runs on Windows will be able to - handle file times in Unix format. - - - - When in doubt, test. Sorry, I haven't got a complete list of tools and - which sort of timestamps they can use and will tolerate. If you get any - good information and would like to pass it on, please do so and I will - include that information in this documentation. - - - - - This example shows how to save a zip file that contains file timestamps - in a format normally used by Unix. - - using (var zip = new ZipFile()) - { - // produce a zip file the Mac will like - zip.EmitTimesInWindowsFormatWhenSaving = false; - zip.EmitTimesInUnixFormatWhenSaving = true; - zip.AddDirectory(directoryToZip, "files"); - zip.Save(outputFile); - } - - - - Using zip As New ZipFile - '' produce a zip file the Mac will like - zip.EmitTimesInWindowsFormatWhenSaving = False - zip.EmitTimesInUnixFormatWhenSaving = True - zip.AddDirectory(directoryToZip, "files") - zip.Save(outputFile) - End Using - - - - - - - - - Specifies whether the Creation, Access, and Modified times - for entries added to the zip file will be emitted in "Unix(tm) - format" when the zip archive is saved. - - - - - An application creating a zip archive can use this flag to explicitly - specify that the file times for the entries should or should not be stored - in the zip archive in the format used by Unix. By default this flag is - false, meaning the Unix-format times are not stored in the zip - archive. - - - - When adding an entry from a file or directory, the Creation (), Access (), and Modified () times for the given entry are - automatically set from the filesystem values. When adding an entry from a - stream or string, all three values are implicitly set to DateTime.Now. - Applications can also explicitly set those times by calling . - - - - PKWARE's - zip specification describes multiple ways to format these times in a - zip file. One is the format Windows applications normally use: 100ns ticks - since January 1, 1601 UTC. The other is a format Unix applications - typically use: seconds since January 1, 1970 UTC. Each format can be - stored in an "extra field" in the zip entry when saving the zip - archive. The former uses an extra field with a Header Id of 0x000A, while - the latter uses a header ID of 0x5455, although you probably don't need to - know that. - - - - Not all tools and libraries can interpret these fields. Windows - compressed folders is one that can read the Windows Format timestamps, - while I believe the Infozip - tools can read the Unix format timestamps. Some tools and libraries may be - able to read only one or the other. DotNetZip can read or write times in - either or both formats. - - - - The times stored are taken from , , and . - - - - This property is not mutually exclusive of the property. It is possible and - legal and valid to produce a zip file that contains timestamps encoded in - the Unix format as well as in the Windows format, in addition to the LastModified time attached to each - entry in the zip archive, a time that is always stored in "DOS - format". And, notwithstanding the names PKWare uses for these time - formats, any of them can be read and written by any computer, on any - operating system. But, there are no guarantees that a program running on - Mac or Linux will gracefully handle a zip file with "Windows" formatted - times, or that an application that does not use DotNetZip but runs on - Windows will be able to handle file times in Unix format. - - - - When in doubt, test. Sorry, I haven't got a complete list of tools and - which sort of timestamps they can use and will tolerate. If you get any - good information and would like to pass it on, please do so and I will - include that information in this documentation. - - - - - - - - - Indicates whether verbose output is sent to the during AddXxx() and - ReadXxx() operations. - - - - This is a synthetic property. It returns true if the is non-null. - - - - - Indicates whether to perform case-sensitive matching on the filename when - retrieving entries in the zipfile via the string-based indexer. - - - - The default value is false, which means don't do case-sensitive - matching. In other words, retrieving zip["ReadMe.Txt"] is the same as - zip["readme.txt"]. It really makes sense to set this to true only - if you are not running on Windows, which has case-insensitive - filenames. But since this library is not built for non-Windows platforms, - in most cases you should just leave this property alone. - - - - - Indicates whether to encode entry filenames and entry comments using Unicode - (UTF-8). - - - - - The - PKWare zip specification provides for encoding file names and file - comments in either the IBM437 code page, or in UTF-8. This flag selects - the encoding according to that specification. By default, this flag is - false, and filenames and comments are encoded into the zip file in the - IBM437 codepage. Setting this flag to true will specify that filenames - and comments that cannot be encoded with IBM437 will be encoded with - UTF-8. - - - - Zip files created with strict adherence to the PKWare specification with - respect to UTF-8 encoding can contain entries with filenames containing - any combination of Unicode characters, including the full range of - characters from Chinese, Latin, Hebrew, Greek, Cyrillic, and many other - alphabets. However, because at this time, the UTF-8 portion of the PKWare - specification is not broadly supported by other zip libraries and - utilities, such zip files may not be readable by your favorite zip tool or - archiver. In other words, interoperability will decrease if you set this - flag to true. - - - - In particular, Zip files created with strict adherence to the PKWare - specification with respect to UTF-8 encoding will not work well with - Explorer in Windows XP or Windows Vista, because Windows compressed - folders, as far as I know, do not support UTF-8 in zip files. Vista can - read the zip files, but shows the filenames incorrectly. Unpacking from - Windows Vista Explorer will result in filenames that have rubbish - characters in place of the high-order UTF-8 bytes. - - - - Also, zip files that use UTF-8 encoding will not work well with Java - applications that use the java.util.zip classes, as of v5.0 of the Java - runtime. The Java runtime does not correctly implement the PKWare - specification in this regard. - - - - As a result, we have the unfortunate situation that "correct" behavior by - the DotNetZip library with regard to Unicode encoding of filenames during - zip creation will result in zip files that are readable by strictly - compliant and current tools (for example the most recent release of the - commercial WinZip tool); but these zip files will not be readable by - various other tools or libraries, including Windows Explorer. - - - - The DotNetZip library can read and write zip files with UTF8-encoded - entries, according to the PKware spec. If you use DotNetZip for both - creating and reading the zip file, and you use UTF-8, there will be no - loss of information in the filenames. For example, using a self-extractor - created by this library will allow you to unpack files correctly with no - loss of information in the filenames. - - - - If you do not set this flag, it will remain false. If this flag is false, - your ZipFile will encode all filenames and comments using the - IBM437 codepage. This can cause "loss of information" on some filenames, - but the resulting zipfile will be more interoperable with other - utilities. As an example of the loss of information, diacritics can be - lost. The o-tilde character will be down-coded to plain o. The c with a - cedilla (Unicode 0xE7) used in Portugese will be downcoded to a c. - Likewise, the O-stroke character (Unicode 248), used in Danish and - Norwegian, will be down-coded to plain o. Chinese characters cannot be - represented in codepage IBM437; when using the default encoding, Chinese - characters in filenames will be represented as ?. These are all examples - of "information loss". - - - - The loss of information associated to the use of the IBM437 encoding is - inconvenient, and can also lead to runtime errors. For example, using - IBM437, any sequence of 4 Chinese characters will be encoded as ????. If - your application creates a ZipFile, then adds two files, each with - names of four Chinese characters each, this will result in a duplicate - filename exception. In the case where you add a single file with a name - containing four Chinese characters, calling Extract() on the entry that - has question marks in the filename will result in an exception, because - the question mark is not legal for use within filenames on Windows. These - are just a few examples of the problems associated to loss of information. - - - - This flag is independent of the encoding of the content within the entries - in the zip file. Think of the zip file as a container - it supports an - encoding. Within the container are other "containers" - the file entries - themselves. The encoding within those entries is independent of the - encoding of the zip archive container for those entries. - - - - Rather than specify the encoding in a binary fashion using this flag, an - application can specify an arbitrary encoding via the property. Setting the encoding - explicitly when creating zip archives will result in non-compliant zip - files that, curiously, are fairly interoperable. The challenge is, the - PKWare specification does not provide for a way to specify that an entry - in a zip archive uses a code page that is neither IBM437 nor UTF-8. - Therefore if you set the encoding explicitly when creating a zip archive, - you must take care upon reading the zip archive to use the same code page. - If you get it wrong, the behavior is undefined and may result in incorrect - filenames, exceptions, stomach upset, hair loss, and acne. - - - - - - - Specify whether to use ZIP64 extensions when saving a zip archive. - - - - - - When creating a zip file, the default value for the property is . is - safest, in the sense that you will not get an Exception if a pre-ZIP64 - limit is exceeded. - - - - You may set the property at any time before calling Save(). - - - - When reading a zip file via the Zipfile.Read() method, DotNetZip - will properly read ZIP64-endowed zip archives, regardless of the value of - this property. DotNetZip will always read ZIP64 archives. This property - governs only whether DotNetZip will write them. Therefore, when updating - archives, be careful about setting this property after reading an archive - that may use ZIP64 extensions. - - - - An interesting question is, if you have set this property to - AsNecessary, and then successfully saved, does the resulting - archive use ZIP64 extensions or not? To learn this, check the property, after calling Save(). - - - - Have you thought about - donating? - - - - - - - - Indicates whether the archive requires ZIP64 extensions. - - - - - - This property is null (or Nothing in VB) if the archive has - not been saved, and there are fewer than 65334 ZipEntry items - contained in the archive. - - - - The Value is true if any of the following four conditions holds: - the uncompressed size of any entry is larger than 0xFFFFFFFF; the - compressed size of any entry is larger than 0xFFFFFFFF; the relative - offset of any entry within the zip archive is larger than 0xFFFFFFFF; or - there are more than 65534 entries in the archive. (0xFFFFFFFF = - 4,294,967,295). The result may not be known until a Save() is attempted - on the zip archive. The Value of this - property may be set only AFTER one of the Save() methods has been called. - - - - If none of the four conditions holds, and the archive has been saved, then - the Value is false. - - - - A Value of false does not indicate that the zip archive, as saved, - does not use ZIP64. It merely indicates that ZIP64 is not required. An - archive may use ZIP64 even when not required if the property is set to , or if the property is set to and the output stream was not - seekable. Use the property to determine if - the most recent Save() method resulted in an archive that utilized - the ZIP64 extensions. - - - - - - - - - Indicates whether the most recent Save() operation used ZIP64 extensions. - - - - - The use of ZIP64 extensions within an archive is not always necessary, and - for interoperability concerns, it may be desired to NOT use ZIP64 if - possible. The property can be - set to use ZIP64 extensions only when necessary. In those cases, - Sometimes applications want to know whether a Save() actually used ZIP64 - extensions. Applications can query this read-only property to learn - whether ZIP64 has been used in a just-saved ZipFile. - - - - The value is null (or Nothing in VB) if the archive has not - been saved. - - - - Non-null values (HasValue is true) indicate whether ZIP64 - extensions were used during the most recent Save() operation. The - ZIP64 extensions may have been used as required by any particular entry - because of its uncompressed or compressed size, or because the archive is - larger than 4294967295 bytes, or because there are more than 65534 entries - in the archive, or because the UseZip64WhenSaving property was set - to , or because the - UseZip64WhenSaving property was set to and the output stream was not seekable. - The value of this property does not indicate the reason the ZIP64 - extensions were used. - - - - - - - - - Indicates whether the most recent Read() operation read a zip file that uses - ZIP64 extensions. - - - - This property will return null (Nothing in VB) if you've added an entry after reading - the zip file. - - - - - The text encoding to use when writing new entries to the ZipFile, - for those entries that cannot be encoded with the default (IBM437) - encoding; or, the text encoding that was used when reading the entries - from the ZipFile. - - - - - In its - zip specification, PKWare describes two options for encoding - filenames and comments: using IBM437 or UTF-8. But, some archiving tools - or libraries do not follow the specification, and instead encode - characters using the system default code page. For example, WinRAR when - run on a machine in Shanghai may encode filenames with the Big-5 Chinese - (950) code page. This behavior is contrary to the Zip specification, but - it occurs anyway. - - - - When using DotNetZip to write zip archives that will be read by one of - these other archivers, set this property to specify the code page to use - when encoding the and for each ZipEntry in the zip file, for - values that cannot be encoded with the default codepage for zip files, - IBM437. This is why this property is "provisional". In all cases, IBM437 - is used where possible, in other words, where no loss of data would - result. It is possible, therefore, to have a given entry with a - Comment encoded in IBM437 and a FileName encoded with the - specified "provisional" codepage. - - - - Be aware that a zip file created after you've explicitly set the property to a value other than - IBM437 may not be compliant to the PKWare specification, and may not be - readable by compliant archivers. On the other hand, many (most?) - archivers are non-compliant and can read zip files created in arbitrary - code pages. The trick is to use or specify the proper codepage when - reading the zip. - - - - When creating a zip archive using this library, it is possible to change - the value of between each - entry you add, and between adding entries and the call to - Save(). Don't do this. It will likely result in a zipfile that is - not readable. For best interoperability, either leave alone, or specify it only once, - before adding any entries to the ZipFile instance. There is one - exception to this recommendation, described later. - - - - When using an arbitrary, non-UTF8 code page for encoding, there is no - standard way for the creator application - whether DotNetZip, WinZip, - WinRar, or something else - to formally specify in the zip file which - codepage has been used for the entries. As a result, readers of zip files - are not able to inspect the zip file and determine the codepage that was - used for the entries contained within it. It is left to the application - or user to determine the necessary codepage when reading zip files encoded - this way. In other words, if you explicitly specify the codepage when you - create the zipfile, you must explicitly specify the same codepage when - reading the zipfile. - - - - The way you specify the code page to use when reading a zip file varies - depending on the tool or library you use to read the zip. In DotNetZip, - you use a ZipFile.Read() method that accepts an encoding parameter. It - isn't possible with Windows Explorer, as far as I know, to specify an - explicit codepage to use when reading a zip. If you use an incorrect - codepage when reading a zipfile, you will get entries with filenames that - are incorrect, and the incorrect filenames may even contain characters - that are not legal for use within filenames in Windows. Extracting entries - with illegal characters in the filenames will lead to exceptions. It's too - bad, but this is just the way things are with code pages in zip - files. Caveat Emptor. - - - - Example: Suppose you create a zipfile that contains entries with - filenames that have Danish characters. If you use equal to "iso-8859-1" (cp 28591), - the filenames will be correctly encoded in the zip. But, to read that - zipfile correctly, you have to specify the same codepage at the time you - read it. If try to read that zip file with Windows Explorer or another - application that is not flexible with respect to the codepage used to - decode filenames in zipfiles, you will get a filename like "Inf°.txt". - - - - When using DotNetZip to read a zip archive, and the zip archive uses an - arbitrary code page, you must specify the encoding to use before or when - the Zipfile is READ. This means you must use a ZipFile.Read() - method that allows you to specify a System.Text.Encoding parameter. Setting - the ProvisionalAlternateEncoding property after your application has read in - the zip archive will not affect the entry names of entries that have already - been read in. - - - - And now, the exception to the rule described above. One strategy for - specifying the code page for a given zip file is to describe the code page - in a human-readable form in the Zip comment. For example, the comment may - read "Entries in this archive are encoded in the Big5 code page". For - maximum interoperability, the zip comment in this case should be encoded - in the default, IBM437 code page. In this case, the zip comment is - encoded using a different page than the filenames. To do this, Specify - ProvisionalAlternateEncoding to your desired region-specific code - page, once before adding any entries, and then reset - ProvisionalAlternateEncoding to IBM437 before setting the property and calling Save(). - - - - - This example shows how to read a zip file using the Big-5 Chinese code page - (950), and extract each entry in the zip file. For this code to work as - desired, the Zipfile must have been created using the big5 code page - (CP950). This is typical, for example, when using WinRar on a machine with - CP950 set as the default code page. In that case, the names of entries - within the Zip archive will be stored in that code page, and reading the zip - archive must be done using that code page. If the application did not use - the correct code page in ZipFile.Read(), then names of entries within the - zip archive would not be correctly retrieved. - - using (var zip = ZipFile.Read(zipFileName, System.Text.Encoding.GetEncoding("big5"))) - { - // retrieve and extract an entry using a name encoded with CP950 - zip[MyDesiredEntry].Extract("unpack"); - } - - - - Using zip As ZipFile = ZipFile.Read(ZipToExtract, System.Text.Encoding.GetEncoding("big5")) - ' retrieve and extract an entry using a name encoded with CP950 - zip(MyDesiredEntry).Extract("unpack") - End Using - - - - DefaultEncoding - - - - A Text Encoding to use when encoding the filenames and comments for - all the ZipEntry items, during a ZipFile.Save() operation. - - - - Whether the encoding specified here is used during the save depends - on . - - - - - - A flag that tells if and when this instance should apply - AlternateEncoding to encode the filenames and comments associated to - of ZipEntry objects contained within this instance. - - - - - The default text encoding used in zip archives. It is numeric 437, also - known as IBM437. - - - - - - Gets or sets the TextWriter to which status messages are delivered - for the instance. - - - - If the TextWriter is set to a non-null value, then verbose output is sent - to the TextWriter during Add, Read, Save and - Extract operations. Typically, console applications might use - Console.Out and graphical or headless applications might use a - System.IO.StringWriter. The output of this is suitable for viewing - by humans. - - - - - In this example, a console application instantiates a ZipFile, then - sets the StatusMessageTextWriter to Console.Out. At that - point, all verbose status messages for that ZipFile are sent to the - console. - - - - using (ZipFile zip= ZipFile.Read(FilePath)) - { - zip.StatusMessageTextWriter= System.Console.Out; - // messages are sent to the console during extraction - zip.ExtractAll(); - } - - - - Using zip As ZipFile = ZipFile.Read(FilePath) - zip.StatusMessageTextWriter= System.Console.Out - 'Status Messages will be sent to the console during extraction - zip.ExtractAll() - End Using - - - - In this example, a Windows Forms application instantiates a - ZipFile, then sets the StatusMessageTextWriter to a - StringWriter. At that point, all verbose status messages for that - ZipFile are sent to the StringWriter. - - - - var sw = new System.IO.StringWriter(); - using (ZipFile zip= ZipFile.Read(FilePath)) - { - zip.StatusMessageTextWriter= sw; - zip.ExtractAll(); - } - Console.WriteLine("{0}", sw.ToString()); - - - - Dim sw as New System.IO.StringWriter - Using zip As ZipFile = ZipFile.Read(FilePath) - zip.StatusMessageTextWriter= sw - zip.ExtractAll() - End Using - 'Status Messages are now available in sw - - - - - - - Gets or sets the name for the folder to store the temporary file - this library writes when saving a zip archive. - - - - - This library will create a temporary file when saving a Zip archive to a - file. This file is written when calling one of the Save() methods - that does not save to a stream, or one of the SaveSelfExtractor() - methods. - - - - By default, the library will create the temporary file in the directory - specified for the file itself, via the property or via - the method. - - - - Setting this property allows applications to override this default - behavior, so that the library will create the temporary file in the - specified folder. For example, to have the library create the temporary - file in the current working directory, regardless where the ZipFile - is saved, specfy ".". To revert to the default behavior, set this - property to null (Nothing in VB). - - - - When setting the property to a non-null value, the folder specified must - exist; if it does not an exception is thrown. The application should have - write and delete permissions on the folder. The permissions are not - explicitly checked ahead of time; if the application does not have the - appropriate rights, an exception will be thrown at the time Save() - is called. - - - - There is no temporary file created when reading a zip archive. When - saving to a Stream, there is no temporary file created. For example, if - the application is an ASP.NET application and calls Save() - specifying the Response.OutputStream as the output stream, there is - no temporary file created. - - - - - Thrown when setting the property if the directory does not exist. - - - - - - Sets the password to be used on the ZipFile instance. - - - - - - When writing a zip archive, this password is applied to the entries, not - to the zip archive itself. It applies to any ZipEntry subsequently - added to the ZipFile, using one of the AddFile, - AddDirectory, AddEntry, or AddItem methods, etc. - When reading a zip archive, this property applies to any entry - subsequently extracted from the ZipFile using one of the Extract - methods on the ZipFile class. - - - - When writing a zip archive, keep this in mind: though the password is set - on the ZipFile object, according to the Zip spec, the "directory" of the - archive - in other words the list of entries or files contained in the archive - is - not encrypted with the password, or protected in any way. If you set the - Password property, the password actually applies to individual entries - that are added to the archive, subsequent to the setting of this property. - The list of filenames in the archive that is eventually created will - appear in clear text, but the contents of the individual files are - encrypted. This is how Zip encryption works. - - - - One simple way around this limitation is to simply double-wrap sensitive - filenames: Store the files in a zip file, and then store that zip file - within a second, "outer" zip file. If you apply a password to the outer - zip file, then readers will be able to see that the outer zip file - contains an inner zip file. But readers will not be able to read the - directory or file list of the inner zip file. - - - - If you set the password on the ZipFile, and then add a set of files - to the archive, then each entry is encrypted with that password. You may - also want to change the password between adding different entries. If you - set the password, add an entry, then set the password to null - (Nothing in VB), and add another entry, the first entry is - encrypted and the second is not. If you call AddFile(), then set - the Password property, then call ZipFile.Save, the file - added will not be password-protected, and no warning will be generated. - - - - When setting the Password, you may also want to explicitly set the property, to specify how to encrypt the entries added - to the ZipFile. If you set the Password to a non-null value and do not - set , then PKZip 2.0 ("Weak") encryption is used. - This encryption is relatively weak but is very interoperable. If you set - the password to a null value (Nothing in VB), Encryption is - reset to None. - - - - All of the preceding applies to writing zip archives, in other words when - you use one of the Save methods. To use this property when reading or an - existing ZipFile, do the following: set the Password property on the - ZipFile, then call one of the Extract() overloads on the . In this case, the entry is extracted using the - Password that is specified on the ZipFile instance. If you - have not set the Password property, then the password is - null, and the entry is extracted with no password. - - - - If you set the Password property on the ZipFile, then call - Extract() an entry that has not been encrypted with a password, the - password is not used for that entry, and the ZipEntry is extracted - as normal. In other words, the password is used only if necessary. - - - - The class also has a Password property. It takes precedence - over this property on the ZipFile. Typically, you would use the - per-entry Password when most entries in the zip archive use one password, - and a few entries use a different password. If all entries in the zip - file use the same password, then it is simpler to just set this property - on the ZipFile itself, whether creating a zip archive or extracting - a zip archive. - - - - - - - This example creates a zip file, using password protection for the - entries, and then extracts the entries from the zip file. When creating - the zip file, the Readme.txt file is not protected with a password, but - the other two are password-protected as they are saved. During extraction, - each file is extracted with the appropriate password. - - - // create a file with encryption - using (ZipFile zip = new ZipFile()) - { - zip.AddFile("ReadMe.txt"); - zip.Password= "!Secret1"; - zip.AddFile("MapToTheSite-7440-N49th.png"); - zip.AddFile("2008-Regional-Sales-Report.pdf"); - zip.Save("EncryptedArchive.zip"); - } - - // extract entries that use encryption - using (ZipFile zip = ZipFile.Read("EncryptedArchive.zip")) - { - zip.Password= "!Secret1"; - zip.ExtractAll("extractDir"); - } - - - - - Using zip As New ZipFile - zip.AddFile("ReadMe.txt") - zip.Password = "123456!" - zip.AddFile("MapToTheSite-7440-N49th.png") - zip.Password= "!Secret1"; - zip.AddFile("2008-Regional-Sales-Report.pdf") - zip.Save("EncryptedArchive.zip") - End Using - - - ' extract entries that use encryption - Using (zip as ZipFile = ZipFile.Read("EncryptedArchive.zip")) - zip.Password= "!Secret1" - zip.ExtractAll("extractDir") - End Using - - - - - - ZipFile.Encryption - ZipEntry.Password - - - - The action the library should take when extracting a file that already - exists. - - - - - This property affects the behavior of the Extract methods (one of the - Extract() or ExtractWithPassword() overloads), when - extraction would would overwrite an existing filesystem file. If you do - not set this property, the library throws an exception when extracting an - entry would overwrite an existing file. - - - - This property has no effect when extracting to a stream, or when the file - to be extracted does not already exist. - - - - - - - The action the library should take when an error is encountered while - opening or reading files as they are saved into a zip archive. - - - - - Errors can occur as a file is being saved to the zip archive. For - example, the File.Open may fail, or a File.Read may fail, because of - lock conflicts or other reasons. - - - - The first problem might occur after having called AddDirectory() on a - directory that contains a Clipper .dbf file; the file is locked by - Clipper and cannot be opened for read by another process. An example of - the second problem might occur when trying to zip a .pst file that is in - use by Microsoft Outlook. Outlook locks a range on the file, which allows - other processes to open the file, but not read it in its entirety. - - - - This property tells DotNetZip what you would like to do in the case of - these errors. The primary options are: ZipErrorAction.Throw to - throw an exception (this is the default behavior if you don't set this - property); ZipErrorAction.Skip to Skip the file for which there - was an error and continue saving; ZipErrorAction.Retry to Retry - the entry that caused the problem; or - ZipErrorAction.InvokeErrorEvent to invoke an event handler. - - - - This property is implicitly set to ZipErrorAction.InvokeErrorEvent - if you add a handler to the event. If you set - this property to something other than - ZipErrorAction.InvokeErrorEvent, then the ZipError - event is implicitly cleared. What it means is you can set one or the - other (or neither), depending on what you want, but you never need to set - both. - - - - As with some other properties on the ZipFile class, like , , and , setting this property on a ZipFile - instance will cause the specified ZipErrorAction to be used on all - items that are subsequently added to the - ZipFile instance. If you set this property after you have added - items to the ZipFile, but before you have called Save(), - those items will not use the specified error handling action. - - - - If you want to handle any errors that occur with any entry in the zip - file in the same way, then set this property once, before adding any - entries to the zip archive. - - - - If you set this property to ZipErrorAction.Skip and you'd like to - learn which files may have been skipped after a Save(), you can - set the on the ZipFile before - calling Save(). A message will be emitted into that writer for - each skipped file, if any. - - - - - - This example shows how to tell DotNetZip to skip any files for which an - error is generated during the Save(). - - Public Sub SaveZipFile() - Dim SourceFolder As String = "fodder" - Dim DestFile As String = "eHandler.zip" - Dim sw as New StringWriter - Using zipArchive As ZipFile = New ZipFile - ' Tell DotNetZip to skip any files for which it encounters an error - zipArchive.ZipErrorAction = ZipErrorAction.Skip - zipArchive.StatusMessageTextWriter = sw - zipArchive.AddDirectory(SourceFolder) - zipArchive.Save(DestFile) - End Using - ' examine sw here to see any messages - End Sub - - - - - - - - - - The Encryption to use for entries added to the ZipFile. - - - - - Set this when creating a zip archive, or when updating a zip archive. The - specified Encryption is applied to the entries subsequently added to the - ZipFile instance. Applications do not need to set the - Encryption property when reading or extracting a zip archive. - - - - If you set this to something other than EncryptionAlgorithm.None, you - will also need to set the . - - - - As with some other properties on the ZipFile class, like and , setting this - property on a ZipFile instance will cause the specified - EncryptionAlgorithm to be used on all items - that are subsequently added to the ZipFile instance. In other - words, if you set this property after you have added items to the - ZipFile, but before you have called Save(), those items will - not be encrypted or protected with a password in the resulting zip - archive. To get a zip archive with encrypted entries, set this property, - along with the property, before calling - AddFile, AddItem, or AddDirectory (etc.) on the - ZipFile instance. - - - - If you read a ZipFile, you can modify the Encryption on an - encrypted entry, only by setting the Encryption property on the - ZipEntry itself. Setting the Encryption property on the - ZipFile, once it has been created via a call to - ZipFile.Read(), does not affect entries that were previously read. - - - - For example, suppose you read a ZipFile, and there is an encrypted - entry. Setting the Encryption property on that ZipFile and - then calling Save() on the ZipFile does not update the - Encryption used for the entries in the archive. Neither is an - exception thrown. Instead, what happens during the Save() is that - all previously existing entries are copied through to the new zip archive, - with whatever encryption and password that was used when originally - creating the zip archive. Upon re-reading that archive, to extract - entries, applications should use the original password or passwords, if - any. - - - - Suppose an application reads a ZipFile, and there is an encrypted - entry. Setting the Encryption property on that ZipFile and - then adding new entries (via AddFile(), AddEntry(), etc) - and then calling Save() on the ZipFile does not update the - Encryption on any of the entries that had previously been in the - ZipFile. The Encryption property applies only to the - newly-added entries. - - - - - - - This example creates a zip archive that uses encryption, and then extracts - entries from the archive. When creating the zip archive, the ReadMe.txt - file is zipped without using a password or encryption. The other files - use encryption. - - - - // Create a zip archive with AES Encryption. - using (ZipFile zip = new ZipFile()) - { - zip.AddFile("ReadMe.txt"); - zip.Encryption= EncryptionAlgorithm.WinZipAes256; - zip.Password= "Top.Secret.No.Peeking!"; - zip.AddFile("7440-N49th.png"); - zip.AddFile("2008-Regional-Sales-Report.pdf"); - zip.Save("EncryptedArchive.zip"); - } - - // Extract a zip archive that uses AES Encryption. - // You do not need to specify the algorithm during extraction. - using (ZipFile zip = ZipFile.Read("EncryptedArchive.zip")) - { - zip.Password= "Top.Secret.No.Peeking!"; - zip.ExtractAll("extractDirectory"); - } - - - - ' Create a zip that uses Encryption. - Using zip As New ZipFile() - zip.Encryption= EncryptionAlgorithm.WinZipAes256 - zip.Password= "Top.Secret.No.Peeking!" - zip.AddFile("ReadMe.txt") - zip.AddFile("7440-N49th.png") - zip.AddFile("2008-Regional-Sales-Report.pdf") - zip.Save("EncryptedArchive.zip") - End Using - - ' Extract a zip archive that uses AES Encryption. - ' You do not need to specify the algorithm during extraction. - Using (zip as ZipFile = ZipFile.Read("EncryptedArchive.zip")) - zip.Password= "Top.Secret.No.Peeking!" - zip.ExtractAll("extractDirectory") - End Using - - - - - ZipFile.Password - ZipEntry.Encryption - - - - A callback that allows the application to specify the compression level - to use for entries subsequently added to the zip archive. - - - - - - With this callback, the DotNetZip library allows the application to - determine whether compression will be used, at the time of the - Save. This may be useful if the application wants to favor - speed over size, and wants to defer the decision until the time of - Save. - - - - Typically applications set the property on - the ZipFile or on each ZipEntry to determine the level of - compression used. This is done at the time the entry is added to the - ZipFile. Setting the property to - Ionic.Zlib.CompressionLevel.None means no compression will be used. - - - - This callback allows the application to defer the decision on the - CompressionLevel to use, until the time of the call to - ZipFile.Save(). The callback is invoked once per ZipEntry, - at the time the data for the entry is being written out as part of a - Save() operation. The application can use whatever criteria it - likes in determining the level to return. For example, an application may - wish that no .mp3 files should be compressed, because they are already - compressed and the extra compression is not worth the CPU time incurred, - and so can return None for all .mp3 entries. - - - - The library determines whether compression will be attempted for an entry - this way: If the entry is a zero length file, or a directory, no - compression is used. Otherwise, if this callback is set, it is invoked - and the CompressionLevel is set to the return value. If this - callback has not been set, then the previously set value for - CompressionLevel is used. - - - - - - - The maximum size of an output segment, when saving a split Zip file. - - - - Set this to a non-zero value before calling or to specify that the ZipFile should be saved as a - split archive, also sometimes called a spanned archive. Some also - call them multi-file archives. - - - - A split zip archive is saved in a set of discrete filesystem files, - rather than in a single file. This is handy when transmitting the - archive in email or some other mechanism that has a limit to the size of - each file. The first file in a split archive will be named - basename.z01, the second will be named basename.z02, and - so on. The final file is named basename.zip. According to the zip - specification from PKWare, the minimum value is 65536, for a 64k segment - size. The maximum number of segments allows in a split archive is 99. - - - - The value of this property determines the maximum size of a split - segment when writing a split archive. For example, suppose you have a - ZipFile that would save to a single file of 200k. If you set the - MaxOutputSegmentSize to 65536 before calling Save(), you - will get four distinct output files. On the other hand if you set this - property to 256k, then you will get a single-file archive for that - ZipFile. - - - - The size of each split output file will be as large as possible, up to - the maximum size set here. The zip specification requires that some data - fields in a zip archive may not span a split boundary, and an output - segment may be smaller than the maximum if necessary to avoid that - problem. Also, obviously the final segment of the archive may be smaller - than the maximum segment size. Segments will never be larger than the - value set with this property. - - - - You can save a split Zip file only when saving to a regular filesystem - file. It's not possible to save a split zip file as a self-extracting - archive, nor is it possible to save a split zip file to a stream. When - saving to a SFX or to a Stream, this property is ignored. - - - - About interoperability: Split or spanned zip files produced by DotNetZip - can be read by WinZip or PKZip, and vice-versa. Segmented zip files may - not be readable by other tools, if those other tools don't support zip - spanning or splitting. When in doubt, test. I don't believe Windows - Explorer can extract a split archive. - - - - This property has no effect when reading a split archive. You can read - a split archive in the normal way with DotNetZip. - - - - When saving a zip file, if you want a regular zip file rather than a - split zip file, don't set this property, or set it to Zero. - - - - If you read a split archive, with and - then subsequently call ZipFile.Save(), unless you set this - property before calling Save(), you will get a normal, - single-file archive. - - - - - - - - Returns the number of segments used in the most recent Save() operation. - - - - This is normally zero, unless you have set the property. If you have set , and then you save a file, after the call to - Save() completes, you can read this value to learn the number of segments that - were created. - - - If you call Save("Archive.zip"), and it creates 5 segments, then you - will have filesystem files named Archive.z01, Archive.z02, Archive.z03, - Archive.z04, and Archive.zip, and the value of this property will be 5. - - - - - - - The size threshold for an entry, above which a parallel deflate is used. - - - - - - DotNetZip will use multiple threads to compress any ZipEntry, - if the entry is larger than the given size. Zero means "always - use parallel deflate", while -1 means "never use parallel - deflate". The default value for this property is 512k. Aside - from the special values of 0 and 1, the minimum value is 65536. - - - - If the entry size cannot be known before compression, as with a - read-forward stream, then Parallel deflate will never be - performed, unless the value of this property is zero. - - - - A parallel deflate operations will speed up the compression of - large files, on computers with multiple CPUs or multiple CPU - cores. For files above 1mb, on a dual core or dual-cpu (2p) - machine, the time required to compress the file can be 70% of the - single-threaded deflate. For very large files on 4p machines the - compression can be done in 30% of the normal time. The downside - is that parallel deflate consumes extra memory during the deflate, - and the deflation is not as effective. - - - - Parallel deflate tends to yield slightly less compression when - compared to as single-threaded deflate; this is because the original - data stream is split into multiple independent buffers, each of which - is compressed in parallel. But because they are treated - independently, there is no opportunity to share compression - dictionaries. For that reason, a deflated stream may be slightly - larger when compressed using parallel deflate, as compared to a - traditional single-threaded deflate. Sometimes the increase over the - normal deflate is as much as 5% of the total compressed size. For - larger files it can be as small as 0.1%. - - - - Multi-threaded compression does not give as much an advantage when - using Encryption. This is primarily because encryption tends to slow - down the entire pipeline. Also, multi-threaded compression gives less - of an advantage when using lower compression levels, for example . You may have to - perform some tests to determine the best approach for your situation. - - - - - - - - - - The maximum number of buffer pairs to use when performing - parallel compression. - - - - - This property sets an upper limit on the number of memory - buffer pairs to create when performing parallel - compression. The implementation of the parallel - compression stream allocates multiple buffers to - facilitate parallel compression. As each buffer fills up, - the stream uses - ThreadPool.QueueUserWorkItem() to compress those - buffers in a background threadpool thread. After a buffer - is compressed, it is re-ordered and written to the output - stream. - - - - A higher number of buffer pairs enables a higher degree of - parallelism, which tends to increase the speed of compression on - multi-cpu computers. On the other hand, a higher number of buffer - pairs also implies a larger memory consumption, more active worker - threads, and a higher cpu utilization for any compression. This - property enables the application to limit its memory consumption and - CPU utilization behavior depending on requirements. - - - - For each compression "task" that occurs in parallel, there are 2 - buffers allocated: one for input and one for output. This property - sets a limit for the number of pairs. The total amount of storage - space allocated for buffering will then be (N*S*2), where N is the - number of buffer pairs, S is the size of each buffer (). By default, DotNetZip allocates 4 buffer - pairs per CPU core, so if your machine has 4 cores, and you retain - the default buffer size of 128k, then the - ParallelDeflateOutputStream will use 4 * 4 * 2 * 128kb of buffer - memory in total, or 4mb, in blocks of 128kb. If you then set this - property to 8, then the number will be 8 * 2 * 128kb of buffer - memory, or 2mb. - - - - CPU utilization will also go up with additional buffers, because a - larger number of buffer pairs allows a larger number of background - threads to compress in parallel. If you find that parallel - compression is consuming too much memory or CPU, you can adjust this - value downward. - - - - The default value is 16. Different values may deliver better or - worse results, depending on your priorities and the dynamic - performance characteristics of your storage and compute resources. - - - - This property is not the number of buffer pairs to use; it is an - upper limit. An illustration: Suppose you have an application that - uses the default value of this property (which is 16), and it runs - on a machine with 2 CPU cores. In that case, DotNetZip will allocate - 4 buffer pairs per CPU core, for a total of 8 pairs. The upper - limit specified by this property has no effect. - - - - The application can set this value at any time - before calling ZipFile.Save(). - - - - - - - - - Returns the version number on the DotNetZip assembly. - - - - - This property is exposed as a convenience. Callers could also get the - version value by retrieving GetName().Version on the - System.Reflection.Assembly object pointing to the DotNetZip - assembly. But sometimes it is not clear which assembly is being loaded. - This property makes it clear. - - - This static property is primarily useful for diagnostic purposes. - - - - - - This is an integer indexer into the Zip archive. - - - - - This property is read-only. - - - - Internally, the ZipEntry instances that belong to the - ZipFile are stored in a Dictionary. When you use this - indexer the first time, it creates a read-only - List<ZipEntry> from the Dictionary.Values Collection. - If at any time you modify the set of entries in the ZipFile, - either by adding an entry, removing an entry, or renaming an - entry, a new List will be created, and the numeric indexes for the - remaining entries may be different. - - - - This means you cannot rename any ZipEntry from - inside an enumeration of the zip file. - - - - The index value. - - - - - - The ZipEntry within the Zip archive at the specified index. If the - entry does not exist in the archive, this indexer throws. - - - - - - This is a name-based indexer into the Zip archive. - - - - - This property is read-only. - - - - The property on the ZipFile - determines whether retrieval via this indexer is done via case-sensitive - comparisons. By default, retrieval is not case sensitive. This makes - sense on Windows, in which filesystems are not case sensitive. - - - - Regardless of case-sensitivity, it is not always the case that - this[value].FileName == value. In other words, the FileName - property of the ZipEntry retrieved with this indexer, may or may - not be equal to the index value. - - - - This is because DotNetZip performs a normalization of filenames passed to - this indexer, before attempting to retrieve the item. That normalization - includes: removal of a volume letter and colon, swapping backward slashes - for forward slashes. So, zip["dir1\\entry1.txt"].FileName == - "dir1/entry.txt". - - - - Directory entries in the zip file may be retrieved via this indexer only - with names that have a trailing slash. DotNetZip automatically appends a - trailing slash to the names of any directory entries added to a zip. - - - - - - This example extracts only the entries in a zip file that are .txt files. - - using (ZipFile zip = ZipFile.Read("PackedDocuments.zip")) - { - foreach (string s1 in zip.EntryFilenames) - { - if (s1.EndsWith(".txt")) - zip[s1].Extract("textfiles"); - } - } - - - Using zip As ZipFile = ZipFile.Read("PackedDocuments.zip") - Dim s1 As String - For Each s1 In zip.EntryFilenames - If s1.EndsWith(".txt") Then - zip(s1).Extract("textfiles") - End If - Next - End Using - - - - - - Thrown if the caller attempts to assign a non-null value to the indexer. - - - - The name of the file, including any directory path, to retrieve from the - zip. The filename match is not case-sensitive by default; you can use the - property to change this behavior. The - pathname can use forward-slashes or backward slashes. - - - - The ZipEntry within the Zip archive, given by the specified - filename. If the named entry does not exist in the archive, this indexer - returns null (Nothing in VB). - - - - - - The list of filenames for the entries contained within the zip archive. - - - - According to the ZIP specification, the names of the entries use forward - slashes in pathnames. If you are scanning through the list, you may have - to swap forward slashes for backslashes. - - - - - - This example shows one way to test if a filename is already contained - within a zip archive. - - String zipFileToRead= "PackedDocuments.zip"; - string candidate = "DatedMaterial.xps"; - using (ZipFile zip = new ZipFile(zipFileToRead)) - { - if (zip.EntryFilenames.Contains(candidate)) - Console.WriteLine("The file '{0}' exists in the zip archive '{1}'", - candidate, - zipFileName); - else - Console.WriteLine("The file, '{0}', does not exist in the zip archive '{1}'", - candidate, - zipFileName); - Console.WriteLine(); - } - - - Dim zipFileToRead As String = "PackedDocuments.zip" - Dim candidate As String = "DatedMaterial.xps" - Using zip As ZipFile.Read(ZipFileToRead) - If zip.EntryFilenames.Contains(candidate) Then - Console.WriteLine("The file '{0}' exists in the zip archive '{1}'", _ - candidate, _ - zipFileName) - Else - Console.WriteLine("The file, '{0}', does not exist in the zip archive '{1}'", _ - candidate, _ - zipFileName) - End If - Console.WriteLine - End Using - - - - - The list of strings for the filenames contained within the Zip archive. - - - - - - Returns the readonly collection of entries in the Zip archive. - - - - - - If there are no entries in the current ZipFile, the value returned is a - non-null zero-element collection. If there are entries in the zip file, - the elements are returned in no particular order. - - - This is the implied enumerator on the ZipFile class. If you use a - ZipFile instance in a context that expects an enumerator, you will - get this collection. - - - - - - - Returns a readonly collection of entries in the Zip archive, sorted by FileName. - - - - If there are no entries in the current ZipFile, the value returned - is a non-null zero-element collection. If there are entries in the zip - file, the elements are returned sorted by the name of the entry. - - - - - This example fills a Windows Forms ListView with the entries in a zip file. - - - using (ZipFile zip = ZipFile.Read(zipFile)) - { - foreach (ZipEntry entry in zip.EntriesSorted) - { - ListViewItem item = new ListViewItem(n.ToString()); - n++; - string[] subitems = new string[] { - entry.FileName.Replace("/","\\"), - entry.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), - entry.UncompressedSize.ToString(), - String.Format("{0,5:F0}%", entry.CompressionRatio), - entry.CompressedSize.ToString(), - (entry.UsesEncryption) ? "Y" : "N", - String.Format("{0:X8}", entry.Crc)}; - - foreach (String s in subitems) - { - ListViewItem.ListViewSubItem subitem = new ListViewItem.ListViewSubItem(); - subitem.Text = s; - item.SubItems.Add(subitem); - } - - this.listView1.Items.Add(item); - } - } - - - - - - - - Returns the number of entries in the Zip archive. - - - - - An event handler invoked when a Save() starts, before and after each - entry has been written to the archive, when a Save() completes, and - during other Save events. - - - - - Depending on the particular event, different properties on the parameter are set. The following - table summarizes the available EventTypes and the conditions under - which this event handler is invoked with a - SaveProgressEventArgs with the given EventType. - - - - - value of EntryType - Meaning and conditions - - - - ZipProgressEventType.Saving_Started - Fired when ZipFile.Save() begins. - - - - - ZipProgressEventType.Saving_BeforeSaveEntry - - Fired within ZipFile.Save(), just before writing data for each - particular entry. - - - - - ZipProgressEventType.Saving_AfterSaveEntry - - Fired within ZipFile.Save(), just after having finished writing data - for each particular entry. - - - - - ZipProgressEventType.Saving_Completed - Fired when ZipFile.Save() has completed. - - - - - ZipProgressEventType.Saving_AfterSaveTempArchive - - Fired after the temporary file has been created. This happens only - when saving to a disk file. This event will not be invoked when - saving to a stream. - - - - - ZipProgressEventType.Saving_BeforeRenameTempArchive - - Fired just before renaming the temporary file to the permanent - location. This happens only when saving to a disk file. This event - will not be invoked when saving to a stream. - - - - - ZipProgressEventType.Saving_AfterRenameTempArchive - - Fired just after renaming the temporary file to the permanent - location. This happens only when saving to a disk file. This event - will not be invoked when saving to a stream. - - - - - ZipProgressEventType.Saving_AfterCompileSelfExtractor - - Fired after a self-extracting archive has finished compiling. This - EventType is used only within SaveSelfExtractor(). - - - - - ZipProgressEventType.Saving_BytesRead - - Set during the save of a particular entry, to update progress of the - Save(). When this EventType is set, the BytesTransferred is the - number of bytes that have been read from the source stream. The - TotalBytesToTransfer is the number of bytes in the uncompressed - file. - - - - - - - - - This example uses an anonymous method to handle the - SaveProgress event, by updating a progress bar. - - - progressBar1.Value = 0; - progressBar1.Max = listbox1.Items.Count; - using (ZipFile zip = new ZipFile()) - { - // listbox1 contains a list of filenames - zip.AddFiles(listbox1.Items); - - // do the progress bar: - zip.SaveProgress += (sender, e) => { - if (e.EventType == ZipProgressEventType.Saving_BeforeWriteEntry) { - progressBar1.PerformStep(); - } - }; - - zip.Save(fs); - } - - - - - This example uses a named method as the - SaveProgress event handler, to update the user, in a - console-based application. - - - static bool justHadByteUpdate= false; - public static void SaveProgress(object sender, SaveProgressEventArgs e) - { - if (e.EventType == ZipProgressEventType.Saving_Started) - Console.WriteLine("Saving: {0}", e.ArchiveName); - - else if (e.EventType == ZipProgressEventType.Saving_Completed) - { - justHadByteUpdate= false; - Console.WriteLine(); - Console.WriteLine("Done: {0}", e.ArchiveName); - } - - else if (e.EventType == ZipProgressEventType.Saving_BeforeWriteEntry) - { - if (justHadByteUpdate) - Console.WriteLine(); - Console.WriteLine(" Writing: {0} ({1}/{2})", - e.CurrentEntry.FileName, e.EntriesSaved, e.EntriesTotal); - justHadByteUpdate= false; - } - - else if (e.EventType == ZipProgressEventType.Saving_EntryBytesRead) - { - if (justHadByteUpdate) - Console.SetCursorPosition(0, Console.CursorTop); - Console.Write(" {0}/{1} ({2:N0}%)", e.BytesTransferred, e.TotalBytesToTransfer, - e.BytesTransferred / (0.01 * e.TotalBytesToTransfer )); - justHadByteUpdate= true; - } - } - - public static ZipUp(string targetZip, string directory) - { - using (var zip = new ZipFile()) { - zip.SaveProgress += SaveProgress; - zip.AddDirectory(directory); - zip.Save(targetZip); - } - } - - - - - Public Sub ZipUp(ByVal targetZip As String, ByVal directory As String) - Using zip As ZipFile = New ZipFile - AddHandler zip.SaveProgress, AddressOf MySaveProgress - zip.AddDirectory(directory) - zip.Save(targetZip) - End Using - End Sub - - Private Shared justHadByteUpdate As Boolean = False - - Public Shared Sub MySaveProgress(ByVal sender As Object, ByVal e As SaveProgressEventArgs) - If (e.EventType Is ZipProgressEventType.Saving_Started) Then - Console.WriteLine("Saving: {0}", e.ArchiveName) - - ElseIf (e.EventType Is ZipProgressEventType.Saving_Completed) Then - justHadByteUpdate = False - Console.WriteLine - Console.WriteLine("Done: {0}", e.ArchiveName) - - ElseIf (e.EventType Is ZipProgressEventType.Saving_BeforeWriteEntry) Then - If justHadByteUpdate Then - Console.WriteLine - End If - Console.WriteLine(" Writing: {0} ({1}/{2})", e.CurrentEntry.FileName, e.EntriesSaved, e.EntriesTotal) - justHadByteUpdate = False - - ElseIf (e.EventType Is ZipProgressEventType.Saving_EntryBytesRead) Then - If justHadByteUpdate Then - Console.SetCursorPosition(0, Console.CursorTop) - End If - Console.Write(" {0}/{1} ({2:N0}%)", e.BytesTransferred, _ - e.TotalBytesToTransfer, _ - (CDbl(e.BytesTransferred) / (0.01 * e.TotalBytesToTransfer))) - justHadByteUpdate = True - End If - End Sub - - - - - - This is a more complete example of using the SaveProgress - events in a Windows Forms application, with a - Thread object. - - - delegate void SaveEntryProgress(SaveProgressEventArgs e); - delegate void ButtonClick(object sender, EventArgs e); - - public class WorkerOptions - { - public string ZipName; - public string Folder; - public string Encoding; - public string Comment; - public int ZipFlavor; - public Zip64Option Zip64; - } - - private int _progress2MaxFactor; - private bool _saveCanceled; - private long _totalBytesBeforeCompress; - private long _totalBytesAfterCompress; - private Thread _workerThread; - - - private void btnZipup_Click(object sender, EventArgs e) - { - KickoffZipup(); - } - - private void btnCancel_Click(object sender, EventArgs e) - { - if (this.lblStatus.InvokeRequired) - { - this.lblStatus.Invoke(new ButtonClick(this.btnCancel_Click), new object[] { sender, e }); - } - else - { - _saveCanceled = true; - lblStatus.Text = "Canceled..."; - ResetState(); - } - } - - private void KickoffZipup() - { - _folderName = tbDirName.Text; - - if (_folderName == null || _folderName == "") return; - if (this.tbZipName.Text == null || this.tbZipName.Text == "") return; - - // check for existence of the zip file: - if (System.IO.File.Exists(this.tbZipName.Text)) - { - var dlgResult = MessageBox.Show(String.Format("The file you have specified ({0}) already exists." + - " Do you want to overwrite this file?", this.tbZipName.Text), - "Confirmation is Required", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (dlgResult != DialogResult.Yes) return; - System.IO.File.Delete(this.tbZipName.Text); - } - - _saveCanceled = false; - _nFilesCompleted = 0; - _totalBytesAfterCompress = 0; - _totalBytesBeforeCompress = 0; - this.btnOk.Enabled = false; - this.btnOk.Text = "Zipping..."; - this.btnCancel.Enabled = true; - lblStatus.Text = "Zipping..."; - - var options = new WorkerOptions - { - ZipName = this.tbZipName.Text, - Folder = _folderName, - Encoding = "ibm437" - }; - - if (this.comboBox1.SelectedIndex != 0) - { - options.Encoding = this.comboBox1.SelectedItem.ToString(); - } - - if (this.radioFlavorSfxCmd.Checked) - options.ZipFlavor = 2; - else if (this.radioFlavorSfxGui.Checked) - options.ZipFlavor = 1; - else options.ZipFlavor = 0; - - if (this.radioZip64AsNecessary.Checked) - options.Zip64 = Zip64Option.AsNecessary; - else if (this.radioZip64Always.Checked) - options.Zip64 = Zip64Option.Always; - else options.Zip64 = Zip64Option.Never; - - options.Comment = String.Format("Encoding:{0} || Flavor:{1} || ZIP64:{2}\r\nCreated at {3} || {4}\r\n", - options.Encoding, - FlavorToString(options.ZipFlavor), - options.Zip64.ToString(), - System.DateTime.Now.ToString("yyyy-MMM-dd HH:mm:ss"), - this.Text); - - if (this.tbComment.Text != TB_COMMENT_NOTE) - options.Comment += this.tbComment.Text; - - _workerThread = new Thread(this.DoSave); - _workerThread.Name = "Zip Saver thread"; - _workerThread.Start(options); - this.Cursor = Cursors.WaitCursor; - } - - - private void DoSave(Object p) - { - WorkerOptions options = p as WorkerOptions; - try - { - using (var zip1 = new ZipFile()) - { - zip1.ProvisionalAlternateEncoding = System.Text.Encoding.GetEncoding(options.Encoding); - zip1.Comment = options.Comment; - zip1.AddDirectory(options.Folder); - _entriesToZip = zip1.EntryFileNames.Count; - SetProgressBars(); - zip1.SaveProgress += this.zip1_SaveProgress; - - zip1.UseZip64WhenSaving = options.Zip64; - - if (options.ZipFlavor == 1) - zip1.SaveSelfExtractor(options.ZipName, SelfExtractorFlavor.WinFormsApplication); - else if (options.ZipFlavor == 2) - zip1.SaveSelfExtractor(options.ZipName, SelfExtractorFlavor.ConsoleApplication); - else - zip1.Save(options.ZipName); - } - } - catch (System.Exception exc1) - { - MessageBox.Show(String.Format("Exception while zipping: {0}", exc1.Message)); - btnCancel_Click(null, null); - } - } - - - - void zip1_SaveProgress(object sender, SaveProgressEventArgs e) - { - switch (e.EventType) - { - case ZipProgressEventType.Saving_AfterWriteEntry: - StepArchiveProgress(e); - break; - case ZipProgressEventType.Saving_EntryBytesRead: - StepEntryProgress(e); - break; - case ZipProgressEventType.Saving_Completed: - SaveCompleted(); - break; - case ZipProgressEventType.Saving_AfterSaveTempArchive: - // this event only occurs when saving an SFX file - TempArchiveSaved(); - break; - } - if (_saveCanceled) - e.Cancel = true; - } - - - - private void StepArchiveProgress(SaveProgressEventArgs e) - { - if (this.progressBar1.InvokeRequired) - { - this.progressBar1.Invoke(new SaveEntryProgress(this.StepArchiveProgress), new object[] { e }); - } - else - { - if (!_saveCanceled) - { - _nFilesCompleted++; - this.progressBar1.PerformStep(); - _totalBytesAfterCompress += e.CurrentEntry.CompressedSize; - _totalBytesBeforeCompress += e.CurrentEntry.UncompressedSize; - - // reset the progress bar for the entry: - this.progressBar2.Value = this.progressBar2.Maximum = 1; - - this.Update(); - } - } - } - - - private void StepEntryProgress(SaveProgressEventArgs e) - { - if (this.progressBar2.InvokeRequired) - { - this.progressBar2.Invoke(new SaveEntryProgress(this.StepEntryProgress), new object[] { e }); - } - else - { - if (!_saveCanceled) - { - if (this.progressBar2.Maximum == 1) - { - // reset - Int64 max = e.TotalBytesToTransfer; - _progress2MaxFactor = 0; - while (max > System.Int32.MaxValue) - { - max /= 2; - _progress2MaxFactor++; - } - this.progressBar2.Maximum = (int)max; - lblStatus.Text = String.Format("{0} of {1} files...({2})", - _nFilesCompleted + 1, _entriesToZip, e.CurrentEntry.FileName); - } - - int xferred = e.BytesTransferred >> _progress2MaxFactor; - - this.progressBar2.Value = (xferred >= this.progressBar2.Maximum) - ? this.progressBar2.Maximum - : xferred; - - this.Update(); - } - } - } - - private void SaveCompleted() - { - if (this.lblStatus.InvokeRequired) - { - this.lblStatus.Invoke(new MethodInvoker(this.SaveCompleted)); - } - else - { - lblStatus.Text = String.Format("Done, Compressed {0} files, {1:N0}% of original.", - _nFilesCompleted, (100.00 * _totalBytesAfterCompress) / _totalBytesBeforeCompress); - ResetState(); - } - } - - private void ResetState() - { - this.btnCancel.Enabled = false; - this.btnOk.Enabled = true; - this.btnOk.Text = "Zip it!"; - this.progressBar1.Value = 0; - this.progressBar2.Value = 0; - this.Cursor = Cursors.Default; - if (!_workerThread.IsAlive) - _workerThread.Join(); - } - - - - - - - - - - - An event handler invoked before, during, and after the reading of a zip archive. - - - - - Depending on the particular event being signaled, different properties on the - parameter are set. The following table - summarizes the available EventTypes and the conditions under which this - event handler is invoked with a ReadProgressEventArgs with the given EventType. - - - - - value of EntryType - Meaning and conditions - - - - ZipProgressEventType.Reading_Started - Fired just as ZipFile.Read() begins. Meaningful properties: ArchiveName. - - - - - ZipProgressEventType.Reading_Completed - Fired when ZipFile.Read() has completed. Meaningful properties: ArchiveName. - - - - - ZipProgressEventType.Reading_ArchiveBytesRead - Fired while reading, updates the number of bytes read for the entire archive. - Meaningful properties: ArchiveName, CurrentEntry, BytesTransferred, TotalBytesToTransfer. - - - - - ZipProgressEventType.Reading_BeforeReadEntry - Indicates an entry is about to be read from the archive. - Meaningful properties: ArchiveName, EntriesTotal. - - - - - ZipProgressEventType.Reading_AfterReadEntry - Indicates an entry has just been read from the archive. - Meaningful properties: ArchiveName, EntriesTotal, CurrentEntry. - - - - - - - - - - - - - An event handler invoked before, during, and after extraction of - entries in the zip archive. - - - - - Depending on the particular event, different properties on the parameter are set. The following - table summarizes the available EventTypes and the conditions under - which this event handler is invoked with a - ExtractProgressEventArgs with the given EventType. - - - - - value of EntryType - Meaning and conditions - - - - ZipProgressEventType.Extracting_BeforeExtractAll - - Set when ExtractAll() begins. The ArchiveName, Overwrite, and - ExtractLocation properties are meaningful. - - - - ZipProgressEventType.Extracting_AfterExtractAll - - Set when ExtractAll() has completed. The ArchiveName, Overwrite, - and ExtractLocation properties are meaningful. - - - - - ZipProgressEventType.Extracting_BeforeExtractEntry - - Set when an Extract() on an entry in the ZipFile has begun. - Properties that are meaningful: ArchiveName, EntriesTotal, - CurrentEntry, Overwrite, ExtractLocation, EntriesExtracted. - - - - - ZipProgressEventType.Extracting_AfterExtractEntry - - Set when an Extract() on an entry in the ZipFile has completed. - Properties that are meaningful: ArchiveName, EntriesTotal, - CurrentEntry, Overwrite, ExtractLocation, EntriesExtracted. - - - - - ZipProgressEventType.Extracting_EntryBytesWritten - - Set within a call to Extract() on an entry in the ZipFile, as data - is extracted for the entry. Properties that are meaningful: - ArchiveName, CurrentEntry, BytesTransferred, TotalBytesToTransfer. - - - - - ZipProgressEventType.Extracting_ExtractEntryWouldOverwrite - - Set within a call to Extract() on an entry in the ZipFile, when the - extraction would overwrite an existing file. This event type is used - only when ExtractExistingFileAction on the ZipFile or - ZipEntry is set to InvokeExtractProgressEvent. - - - - - - - - - - private static bool justHadByteUpdate = false; - public static void ExtractProgress(object sender, ExtractProgressEventArgs e) - { - if(e.EventType == ZipProgressEventType.Extracting_EntryBytesWritten) - { - if (justHadByteUpdate) - Console.SetCursorPosition(0, Console.CursorTop); - - Console.Write(" {0}/{1} ({2:N0}%)", e.BytesTransferred, e.TotalBytesToTransfer, - e.BytesTransferred / (0.01 * e.TotalBytesToTransfer )); - justHadByteUpdate = true; - } - else if(e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) - { - if (justHadByteUpdate) - Console.WriteLine(); - Console.WriteLine("Extracting: {0}", e.CurrentEntry.FileName); - justHadByteUpdate= false; - } - } - - public static ExtractZip(string zipToExtract, string directory) - { - string TargetDirectory= "extract"; - using (var zip = ZipFile.Read(zipToExtract)) { - zip.ExtractProgress += ExtractProgress; - foreach (var e in zip1) - { - e.Extract(TargetDirectory, true); - } - } - } - - - - Public Shared Sub Main(ByVal args As String()) - Dim ZipToUnpack As String = "C1P3SML.zip" - Dim TargetDir As String = "ExtractTest_Extract" - Console.WriteLine("Extracting file {0} to {1}", ZipToUnpack, TargetDir) - Using zip1 As ZipFile = ZipFile.Read(ZipToUnpack) - AddHandler zip1.ExtractProgress, AddressOf MyExtractProgress - Dim e As ZipEntry - For Each e In zip1 - e.Extract(TargetDir, True) - Next - End Using - End Sub - - Private Shared justHadByteUpdate As Boolean = False - - Public Shared Sub MyExtractProgress(ByVal sender As Object, ByVal e As ExtractProgressEventArgs) - If (e.EventType = ZipProgressEventType.Extracting_EntryBytesWritten) Then - If ExtractTest.justHadByteUpdate Then - Console.SetCursorPosition(0, Console.CursorTop) - End If - Console.Write(" {0}/{1} ({2:N0}%)", e.BytesTransferred, e.TotalBytesToTransfer, (CDbl(e.BytesTransferred) / (0.01 * e.TotalBytesToTransfer))) - ExtractTest.justHadByteUpdate = True - ElseIf (e.EventType = ZipProgressEventType.Extracting_BeforeExtractEntry) Then - If ExtractTest.justHadByteUpdate Then - Console.WriteLine - End If - Console.WriteLine("Extracting: {0}", e.CurrentEntry.FileName) - ExtractTest.justHadByteUpdate = False - End If - End Sub - - - - - - - - - - An event handler invoked before, during, and after Adding entries to a zip archive. - - - - Adding a large number of entries to a zip file can take a long - time. For example, when calling on a - directory that contains 50,000 files, it could take 3 minutes or so. - This event handler allws an application to track the progress of the Add - operation, and to optionally cancel a lengthy Add operation. - - - - - - int _numEntriesToAdd= 0; - int _numEntriesAdded= 0; - void AddProgressHandler(object sender, AddProgressEventArgs e) - { - switch (e.EventType) - { - case ZipProgressEventType.Adding_Started: - Console.WriteLine("Adding files to the zip..."); - break; - case ZipProgressEventType.Adding_AfterAddEntry: - _numEntriesAdded++; - Console.WriteLine(String.Format("Adding file {0}/{1} :: {2}", - _numEntriesAdded, _numEntriesToAdd, e.CurrentEntry.FileName)); - break; - case ZipProgressEventType.Adding_Completed: - Console.WriteLine("Added all files"); - break; - } - } - - void CreateTheZip() - { - using (ZipFile zip = new ZipFile()) - { - zip.AddProgress += AddProgressHandler; - zip.AddDirectory(System.IO.Path.GetFileName(DirToZip)); - zip.Save(ZipFileToCreate); - } - } - - - - - - Private Sub AddProgressHandler(ByVal sender As Object, ByVal e As AddProgressEventArgs) - Select Case e.EventType - Case ZipProgressEventType.Adding_Started - Console.WriteLine("Adding files to the zip...") - Exit Select - Case ZipProgressEventType.Adding_AfterAddEntry - Console.WriteLine(String.Format("Adding file {0}", e.CurrentEntry.FileName)) - Exit Select - Case ZipProgressEventType.Adding_Completed - Console.WriteLine("Added all files") - Exit Select - End Select - End Sub - - Sub CreateTheZip() - Using zip as ZipFile = New ZipFile - AddHandler zip.AddProgress, AddressOf AddProgressHandler - zip.AddDirectory(System.IO.Path.GetFileName(DirToZip)) - zip.Save(ZipFileToCreate); - End Using - End Sub - - - - - - - - - - - - An event that is raised when an error occurs during open or read of files - while saving a zip archive. - - - - - Errors can occur as a file is being saved to the zip archive. For - example, the File.Open may fail, or a File.Read may fail, because of - lock conflicts or other reasons. If you add a handler to this event, - you can handle such errors in your own code. If you don't add a - handler, the library will throw an exception if it encounters an I/O - error during a call to Save(). - - - - Setting a handler implicitly sets to - ZipErrorAction.InvokeErrorEvent. - - - - The handler you add applies to all items that are - subsequently added to the ZipFile instance. If you set this - property after you have added items to the ZipFile, but before you - have called Save(), errors that occur while saving those items - will not cause the error handler to be invoked. - - - - If you want to handle any errors that occur with any entry in the zip - file using the same error handler, then add your error handler once, - before adding any entries to the zip archive. - - - - In the error handler method, you need to set the property on the - ZipErrorEventArgs.CurrentEntry. This communicates back to - DotNetZip what you would like to do with this particular error. Within - an error handler, if you set the ZipEntry.ZipErrorAction property - on the ZipEntry to ZipErrorAction.InvokeErrorEvent or if - you don't set it at all, the library will throw the exception. (It is the - same as if you had set the ZipEntry.ZipErrorAction property on the - ZipEntry to ZipErrorAction.Throw.) If you set the - ZipErrorEventArgs.Cancel to true, the entire Save() will be - canceled. - - - - In the case that you use ZipErrorAction.Skip, implying that - you want to skip the entry for which there's been an error, DotNetZip - tries to seek backwards in the output stream, and truncate all bytes - written on behalf of that particular entry. This works only if the - output stream is seekable. It will not work, for example, when using - ASPNET's Response.OutputStream. - - - - - - - This example shows how to use an event handler to handle - errors during save of the zip file. - - - public static void MyZipError(object sender, ZipErrorEventArgs e) - { - Console.WriteLine("Error saving {0}...", e.FileName); - Console.WriteLine(" Exception: {0}", e.exception); - ZipEntry entry = e.CurrentEntry; - string response = null; - // Ask the user whether he wants to skip this error or not - do - { - Console.Write("Retry, Skip, Throw, or Cancel ? (R/S/T/C) "); - response = Console.ReadLine(); - Console.WriteLine(); - - } while (response != null && - response[0]!='S' && response[0]!='s' && - response[0]!='R' && response[0]!='r' && - response[0]!='T' && response[0]!='t' && - response[0]!='C' && response[0]!='c'); - - e.Cancel = (response[0]=='C' || response[0]=='c'); - - if (response[0]=='S' || response[0]=='s') - entry.ZipErrorAction = ZipErrorAction.Skip; - else if (response[0]=='R' || response[0]=='r') - entry.ZipErrorAction = ZipErrorAction.Retry; - else if (response[0]=='T' || response[0]=='t') - entry.ZipErrorAction = ZipErrorAction.Throw; - } - - public void SaveTheFile() - { - string directoryToZip = "fodder"; - string directoryInArchive = "files"; - string zipFileToCreate = "Archive.zip"; - using (var zip = new ZipFile()) - { - // set the event handler before adding any entries - zip.ZipError += MyZipError; - zip.AddDirectory(directoryToZip, directoryInArchive); - zip.Save(zipFileToCreate); - } - } - - - - Private Sub MyZipError(ByVal sender As Object, ByVal e As Ionic.Zip.ZipErrorEventArgs) - ' At this point, the application could prompt the user for an action to take. - ' But in this case, this application will simply automatically skip the file, in case of error. - Console.WriteLine("Zip Error, entry {0}", e.CurrentEntry.FileName) - Console.WriteLine(" Exception: {0}", e.exception) - ' set the desired ZipErrorAction on the CurrentEntry to communicate that to DotNetZip - e.CurrentEntry.ZipErrorAction = Zip.ZipErrorAction.Skip - End Sub - - Public Sub SaveTheFile() - Dim directoryToZip As String = "fodder" - Dim directoryInArchive As String = "files" - Dim zipFileToCreate as String = "Archive.zip" - Using zipArchive As ZipFile = New ZipFile - ' set the event handler before adding any entries - AddHandler zipArchive.ZipError, AddressOf MyZipError - zipArchive.AddDirectory(directoryToZip, directoryInArchive) - zipArchive.Save(zipFileToCreate) - End Using - End Sub - - - - - - - - - Options for using ZIP64 extensions when saving zip archives. - - - - - - Designed many years ago, the original zip - specification from PKWARE allowed for 32-bit quantities for the - compressed and uncompressed sizes of zip entries, as well as a 32-bit quantity - for specifying the length of the zip archive itself, and a maximum of 65535 - entries. These limits are now regularly exceeded in many backup and archival - scenarios. Recently, PKWare added extensions to the original zip spec, called - "ZIP64 extensions", to raise those limitations. This property governs whether - DotNetZip will use those extensions when writing zip archives. The use of - these extensions is optional and explicit in DotNetZip because, despite the - status of ZIP64 as a bona fide standard, many other zip tools and libraries do - not support ZIP64, and therefore a zip file with ZIP64 extensions may be - unreadable by some of those other tools. - - - - Set this property to to always use ZIP64 - extensions when saving, regardless of whether your zip archive needs it. - Suppose you add 5 files, each under 100k, to a ZipFile. If you specify Always - for this flag, you will get a ZIP64 archive, though the archive does not need - to use ZIP64 because none of the original zip limits had been exceeded. - - - - Set this property to to tell the DotNetZip - library to never use ZIP64 extensions. This is useful for maximum - compatibility and interoperability, at the expense of the capability of - handling large files or large archives. NB: Windows Explorer in Windows XP - and Windows Vista cannot currently extract files from a zip64 archive, so if - you want to guarantee that a zip archive produced by this library will work in - Windows Explorer, use Never. If you set this property to , and your application creates a zip that would - exceed one of the Zip limits, the library will throw an exception while saving - the zip file. - - - - Set this property to to tell the - DotNetZip library to use the ZIP64 extensions when required by the - entry. After the file is compressed, the original and compressed sizes are - checked, and if they exceed the limits described above, then zip64 can be - used. That is the general idea, but there is an additional wrinkle when saving - to a non-seekable device, like the ASP.NET Response.OutputStream, or - Console.Out. When using non-seekable streams for output, the entry - header - which indicates whether zip64 is in use - is emitted before it is - known if zip64 is necessary. It is only after all entries have been saved - that it can be known if ZIP64 will be required. On seekable output streams, - after saving all entries, the library can seek backward and re-emit the zip - file header to be consistent with the actual ZIP64 requirement. But using a - non-seekable output stream, the library cannot seek backward, so the header - can never be changed. In other words, the archive's use of ZIP64 extensions is - not alterable after the header is emitted. Therefore, when saving to - non-seekable streams, using is the same - as using : it will always produce a zip - archive that uses ZIP64 extensions. - - - - - - - The default behavior, which is "Never". - (For COM clients, this is a 0 (zero).) - - - - - Do not use ZIP64 extensions when writing zip archives. - (For COM clients, this is a 0 (zero).) - - - - - Use ZIP64 extensions when writing zip archives, as necessary. - For example, when a single entry exceeds 0xFFFFFFFF in size, or when the archive as a whole - exceeds 0xFFFFFFFF in size, or when there are more than 65535 entries in an archive. - (For COM clients, this is a 1.) - - - - - Always use ZIP64 extensions when writing zip archives, even when unnecessary. - (For COM clients, this is a 2.) - - - - - An enum representing the values on a three-way toggle switch - for various options in the library. This might be used to - specify whether to employ a particular text encoding, or to use - ZIP64 extensions, or some other option. - - - - - The default behavior. This is the same as "Never". - (For COM clients, this is a 0 (zero).) - - - - - Never use the associated option. - (For COM clients, this is a 0 (zero).) - - - - - Use the associated behavior "as necessary." - (For COM clients, this is a 1.) - - - - - Use the associated behavior Always, whether necessary or not. - (For COM clients, this is a 2.) - - - - - A class for collecting the various options that can be used when - Reading zip files for extraction or update. - - - - - When reading a zip file, there are several options an - application can set, to modify how the file is read, or what - the library does while reading. This class collects those - options into one container. - - - - Pass an instance of the ReadOptions class into the - ZipFile.Read() method. - - - . - . - - - - - An event handler for Read operations. When opening large zip - archives, you may want to display a progress bar or other - indicator of status progress while reading. This parameter - allows you to specify a ReadProgress Event Handler directly. - When you call Read(), the progress event is invoked as - necessary. - - - - - The System.IO.TextWriter to use for writing verbose status messages - during operations on the zip archive. A console application may wish to - pass System.Console.Out to get messages on the Console. A graphical - or headless application may wish to capture the messages in a different - TextWriter, such as a System.IO.StringWriter. - - - - - The System.Text.Encoding to use when reading in the zip archive. Be - careful specifying the encoding. If the value you use here is not the same - as the Encoding used when the zip archive was created (possibly by a - different archiver) you will get unexpected results and possibly exceptions. - - - - - - - - An enum that provides the different self-extractor flavors - - - - - A self-extracting zip archive that runs from the console or - command line. - - - - - A self-extracting zip archive that presents a graphical user - interface when it is executed. - - - - - The options for generating a self-extracting archive. - - - - - The type of SFX to create. - - - - - The command to run after extraction. - - - - - This is optional. Leave it empty (null in C# or Nothing in - VB) to run no command after extraction. - - - - If it is non-empty, the SFX will execute the command specified in this - string on the user's machine, and using the extract directory as the - working directory for the process, after unpacking the archive. The - program to execute can include a path, if you like. If you want to execute - a program that accepts arguments, specify the program name, followed by a - space, and then the arguments for the program, each separated by a space, - just as you would on a normal command line. Example: program.exe arg1 - arg2. The string prior to the first space will be taken as the - program name, and the string following the first space specifies the - arguments to the program. - - - - If you want to execute a program that has a space in the name or path of - the file, surround the program name in double-quotes. The first character - of the command line should be a double-quote character, and there must be - a matching double-quote following the end of the program file name. Any - optional arguments to the program follow that, separated by - spaces. Example: "c:\project files\program name.exe" arg1 arg2. - - - - If the flavor of the SFX is SelfExtractorFlavor.ConsoleApplication, - then the SFX starts a new process, using this string as the post-extract - command line. The SFX waits for the process to exit. The exit code of - the post-extract command line is returned as the exit code of the - command-line self-extractor exe. A non-zero exit code is typically used to - indicated a failure by the program. In the case of an SFX, a non-zero exit - code may indicate a failure during extraction, OR, it may indicate a - failure of the run-after-extract program if specified, OR, it may indicate - the run-after-extract program could not be fuond. There is no way to - distinguish these conditions from the calling shell, aside from parsing - the output of the SFX. If you have Quiet set to true, you may not - see error messages, if a problem occurs. - - - - If the flavor of the SFX is - SelfExtractorFlavor.WinFormsApplication, then the SFX starts a new - process, using this string as the post-extract command line, and using the - extract directory as the working directory for the process. The SFX does - not wait for the command to complete, and does not check the exit code of - the program. If the run-after-extract program cannot be fuond, a message - box is displayed indicating that fact. - - - - You can specify environment variables within this string, with a format like - %NAME%. The value of these variables will be expanded at the time - the SFX is run. Example: %WINDIR%\system32\xcopy.exe may expand at - runtime to c:\Windows\System32\xcopy.exe. - - - - By combining this with the RemoveUnpackedFilesAfterExecute - flag, you can create an SFX that extracts itself, runs a file that - was extracted, then deletes all the files that were extracted. If - you want it to run "invisibly" then set Flavor to - SelfExtractorFlavor.ConsoleApplication, and set Quiet - to true. The user running such an EXE will see a console window - appear, then disappear quickly. You may also want to specify the - default extract location, with DefaultExtractDirectory. - - - - If you set Flavor to - SelfExtractorFlavor.WinFormsApplication, and set Quiet to - true, then a GUI with progressbars is displayed, but it is - "non-interactive" - it accepts no input from the user. Instead the SFX - just automatically unpacks and exits. - - - - - - - The default extract directory the user will see when - running the self-extracting archive. - - - - - Passing null (or Nothing in VB) here will cause the Self Extractor to use - the the user's personal directory () for the default extract - location. - - - - This is only a default location. The actual extract location will be - settable on the command line when the SFX is executed. - - - - You can specify environment variables within this string, - with %NAME%. The value of these variables will be - expanded at the time the SFX is run. Example: - %USERPROFILE%\Documents\unpack may expand at runtime to - c:\users\melvin\Documents\unpack. - - - - - - The name of an .ico file in the filesystem to use for the application icon - for the generated SFX. - - - - - Normally, DotNetZip will embed an "zipped folder" icon into the generated - SFX. If you prefer to use a different icon, you can specify it here. It - should be a .ico file. This file is passed as the /win32icon - option to the csc.exe compiler when constructing the SFX file. - - - - - - - Whether the ConsoleApplication SFX will be quiet during extraction. - - - - - This option affects the way the generated SFX runs. By default it is - false. When you set it to true,... - - - - - Flavor - Behavior - - - - ConsoleApplication - no messages will be emitted during successful - operation. Double-clicking the SFX in Windows - Explorer or as an attachment in an email will cause a console - window to appear briefly, before it disappears. If you run the - ConsoleApplication SFX from the cmd.exe prompt, it runs as a - normal console app; by default, because it is quiet, it displays - no messages to the console. If you pass the -v+ command line - argument to the Console SFX when you run it, you will get verbose - messages to the console. - - - - - WinFormsApplication - the SFX extracts automatically when the application - is launched, with no additional user input. - - - - - - - When you set it to false,... - - - - - Flavor - Behavior - - - - ConsoleApplication - the extractor will emit a - message to the console for each entry extracted. - - When double-clicking to launch the SFX, the console window will - remain, and the SFX will emit a message for each file as it - extracts. The messages fly by quickly, they won't be easily - readable, unless the extracted files are fairly large. - - - - - - WinFormsApplication - the SFX presents a forms UI and allows the user to select - options before extracting. - - - - - - - - - - Specify what the self-extractor will do when extracting an entry - would overwrite an existing file. - - - - The default behavvior is to Throw. - - - - - - Whether to remove the files that have been unpacked, after executing the - PostExtractCommandLine. - - - - - If true, and if there is a - PostExtractCommandLine, and if the command runs successfully, - then the files that the SFX unpacked will be removed, afterwards. If - the command does not complete successfully (non-zero return code), - that is interpreted as a failure, and the extracted files will not be - removed. - - - - Setting this flag, and setting Flavor to - SelfExtractorFlavor.ConsoleApplication, and setting Quiet to - true, results in an SFX that extracts itself, runs a file that was - extracted, then deletes all the files that were extracted, with no - intervention by the user. You may also want to specify the default - extract location, with DefaultExtractDirectory. - - - - - - - The file version number to embed into the generated EXE. It will show up, for - example, during a mouseover in Windows Explorer. - - - - - - The product version to embed into the generated EXE. It will show up, for - example, during a mouseover in Windows Explorer. - - - - You can use any arbitrary string, but a human-readable version number is - recommended. For example "v1.2 alpha" or "v4.2 RC2". If you specify nothing, - then there is no product version embedded into the EXE. - - - - - - The copyright notice, if any, to embed into the generated EXE. - - - - It will show up, for example, while viewing properties of the file in - Windows Explorer. You can use any arbitrary string, but typically you - want something like "Copyright © Dino Chiesa 2011". - - - - - - The description to embed into the generated EXE. - - - - Use any arbitrary string. This text will be displayed during a - mouseover in Windows Explorer. If you specify nothing, then the string - "DotNetZip SFX Archive" is embedded into the EXE as the description. - - - - - - The product name to embed into the generated EXE. - - - - Use any arbitrary string. This text will be displayed - while viewing properties of the EXE file in - Windows Explorer. - - - - - - The title to display in the Window of a GUI SFX, while it extracts. - - - - - By default the title show in the GUI window of a self-extractor - is "DotNetZip Self-extractor (http://DotNetZip.codeplex.com/)". - You can change that by setting this property before saving the SFX. - - - - This property has an effect only when producing a Self-extractor - of flavor SelfExtractorFlavor.WinFormsApplication. - - - - - - - Additional options for the csc.exe compiler, when producing the SFX - EXE. - - - - - - Reset the BitWriter. - - - - This is useful when the BitWriter writes into a MemoryStream, and - is used by a BZip2Compressor, which itself is re-used for multiple - distinct data blocks. - - - - - - Write some number of bits from the given value, into the output. - - - - The nbits value should be a max of 25, for safety. For performance - reasons, this method does not check! - - - - - - Write a full 8-bit byte into the output. - - - - - Write four 8-bit bytes into the output. - - - - - Write all available byte-aligned bytes. - - - - This method writes no new output, but flushes any accumulated - bits. At completion, the accumulator may contain up to 7 - bits. - - - This is necessary when re-assembling output from N independent - compressors, one for each of N blocks. The output of any - particular compressor will in general have some fragment of a byte - remaining. This fragment needs to be accumulated into the - parent BZip2OutputStream. - - - - - - Writes all available bytes, and emits padding for the final byte as - necessary. This must be the last method invoked on an instance of - BitWriter. - - - - - Delivers the remaining bits, left-aligned, in a byte. - - - - This is valid only if NumRemainingBits is less than 8; - in other words it is valid only after a call to Flush(). - - - - - Knuth's increments seem to work better than Incerpi-Sedgewick here. - Possibly because the number of elems to sort is usually small, typically - <= 20. - - - - BZip2Compressor writes its compressed data out via a BitWriter. This - is necessary because BZip2 does byte shredding. - - - - - Accept new bytes into the compressor data buffer - - - - This method does the first-level (cheap) run-length encoding, and - stores the encoded data into the rle block. - - - - - - Process one input byte into the block. - - - - - To "process" the byte means to do the run-length encoding. - There are 3 possible return values: - - 0 - the byte was not written, in other words, not - encoded into the block. This happens when the - byte b would require the start of a new run, and - the block has no more room for new runs. - - 1 - the byte was written, and the block is not full. - - 2 - the byte was written, and the block is full. - - - - 0 if the byte was not written, non-zero if written. - - - - Append one run to the output block. - - - - - This compressor does run-length-encoding before BWT and etc. This - method simply appends a run to the output block. The append always - succeeds. The return value indicates whether the block is full: - false (not full) implies that at least one additional run could be - processed. - - - true if the block is now full; otherwise false. - - - - Compress the data that has been placed (Run-length-encoded) into the - block. The compressed data goes into the CompressedBytes array. - - - - Side effects: 1. fills the CompressedBytes array. 2. sets the - AvailableBytesOut property. - - - - - This is the most hammered method of this class. - -

- This is the version using unrolled loops. -

-
- - Method "mainQSort3", file "blocksort.c", BZip2 1.0.2 - - - - The number of uncompressed bytes being held in the buffer. - - - - I am thinking this may be useful in a Stream that uses this - compressor class. In the Close() method on the stream it could - check this value to see if anything has been written at all. You - may think the stream could easily track the number of bytes it - wrote, which would eliminate the need for this. But, there is the - case where the stream writes a complete block, and it is full, and - then writes no more. In that case the stream may want to check. - - - - - Array instance identical to sfmap, both are used only - temporarily and independently, so we do not need to allocate - additional memory. - - - - A read-only decorator stream that performs BZip2 decompression on Read. - - - - - Create a BZip2InputStream, wrapping it around the given input Stream. - - - - The input stream will be closed when the BZip2InputStream is closed. - - - The stream from which to read compressed data - - - - Create a BZip2InputStream with the given stream, and - specifying whether to leave the wrapped stream open when - the BZip2InputStream is closed. - - The stream from which to read compressed data - - Whether to leave the input stream open, when the BZip2InputStream closes. - - - - - This example reads a bzip2-compressed file, decompresses it, - and writes the decompressed data into a newly created file. - - - var fname = "logfile.log.bz2"; - using (var fs = File.OpenRead(fname)) - { - using (var decompressor = new Ionic.BZip2.BZip2InputStream(fs)) - { - var outFname = fname + ".decompressed"; - using (var output = File.Create(outFname)) - { - byte[] buffer = new byte[2048]; - int n; - while ((n = decompressor.Read(buffer, 0, buffer.Length)) > 0) - { - output.Write(buffer, 0, n); - } - } - } - } - - - - - - Read data from the stream. - - - - - To decompress a BZip2 data stream, create a BZip2InputStream, - providing a stream that reads compressed data. Then call Read() on - that BZip2InputStream, and the data read will be decompressed - as you read. - - - - A BZip2InputStream can be used only for Read(), not for Write(). - - - - The buffer into which the read data should be placed. - the offset within that data array to put the first byte read. - the number of bytes to read. - the number of bytes actually read - - - - Read a single byte from the stream. - - the byte read from the stream, or -1 if EOF - - - - Flush the stream. - - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - this is irrelevant, since it will always throw! - irrelevant! - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - - - - Calling this method always throws a . - - this parameter is never used - this parameter is never used - this parameter is never used - - - - Dispose the stream. - - - indicates whether the Dispose method was invoked by user code. - - - - - Close the stream. - - - - - Read n bits from input, right justifying the result. - - - - For example, if you read 1 bit, the result is either 0 - or 1. - - - - The number of bits to read, always between 1 and 32. - - - - Called by createHuffmanDecodingTables() exclusively. - - - Called by recvDecodingTables() exclusively. - - - - Indicates whether the stream can be read. - - - The return value depends on whether the captive stream supports reading. - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream can be written. - - - The return value depends on whether the captive stream supports writing. - - - - - Reading this property always throws a . - - - - - The position of the stream pointer. - - - - Setting this property always throws a . Reading will return the - total number of uncompressed bytes read in. - - - - - Compressor State - - - - Freq table collected to save a pass over the data during - decompression. - - - Initializes the tt array. - - This method is called when the required length of the array is known. - I don't initialize it at construction time to avoid unneccessary - memory allocation when compressing small files. - - - - A write-only decorator stream that compresses data as it is - written using the BZip2 algorithm. - - - - - Constructs a new BZip2OutputStream, that sends its - compressed output to the given output stream. - - - - The destination stream, to which compressed output will be sent. - - - - - This example reads a file, then compresses it with bzip2 file, - and writes the compressed data into a newly created file. - - - var fname = "logfile.log"; - using (var fs = File.OpenRead(fname)) - { - var outFname = fname + ".bz2"; - using (var output = File.Create(outFname)) - { - using (var compressor = new Ionic.BZip2.BZip2OutputStream(output)) - { - byte[] buffer = new byte[2048]; - int n; - while ((n = fs.Read(buffer, 0, buffer.Length)) > 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - - - - Constructs a new BZip2OutputStream with specified blocksize. - - the destination stream. - - The blockSize in units of 100000 bytes. - The valid range is 1..9. - - - - - Constructs a new BZip2OutputStream. - - the destination stream. - - whether to leave the captive stream open upon closing this stream. - - - - - Constructs a new BZip2OutputStream with specified blocksize, - and explicitly specifies whether to leave the wrapped stream open. - - - the destination stream. - - The blockSize in units of 100000 bytes. - The valid range is 1..9. - - - whether to leave the captive stream open upon closing this stream. - - - - - Close the stream. - - - - This may or may not close the underlying stream. Check the - constructors that accept a bool value. - - - - - - Flush the stream. - - - - - Write data to the stream. - - - - - Use the BZip2OutputStream to compress data while writing: - create a BZip2OutputStream with a writable output stream. - Then call Write() on that BZip2OutputStream, providing - uncompressed data as input. The data sent to the output stream will - be the compressed form of the input data. - - - - A BZip2OutputStream can be used only for Write() not for Read(). - - - - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - this is irrelevant, since it will always throw! - irrelevant! - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - - - - Calling this method always throws a . - - this parameter is never used - this parameter is never used - this parameter is never used - never returns anything; always throws - - - - The blocksize parameter specified at construction time. - - - - - Indicates whether the stream can be read. - - - The return value is always false. - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream can be written. - - - The return value should always be true, unless and until the - object is disposed and closed. - - - - - Reading this property always throws a . - - - - - The position of the stream pointer. - - - - Setting this property always throws a . Reading will return the - total number of uncompressed bytes written through. - - - - - A write-only decorator stream that compresses data as it is - written using the BZip2 algorithm. This stream compresses by - block using multiple threads. - - - This class performs BZIP2 compression through writing. For - more information on the BZIP2 algorithm, see - . - - - - This class is similar to , - except that this implementation uses an approach that employs multiple - worker threads to perform the compression. On a multi-cpu or multi-core - computer, the performance of this class can be significantly higher than - the single-threaded BZip2OutputStream, particularly for larger streams. - How large? Anything over 10mb is a good candidate for parallel - compression. - - - - The tradeoff is that this class uses more memory and more CPU than the - vanilla BZip2OutputStream. Also, for small files, the - ParallelBZip2OutputStream can be much slower than the vanilla - BZip2OutputStream, because of the overhead associated to using the - thread pool. - - - - - - - Constructs a new ParallelBZip2OutputStream, that sends its - compressed output to the given output stream. - - - - The destination stream, to which compressed output will be sent. - - - - - This example reads a file, then compresses it with bzip2 file, - and writes the compressed data into a newly created file. - - - var fname = "logfile.log"; - using (var fs = File.OpenRead(fname)) - { - var outFname = fname + ".bz2"; - using (var output = File.Create(outFname)) - { - using (var compressor = new Ionic.BZip2.ParallelBZip2OutputStream(output)) - { - byte[] buffer = new byte[2048]; - int n; - while ((n = fs.Read(buffer, 0, buffer.Length)) > 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - - - - Constructs a new ParallelBZip2OutputStream with specified blocksize. - - the destination stream. - - The blockSize in units of 100000 bytes. - The valid range is 1..9. - - - - - Constructs a new ParallelBZip2OutputStream. - - the destination stream. - - whether to leave the captive stream open upon closing this stream. - - - - - Constructs a new ParallelBZip2OutputStream with specified blocksize, - and explicitly specifies whether to leave the wrapped stream open. - - - the destination stream. - - The blockSize in units of 100000 bytes. - The valid range is 1..9. - - - whether to leave the captive stream open upon closing this stream. - - - - - Close the stream. - - - - This may or may not close the underlying stream. Check the - constructors that accept a bool value. - - - - - - Flush the stream. - - - - - Write data to the stream. - - - - - Use the ParallelBZip2OutputStream to compress data while - writing: create a ParallelBZip2OutputStream with a writable - output stream. Then call Write() on that - ParallelBZip2OutputStream, providing uncompressed data as - input. The data sent to the output stream will be the compressed - form of the input data. - - - - A ParallelBZip2OutputStream can be used only for - Write() not for Read(). - - - - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - this is irrelevant, since it will always throw! - irrelevant! - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - - - - Calling this method always throws a . - - this parameter is never used - this parameter is never used - this parameter is never used - never returns anything; always throws - - - - The maximum number of concurrent compression worker threads to use. - - - - - This property sets an upper limit on the number of concurrent worker - threads to employ for compression. The implementation of this stream - employs multiple threads from the .NET thread pool, via - ThreadPool.QueueUserWorkItem(), to compress the incoming data by - block. As each block of data is compressed, this stream re-orders the - compressed blocks and writes them to the output stream. - - - - A higher number of workers enables a higher degree of - parallelism, which tends to increase the speed of compression on - multi-cpu computers. On the other hand, a higher number of buffer - pairs also implies a larger memory consumption, more active worker - threads, and a higher cpu utilization for any compression. This - property enables the application to limit its memory consumption and - CPU utilization behavior depending on requirements. - - - - By default, DotNetZip allocates 4 workers per CPU core, subject to the - upper limit specified in this property. For example, suppose the - application sets this property to 16. Then, on a machine with 2 - cores, DotNetZip will use 8 workers; that number does not exceed the - upper limit specified by this property, so the actual number of - workers used will be 4 * 2 = 8. On a machine with 4 cores, DotNetZip - will use 16 workers; again, the limit does not apply. On a machine - with 8 cores, DotNetZip will use 16 workers, because of the limit. - - - - For each compression "worker thread" that occurs in parallel, there is - up to 2mb of memory allocated, for buffering and processing. The - actual number depends on the property. - - - - CPU utilization will also go up with additional workers, because a - larger number of buffer pairs allows a larger number of background - threads to compress in parallel. If you find that parallel - compression is consuming too much memory or CPU, you can adjust this - value downward. - - - - The default value is 16. Different values may deliver better or - worse results, depending on your priorities and the dynamic - performance characteristics of your storage and compute resources. - - - - The application can set this value at any time, but it is effective - only before the first call to Write(), which is when the buffers are - allocated. - - - - - - The blocksize parameter specified at construction time. - - - - - Indicates whether the stream can be read. - - - The return value is always false. - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream can be written. - - - The return value depends on whether the captive stream supports writing. - - - - - Reading this property always throws a . - - - - - The position of the stream pointer. - - - - Setting this property always throws a . Reading will return the - total number of uncompressed bytes written through. - - - - - The total number of bytes written out by the stream. - - - This value is meaningful only after a call to Close(). - - - - - Returns the "random" number at a specific index. - - the index - the random number - - - - A class for compressing and decompressing streams using the Deflate algorithm. - - - - - - The DeflateStream is a Decorator on a . It adds DEFLATE compression or decompression to any - stream. - - - - Using this stream, applications can compress or decompress data via stream - Read and Write operations. Either compresssion or decompression - can occur through either reading or writing. The compression format used is - DEFLATE, which is documented in IETF RFC 1951, "DEFLATE - Compressed Data Format Specification version 1.3.". - - - - This class is similar to , except that - ZlibStream adds the RFC - 1950 - ZLIB framing bytes to a compressed stream when compressing, or - expects the RFC1950 framing bytes when decompressing. The DeflateStream - does not. - - - - - - - - - - Create a DeflateStream using the specified CompressionMode. - - - - When mode is CompressionMode.Compress, the DeflateStream will use - the default compression level. The "captive" stream will be closed when - the DeflateStream is closed. - - - - This example uses a DeflateStream to compress data from a file, and writes - the compressed data to another file. - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) - { - using (Stream compressor = new DeflateStream(raw, CompressionMode.Compress)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(fileToCompress & ".deflated") - Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - The stream which will be read or written. - Indicates whether the DeflateStream will compress or decompress. - - - - Create a DeflateStream using the specified CompressionMode and the specified CompressionLevel. - - - - - - When mode is CompressionMode.Decompress, the level parameter is - ignored. The "captive" stream will be closed when the DeflateStream is - closed. - - - - - - - This example uses a DeflateStream to compress data from a file, and writes - the compressed data to another file. - - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) - { - using (Stream compressor = new DeflateStream(raw, - CompressionMode.Compress, - CompressionLevel.BestCompression)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n= -1; - while (n != 0) - { - if (n > 0) - compressor.Write(buffer, 0, n); - n= input.Read(buffer, 0, buffer.Length); - } - } - } - } - - - - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(fileToCompress & ".deflated") - Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - The stream to be read or written while deflating or inflating. - Indicates whether the DeflateStream will compress or decompress. - A tuning knob to trade speed for effectiveness. - - - - Create a DeflateStream using the specified - CompressionMode, and explicitly specify whether the - stream should be left open after Deflation or Inflation. - - - - - - This constructor allows the application to request that the captive stream - remain open after the deflation or inflation occurs. By default, after - Close() is called on the stream, the captive stream is also - closed. In some cases this is not desired, for example if the stream is a - memory stream that will be re-read after compression. Specify true for - the parameter to leave the stream open. - - - - The DeflateStream will use the default compression level. - - - - See the other overloads of this constructor for example code. - - - - - The stream which will be read or written. This is called the - "captive" stream in other places in this documentation. - - - - Indicates whether the DeflateStream will compress or decompress. - - - true if the application would like the stream to - remain open after inflation/deflation. - - - - Create a DeflateStream using the specified CompressionMode - and the specified CompressionLevel, and explicitly specify whether - the stream should be left open after Deflation or Inflation. - - - - - - When mode is CompressionMode.Decompress, the level parameter is ignored. - - - - This constructor allows the application to request that the captive stream - remain open after the deflation or inflation occurs. By default, after - Close() is called on the stream, the captive stream is also - closed. In some cases this is not desired, for example if the stream is a - that will be re-read after - compression. Specify true for the parameter - to leave the stream open. - - - - - - - This example shows how to use a DeflateStream to compress data from - a file, and store the compressed data into another file. - - - using (var output = System.IO.File.Create(fileToCompress + ".deflated")) - { - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (Stream compressor = new DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n= -1; - while (n != 0) - { - if (n > 0) - compressor.Write(buffer, 0, n); - n= input.Read(buffer, 0, buffer.Length); - } - } - } - // can write additional data to the output stream here - } - - - - Using output As FileStream = File.Create(fileToCompress & ".deflated") - Using input As Stream = File.OpenRead(fileToCompress) - Using compressor As Stream = New DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - ' can write additional data to the output stream here. - End Using - - - The stream which will be read or written. - Indicates whether the DeflateStream will compress or decompress. - true if the application would like the stream to remain open after inflation/deflation. - A tuning knob to trade speed for effectiveness. - - - - Dispose the stream. - - - - This may or may not result in a Close() call on the captive - stream. See the constructors that have a leaveOpen parameter - for more information. - - - Application code won't call this code directly. This method may be - invoked in two distinct scenarios. If disposing == true, the method - has been called directly or indirectly by a user's code, for example - via the public Dispose() method. In this case, both managed and - unmanaged resources can be referenced and disposed. If disposing == - false, the method has been called by the runtime from inside the - object finalizer and this method should not reference other objects; - in that case only unmanaged resources must be referenced or - disposed. - - - - true if the Dispose method was invoked by user code. - - - - - Flush the stream. - - - - - Read data from the stream. - - - - - If you wish to use the DeflateStream to compress data while - reading, you can create a DeflateStream with - CompressionMode.Compress, providing an uncompressed data stream. - Then call Read() on that DeflateStream, and the data read will be - compressed as you read. If you wish to use the DeflateStream to - decompress data while reading, you can create a DeflateStream with - CompressionMode.Decompress, providing a readable compressed data - stream. Then call Read() on that DeflateStream, and the data read - will be decompressed as you read. - - - - A DeflateStream can be used for Read() or Write(), but not both. - - - - The buffer into which the read data should be placed. - the offset within that data array to put the first byte read. - the number of bytes to read. - the number of bytes actually read - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - this is irrelevant, since it will always throw! - irrelevant! - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - - - - Write data to the stream. - - - - - If you wish to use the DeflateStream to compress data while - writing, you can create a DeflateStream with - CompressionMode.Compress, and a writable output stream. Then call - Write() on that DeflateStream, providing uncompressed data - as input. The data sent to the output stream will be the compressed form - of the data written. If you wish to use the DeflateStream to - decompress data while writing, you can create a DeflateStream with - CompressionMode.Decompress, and a writable output stream. Then - call Write() on that stream, providing previously compressed - data. The data sent to the output stream will be the decompressed form of - the data written. - - - - A DeflateStream can be used for Read() or Write(), - but not both. - - - - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Compress a string into a byte array using DEFLATE (RFC 1951). - - - - Uncompress it with . - - - DeflateStream.UncompressString(byte[]) - DeflateStream.CompressBuffer(byte[]) - GZipStream.CompressString(string) - ZlibStream.CompressString(string) - - - A string to compress. The string will first be encoded - using UTF8, then compressed. - - - The string in compressed form - - - - Compress a byte array into a new byte array using DEFLATE. - - - - Uncompress it with . - - - DeflateStream.CompressString(string) - DeflateStream.UncompressBuffer(byte[]) - GZipStream.CompressBuffer(byte[]) - ZlibStream.CompressBuffer(byte[]) - - - A buffer to compress. - - - The data in compressed form - - - - Uncompress a DEFLATE'd byte array into a single string. - - - DeflateStream.CompressString(String) - DeflateStream.UncompressBuffer(byte[]) - GZipStream.UncompressString(byte[]) - ZlibStream.UncompressString(byte[]) - - - A buffer containing DEFLATE-compressed data. - - - The uncompressed string - - - - Uncompress a DEFLATE'd byte array into a byte array. - - - DeflateStream.CompressBuffer(byte[]) - DeflateStream.UncompressString(byte[]) - GZipStream.UncompressBuffer(byte[]) - ZlibStream.UncompressBuffer(byte[]) - - - A buffer containing data that has been compressed with DEFLATE. - - - The data in uncompressed form - - - - This property sets the flush behavior on the stream. - - See the ZLIB documentation for the meaning of the flush behavior. - - - - - The size of the working buffer for the compression codec. - - - - - The working buffer is used for all stream operations. The default size is - 1024 bytes. The minimum size is 128 bytes. You may get better performance - with a larger buffer. Then again, you might not. You would have to test - it. - - - - Set this before the first call to Read() or Write() on the - stream. If you try to set it afterwards, it will throw. - - - - - - The ZLIB strategy to be used during compression. - - - - By tweaking this parameter, you may be able to optimize the compression for - data with particular characteristics. - - - - Returns the total number of bytes input so far. - - - Returns the total number of bytes output so far. - - - - Indicates whether the stream can be read. - - - The return value depends on whether the captive stream supports reading. - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream can be written. - - - The return value depends on whether the captive stream supports writing. - - - - - Reading this property always throws a . - - - - - The position of the stream pointer. - - - - Setting this property always throws a . Reading will return the total bytes - written out, if used in writing, or the total bytes read in, if used in - reading. The count may refer to compressed bytes or uncompressed bytes, - depending on how you've used the stream. - - - - - A class for compressing and decompressing GZIP streams. - - - - - The GZipStream is a Decorator on a - . It adds GZIP compression or decompression to any - stream. - - - - Like the System.IO.Compression.GZipStream in the .NET Base Class Library, the - Ionic.Zlib.GZipStream can compress while writing, or decompress while - reading, but not vice versa. The compression method used is GZIP, which is - documented in IETF RFC - 1952, "GZIP file format specification version 4.3". - - - A GZipStream can be used to decompress data (through Read()) or - to compress data (through Write()), but not both. - - - - If you wish to use the GZipStream to compress data, you must wrap it - around a write-able stream. As you call Write() on the GZipStream, the - data will be compressed into the GZIP format. If you want to decompress data, - you must wrap the GZipStream around a readable stream that contains an - IETF RFC 1952-compliant stream. The data will be decompressed as you call - Read() on the GZipStream. - - - - Though the GZIP format allows data from multiple files to be concatenated - together, this stream handles only a single segment of GZIP format, typically - representing a single file. - - - - This class is similar to and . - ZlibStream handles RFC1950-compliant streams. - handles RFC1951-compliant streams. This class handles RFC1952-compliant streams. - - - - - - - - - - The last modified time for the GZIP stream. - - - - GZIP allows the storage of a last modified time with each GZIP entry. - When compressing data, you can set this before the first call to - Write(). When decompressing, you can retrieve this value any time - after the first call to Read(). - - - - - Create a GZipStream using the specified CompressionMode. - - - - - When mode is CompressionMode.Compress, the GZipStream will use the - default compression level. - - - - As noted in the class documentation, the CompressionMode (Compress - or Decompress) also establishes the "direction" of the stream. A - GZipStream with CompressionMode.Compress works only through - Write(). A GZipStream with - CompressionMode.Decompress works only through Read(). - - - - - - This example shows how to use a GZipStream to compress data. - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(outputFile)) - { - using (Stream compressor = new GZipStream(raw, CompressionMode.Compress)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - Dim outputFile As String = (fileToCompress & ".compressed") - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(outputFile) - Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - - - This example shows how to use a GZipStream to uncompress a file. - - private void GunZipFile(string filename) - { - if (!filename.EndsWith(".gz)) - throw new ArgumentException("filename"); - var DecompressedFile = filename.Substring(0,filename.Length-3); - byte[] working = new byte[WORKING_BUFFER_SIZE]; - int n= 1; - using (System.IO.Stream input = System.IO.File.OpenRead(filename)) - { - using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) - { - using (var output = System.IO.File.Create(DecompressedFile)) - { - while (n !=0) - { - n= decompressor.Read(working, 0, working.Length); - if (n > 0) - { - output.Write(working, 0, n); - } - } - } - } - } - } - - - - Private Sub GunZipFile(ByVal filename as String) - If Not (filename.EndsWith(".gz)) Then - Throw New ArgumentException("filename") - End If - Dim DecompressedFile as String = filename.Substring(0,filename.Length-3) - Dim working(WORKING_BUFFER_SIZE) as Byte - Dim n As Integer = 1 - Using input As Stream = File.OpenRead(filename) - Using decompressor As Stream = new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, True) - Using output As Stream = File.Create(UncompressedFile) - Do - n= decompressor.Read(working, 0, working.Length) - If n > 0 Then - output.Write(working, 0, n) - End IF - Loop While (n > 0) - End Using - End Using - End Using - End Sub - - - - The stream which will be read or written. - Indicates whether the GZipStream will compress or decompress. - - - - Create a GZipStream using the specified CompressionMode and - the specified CompressionLevel. - - - - - The CompressionMode (Compress or Decompress) also establishes the - "direction" of the stream. A GZipStream with - CompressionMode.Compress works only through Write(). A - GZipStream with CompressionMode.Decompress works only - through Read(). - - - - - - - This example shows how to use a GZipStream to compress a file into a .gz file. - - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(fileToCompress + ".gz")) - { - using (Stream compressor = new GZipStream(raw, - CompressionMode.Compress, - CompressionLevel.BestCompression)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(fileToCompress & ".gz") - Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - The stream to be read or written while deflating or inflating. - Indicates whether the GZipStream will compress or decompress. - A tuning knob to trade speed for effectiveness. - - - - Create a GZipStream using the specified CompressionMode, and - explicitly specify whether the stream should be left open after Deflation - or Inflation. - - - - - This constructor allows the application to request that the captive stream - remain open after the deflation or inflation occurs. By default, after - Close() is called on the stream, the captive stream is also - closed. In some cases this is not desired, for example if the stream is a - memory stream that will be re-read after compressed data has been written - to it. Specify true for the parameter to leave - the stream open. - - - - The (Compress or Decompress) also - establishes the "direction" of the stream. A GZipStream with - CompressionMode.Compress works only through Write(). A GZipStream - with CompressionMode.Decompress works only through Read(). - - - - The GZipStream will use the default compression level. If you want - to specify the compression level, see . - - - - See the other overloads of this constructor for example code. - - - - - - The stream which will be read or written. This is called the "captive" - stream in other places in this documentation. - - - Indicates whether the GZipStream will compress or decompress. - - - - true if the application would like the base stream to remain open after - inflation/deflation. - - - - - Create a GZipStream using the specified CompressionMode and the - specified CompressionLevel, and explicitly specify whether the - stream should be left open after Deflation or Inflation. - - - - - - This constructor allows the application to request that the captive stream - remain open after the deflation or inflation occurs. By default, after - Close() is called on the stream, the captive stream is also - closed. In some cases this is not desired, for example if the stream is a - memory stream that will be re-read after compressed data has been written - to it. Specify true for the parameter to - leave the stream open. - - - - As noted in the class documentation, the CompressionMode (Compress - or Decompress) also establishes the "direction" of the stream. A - GZipStream with CompressionMode.Compress works only through - Write(). A GZipStream with CompressionMode.Decompress works only - through Read(). - - - - - - This example shows how to use a GZipStream to compress data. - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(outputFile)) - { - using (Stream compressor = new GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, true)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - Dim outputFile As String = (fileToCompress & ".compressed") - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(outputFile) - Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, True) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - The stream which will be read or written. - Indicates whether the GZipStream will compress or decompress. - true if the application would like the stream to remain open after inflation/deflation. - A tuning knob to trade speed for effectiveness. - - - - Dispose the stream. - - - - This may or may not result in a Close() call on the captive - stream. See the constructors that have a leaveOpen parameter - for more information. - - - This method may be invoked in two distinct scenarios. If disposing - == true, the method has been called directly or indirectly by a - user's code, for example via the public Dispose() method. In this - case, both managed and unmanaged resources can be referenced and - disposed. If disposing == false, the method has been called by the - runtime from inside the object finalizer and this method should not - reference other objects; in that case only unmanaged resources must - be referenced or disposed. - - - - indicates whether the Dispose method was invoked by user code. - - - - - Flush the stream. - - - - - Read and decompress data from the source stream. - - - - With a GZipStream, decompression is done through reading. - - - - - byte[] working = new byte[WORKING_BUFFER_SIZE]; - using (System.IO.Stream input = System.IO.File.OpenRead(_CompressedFile)) - { - using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) - { - using (var output = System.IO.File.Create(_DecompressedFile)) - { - int n; - while ((n= decompressor.Read(working, 0, working.Length)) !=0) - { - output.Write(working, 0, n); - } - } - } - } - - - The buffer into which the decompressed data should be placed. - the offset within that data array to put the first byte read. - the number of bytes to read. - the number of bytes actually read - - - - Calling this method always throws a . - - irrelevant; it will always throw! - irrelevant; it will always throw! - irrelevant! - - - - Calling this method always throws a . - - irrelevant; this method will always throw! - - - - Write data to the stream. - - - - - If you wish to use the GZipStream to compress data while writing, - you can create a GZipStream with CompressionMode.Compress, and a - writable output stream. Then call Write() on that GZipStream, - providing uncompressed data as input. The data sent to the output stream - will be the compressed form of the data written. - - - - A GZipStream can be used for Read() or Write(), but not - both. Writing implies compression. Reading implies decompression. - - - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Compress a string into a byte array using GZip. - - - - Uncompress it with . - - - - - - - A string to compress. The string will first be encoded - using UTF8, then compressed. - - - The string in compressed form - - - - Compress a byte array into a new byte array using GZip. - - - - Uncompress it with . - - - - - - - A buffer to compress. - - - The data in compressed form - - - - Uncompress a GZip'ed byte array into a single string. - - - - - - - A buffer containing GZIP-compressed data. - - - The uncompressed string - - - - Uncompress a GZip'ed byte array into a byte array. - - - - - - - A buffer containing data that has been compressed with GZip. - - - The data in uncompressed form - - - - The comment on the GZIP stream. - - - - - The GZIP format allows for each file to optionally have an associated - comment stored with the file. The comment is encoded with the ISO-8859-1 - code page. To include a comment in a GZIP stream you create, set this - property before calling Write() for the first time on the - GZipStream. - - - - When using GZipStream to decompress, you can retrieve this property - after the first call to Read(). If no comment has been set in the - GZIP bytestream, the Comment property will return null - (Nothing in VB). - - - - - - The FileName for the GZIP stream. - - - - - - The GZIP format optionally allows each file to have an associated - filename. When compressing data (through Write()), set this - FileName before calling Write() the first time on the GZipStream. - The actual filename is encoded into the GZIP bytestream with the - ISO-8859-1 code page, according to RFC 1952. It is the application's - responsibility to insure that the FileName can be encoded and decoded - correctly with this code page. - - - - When decompressing (through Read()), you can retrieve this value - any time after the first Read(). In the case where there was no filename - encoded into the GZIP bytestream, the property will return null (Nothing - in VB). - - - - - - The CRC on the GZIP stream. - - - This is used for internal error checking. You probably don't need to look at this property. - - - - - This property sets the flush behavior on the stream. - - - - - The size of the working buffer for the compression codec. - - - - - The working buffer is used for all stream operations. The default size is - 1024 bytes. The minimum size is 128 bytes. You may get better performance - with a larger buffer. Then again, you might not. You would have to test - it. - - - - Set this before the first call to Read() or Write() on the - stream. If you try to set it afterwards, it will throw. - - - - - Returns the total number of bytes input so far. - - - Returns the total number of bytes output so far. - - - - Indicates whether the stream can be read. - - - The return value depends on whether the captive stream supports reading. - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream can be written. - - - The return value depends on whether the captive stream supports writing. - - - - - Reading this property always throws a . - - - - - The position of the stream pointer. - - - - Setting this property always throws a . Reading will return the total bytes - written out, if used in writing, or the total bytes read in, if used in - reading. The count may refer to compressed bytes or uncompressed bytes, - depending on how you've used the stream. - - - - - A class for compressing streams using the - Deflate algorithm with multiple threads. - - - - - This class performs DEFLATE compression through writing. For - more information on the Deflate algorithm, see IETF RFC 1951, - "DEFLATE Compressed Data Format Specification version 1.3." - - - - This class is similar to , except - that this class is for compression only, and this implementation uses an - approach that employs multiple worker threads to perform the DEFLATE. On - a multi-cpu or multi-core computer, the performance of this class can be - significantly higher than the single-threaded DeflateStream, particularly - for larger streams. How large? Anything over 10mb is a good candidate - for parallel compression. - - - - The tradeoff is that this class uses more memory and more CPU than the - vanilla DeflateStream, and also is less efficient as a compressor. For - large files the size of the compressed data stream can be less than 1% - larger than the size of a compressed data stream from the vanialla - DeflateStream. For smaller files the difference can be larger. The - difference will also be larger if you set the BufferSize to be lower than - the default value. Your mileage may vary. Finally, for small files, the - ParallelDeflateOutputStream can be much slower than the vanilla - DeflateStream, because of the overhead associated to using the thread - pool. - - - - - - - - Create a ParallelDeflateOutputStream. - - - - - This stream compresses data written into it via the DEFLATE - algorithm (see RFC 1951), and writes out the compressed byte stream. - - - - The instance will use the default compression level, the default - buffer sizes and the default number of threads and buffers per - thread. - - - - This class is similar to , - except that this implementation uses an approach that employs - multiple worker threads to perform the DEFLATE. On a multi-cpu or - multi-core computer, the performance of this class can be - significantly higher than the single-threaded DeflateStream, - particularly for larger streams. How large? Anything over 10mb is - a good candidate for parallel compression. - - - - - - - This example shows how to use a ParallelDeflateOutputStream to compress - data. It reads a file, compresses it, and writes the compressed data to - a second, output file. - - - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n= -1; - String outputFile = fileToCompress + ".compressed"; - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(outputFile)) - { - using (Stream compressor = new ParallelDeflateOutputStream(raw)) - { - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Dim outputFile As String = (fileToCompress & ".compressed") - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(outputFile) - Using compressor As Stream = New ParallelDeflateOutputStream(raw) - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - The stream to which compressed data will be written. - - - - Create a ParallelDeflateOutputStream using the specified CompressionLevel. - - - See the - constructor for example code. - - The stream to which compressed data will be written. - A tuning knob to trade speed for effectiveness. - - - - Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open - when the ParallelDeflateOutputStream is closed. - - - See the - constructor for example code. - - The stream to which compressed data will be written. - - true if the application would like the stream to remain open after inflation/deflation. - - - - - Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open - when the ParallelDeflateOutputStream is closed. - - - See the - constructor for example code. - - The stream to which compressed data will be written. - A tuning knob to trade speed for effectiveness. - - true if the application would like the stream to remain open after inflation/deflation. - - - - - Create a ParallelDeflateOutputStream using the specified - CompressionLevel and CompressionStrategy, and specifying whether to - leave the captive stream open when the ParallelDeflateOutputStream is - closed. - - - See the - constructor for example code. - - The stream to which compressed data will be written. - A tuning knob to trade speed for effectiveness. - - By tweaking this parameter, you may be able to optimize the compression for - data with particular characteristics. - - - true if the application would like the stream to remain open after inflation/deflation. - - - - - Write data to the stream. - - - - - - To use the ParallelDeflateOutputStream to compress data, create a - ParallelDeflateOutputStream with CompressionMode.Compress, passing a - writable output stream. Then call Write() on that - ParallelDeflateOutputStream, providing uncompressed data as input. The - data sent to the output stream will be the compressed form of the data - written. - - - - To decompress data, use the class. - - - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Flush the stream. - - - - - Close the stream. - - - You must call Close on the stream to guarantee that all of the data written in has - been compressed, and the compressed data has been written out. - - - - Dispose the object - - - Because ParallelDeflateOutputStream is IDisposable, the - application must call this method when finished using the instance. - - - This method is generally called implicitly upon exit from - a using scope in C# (Using in VB). - - - - - The Dispose method - - indicates whether the Dispose method was invoked by user code. - - - - - Resets the stream for use with another stream. - - - Because the ParallelDeflateOutputStream is expensive to create, it - has been designed so that it can be recycled and re-used. You have - to call Close() on the stream first, then you can call Reset() on - it, to use it again on another stream. - - - - The new output stream for this era. - - - - - ParallelDeflateOutputStream deflater = null; - foreach (var inputFile in listOfFiles) - { - string outputFile = inputFile + ".compressed"; - using (System.IO.Stream input = System.IO.File.OpenRead(inputFile)) - { - using (var outStream = System.IO.File.Create(outputFile)) - { - if (deflater == null) - deflater = new ParallelDeflateOutputStream(outStream, - CompressionLevel.Best, - CompressionStrategy.Default, - true); - deflater.Reset(outStream); - - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - deflater.Write(buffer, 0, n); - } - } - } - } - - - - - - This method always throws a NotSupportedException. - - - The buffer into which data would be read, IF THIS METHOD - ACTUALLY DID ANYTHING. - - - The offset within that data array at which to insert the - data that is read, IF THIS METHOD ACTUALLY DID - ANYTHING. - - - The number of bytes to write, IF THIS METHOD ACTUALLY DID - ANYTHING. - - nothing. - - - - This method always throws a NotSupportedException. - - - The offset to seek to.... - IF THIS METHOD ACTUALLY DID ANYTHING. - - - The reference specifying how to apply the offset.... IF - THIS METHOD ACTUALLY DID ANYTHING. - - nothing. It always throws. - - - - This method always throws a NotSupportedException. - - - The new value for the stream length.... IF - THIS METHOD ACTUALLY DID ANYTHING. - - - - - The ZLIB strategy to be used during compression. - - - - - - The maximum number of buffer pairs to use. - - - - - This property sets an upper limit on the number of memory buffer - pairs to create. The implementation of this stream allocates - multiple buffers to facilitate parallel compression. As each buffer - fills up, this stream uses - ThreadPool.QueueUserWorkItem() - to compress those buffers in a background threadpool thread. After a - buffer is compressed, it is re-ordered and written to the output - stream. - - - - A higher number of buffer pairs enables a higher degree of - parallelism, which tends to increase the speed of compression on - multi-cpu computers. On the other hand, a higher number of buffer - pairs also implies a larger memory consumption, more active worker - threads, and a higher cpu utilization for any compression. This - property enables the application to limit its memory consumption and - CPU utilization behavior depending on requirements. - - - - For each compression "task" that occurs in parallel, there are 2 - buffers allocated: one for input and one for output. This property - sets a limit for the number of pairs. The total amount of storage - space allocated for buffering will then be (N*S*2), where N is the - number of buffer pairs, S is the size of each buffer (). By default, DotNetZip allocates 4 buffer - pairs per CPU core, so if your machine has 4 cores, and you retain - the default buffer size of 128k, then the - ParallelDeflateOutputStream will use 4 * 4 * 2 * 128kb of buffer - memory in total, or 4mb, in blocks of 128kb. If you then set this - property to 8, then the number will be 8 * 2 * 128kb of buffer - memory, or 2mb. - - - - CPU utilization will also go up with additional buffers, because a - larger number of buffer pairs allows a larger number of background - threads to compress in parallel. If you find that parallel - compression is consuming too much memory or CPU, you can adjust this - value downward. - - - - The default value is 16. Different values may deliver better or - worse results, depending on your priorities and the dynamic - performance characteristics of your storage and compute resources. - - - - This property is not the number of buffer pairs to use; it is an - upper limit. An illustration: Suppose you have an application that - uses the default value of this property (which is 16), and it runs - on a machine with 2 CPU cores. In that case, DotNetZip will allocate - 4 buffer pairs per CPU core, for a total of 8 pairs. The upper - limit specified by this property has no effect. - - - - The application can set this value at any time, but it is effective - only before the first call to Write(), which is when the buffers are - allocated. - - - - - - The size of the buffers used by the compressor threads. - - - - - The default buffer size is 128k. The application can set this value - at any time, but it is effective only before the first Write(). - - - - Larger buffer sizes implies larger memory consumption but allows - more efficient compression. Using smaller buffer sizes consumes less - memory but may result in less effective compression. For example, - using the default buffer size of 128k, the compression delivered is - within 1% of the compression delivered by the single-threaded . On the other hand, using a - BufferSize of 8k can result in a compressed data stream that is 5% - larger than that delivered by the single-threaded - DeflateStream. Excessively small buffer sizes can also cause - the speed of the ParallelDeflateOutputStream to drop, because of - larger thread scheduling overhead dealing with many many small - buffers. - - - - The total amount of storage space allocated for buffering will be - (N*S*2), where N is the number of buffer pairs, and S is the size of - each buffer (this property). There are 2 buffers used by the - compressor, one for input and one for output. By default, DotNetZip - allocates 4 buffer pairs per CPU core, so if your machine has 4 - cores, then the number of buffer pairs used will be 16. If you - accept the default value of this property, 128k, then the - ParallelDeflateOutputStream will use 16 * 2 * 128kb of buffer memory - in total, or 4mb, in blocks of 128kb. If you set this property to - 64kb, then the number will be 16 * 2 * 64kb of buffer memory, or - 2mb. - - - - - - - The CRC32 for the data that was written out, prior to compression. - - - This value is meaningful only after a call to Close(). - - - - - The total number of uncompressed bytes processed by the ParallelDeflateOutputStream. - - - This value is meaningful only after a call to Close(). - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream supports Read operations. - - - Always returns false. - - - - - Indicates whether the stream supports Write operations. - - - Returns true if the provided stream is writable. - - - - - Reading this property always throws a NotSupportedException. - - - - - Returns the current position of the output stream. - - - - Because the output gets written by a background thread, - the value may change asynchronously. Setting this - property always throws a NotSupportedException. - - - - - - Map from a distance to a distance code. - - - No side effects. _dist_code[256] and _dist_code[257] are never used. - - - - - Describes how to flush the current deflate operation. - - - The different FlushType values are useful when using a Deflate in a streaming application. - - - - No flush at all. - - - Closes the current block, but doesn't flush it to - the output. Used internally only in hypothetical - scenarios. This was supposed to be removed by Zlib, but it is - still in use in some edge cases. - - - - - Use this during compression to specify that all pending output should be - flushed to the output buffer and the output should be aligned on a byte - boundary. You might use this in a streaming communication scenario, so that - the decompressor can get all input data available so far. When using this - with a ZlibCodec, AvailableBytesIn will be zero after the call if - enough output space has been provided before the call. Flushing will - degrade compression and so it should be used only when necessary. - - - - - Use this during compression to specify that all output should be flushed, as - with FlushType.Sync, but also, the compression state should be reset - so that decompression can restart from this point if previous compressed - data has been damaged or if random access is desired. Using - FlushType.Full too often can significantly degrade the compression. - - - - Signals the end of the compression/decompression stream. - - - - The compression level to be used when using a DeflateStream or ZlibStream with CompressionMode.Compress. - - - - - None means that the data will be simply stored, with no change at all. - If you are producing ZIPs for use on Mac OSX, be aware that archives produced with CompressionLevel.None - cannot be opened with the default zip reader. Use a different CompressionLevel. - - - - - Same as None. - - - - - The fastest but least effective compression. - - - - - A synonym for BestSpeed. - - - - - A little slower, but better, than level 1. - - - - - A little slower, but better, than level 2. - - - - - A little slower, but better, than level 3. - - - - - A little slower than level 4, but with better compression. - - - - - The default compression level, with a good balance of speed and compression efficiency. - - - - - A synonym for Default. - - - - - Pretty good compression! - - - - - Better compression than Level7! - - - - - The "best" compression, where best means greatest reduction in size of the input data stream. - This is also the slowest compression. - - - - - A synonym for BestCompression. - - - - - Describes options for how the compression algorithm is executed. Different strategies - work better on different sorts of data. The strategy parameter can affect the compression - ratio and the speed of compression but not the correctness of the compresssion. - - - - - The default strategy is probably the best for normal data. - - - - - The Filtered strategy is intended to be used most effectively with data produced by a - filter or predictor. By this definition, filtered data consists mostly of small - values with a somewhat random distribution. In this case, the compression algorithm - is tuned to compress them better. The effect of Filtered is to force more Huffman - coding and less string matching; it is a half-step between Default and HuffmanOnly. - - - - - Using HuffmanOnly will force the compressor to do Huffman encoding only, with no - string matching. - - - - - An enum to specify the direction of transcoding - whether to compress or decompress. - - - - - Used to specify that the stream should compress the data. - - - - - Used to specify that the stream should decompress the data. - - - - - A general purpose exception class for exceptions in the Zlib library. - - - - - The ZlibException class captures exception information generated - by the Zlib library. - - - - - This ctor collects a message attached to the exception. - - the message for the exception. - - - - Performs an unsigned bitwise right shift with the specified number - - Number to operate on - Ammount of bits to shift - The resulting number from the shift operation - - - - Reads a number of characters from the current source TextReader and writes - the data to the target array at the specified index. - - - The source TextReader to read from - Contains the array of characteres read from the source TextReader. - The starting index of the target array. - The maximum number of characters to read from the source TextReader. - - - The number of characters read. The number will be less than or equal to - count depending on the data available in the source TextReader. Returns -1 - if the end of the stream is reached. - - - - - Computes an Adler-32 checksum. - - - The Adler checksum is similar to a CRC checksum, but faster to compute, though less - reliable. It is used in producing RFC1950 compressed streams. The Adler checksum - is a required part of the "ZLIB" standard. Applications will almost never need to - use this class directly. - - - - - - - Calculates the Adler32 checksum. - - - - This is used within ZLIB. You probably don't need to use this directly. - - - - To compute an Adler32 checksum on a byte array: - - var adler = Adler.Adler32(0, null, 0, 0); - adler = Adler.Adler32(adler, buffer, index, length); - - - - - - Encoder and Decoder for ZLIB and DEFLATE (IETF RFC1950 and RFC1951). - - - - This class compresses and decompresses data according to the Deflate algorithm - and optionally, the ZLIB format, as documented in RFC 1950 - ZLIB and RFC 1951 - DEFLATE. - - - - - The buffer from which data is taken. - - - - - An index into the InputBuffer array, indicating where to start reading. - - - - - The number of bytes available in the InputBuffer, starting at NextIn. - - - Generally you should set this to InputBuffer.Length before the first Inflate() or Deflate() call. - The class will update this number as calls to Inflate/Deflate are made. - - - - - Total number of bytes read so far, through all calls to Inflate()/Deflate(). - - - - - Buffer to store output data. - - - - - An index into the OutputBuffer array, indicating where to start writing. - - - - - The number of bytes available in the OutputBuffer, starting at NextOut. - - - Generally you should set this to OutputBuffer.Length before the first Inflate() or Deflate() call. - The class will update this number as calls to Inflate/Deflate are made. - - - - - Total number of bytes written to the output so far, through all calls to Inflate()/Deflate(). - - - - - used for diagnostics, when something goes wrong! - - - - - The compression level to use in this codec. Useful only in compression mode. - - - - - The number of Window Bits to use. - - - This gauges the size of the sliding window, and hence the - compression effectiveness as well as memory consumption. It's best to just leave this - setting alone if you don't know what it is. The maximum value is 15 bits, which implies - a 32k window. - - - - - The compression strategy to use. - - - This is only effective in compression. The theory offered by ZLIB is that different - strategies could potentially produce significant differences in compression behavior - for different data sets. Unfortunately I don't have any good recommendations for how - to set it differently. When I tested changing the strategy I got minimally different - compression performance. It's best to leave this property alone if you don't have a - good feel for it. Or, you may want to produce a test harness that runs through the - different strategy options and evaluates them on different file types. If you do that, - let me know your results. - - - - - Create a ZlibCodec. - - - If you use this default constructor, you will later have to explicitly call - InitializeInflate() or InitializeDeflate() before using the ZlibCodec to compress - or decompress. - - - - - Create a ZlibCodec that either compresses or decompresses. - - - Indicates whether the codec should compress (deflate) or decompress (inflate). - - - - - Initialize the inflation state. - - - It is not necessary to call this before using the ZlibCodec to inflate data; - It is implicitly called when you call the constructor. - - Z_OK if everything goes well. - - - - Initialize the inflation state with an explicit flag to - govern the handling of RFC1950 header bytes. - - - - By default, the ZLIB header defined in RFC 1950 is expected. If - you want to read a zlib stream you should specify true for - expectRfc1950Header. If you have a deflate stream, you will want to specify - false. It is only necessary to invoke this initializer explicitly if you - want to specify false. - - - whether to expect an RFC1950 header byte - pair when reading the stream of data to be inflated. - - Z_OK if everything goes well. - - - - Initialize the ZlibCodec for inflation, with the specified number of window bits. - - The number of window bits to use. If you need to ask what that is, - then you shouldn't be calling this initializer. - Z_OK if all goes well. - - - - Initialize the inflation state with an explicit flag to govern the handling of - RFC1950 header bytes. - - - - If you want to read a zlib stream you should specify true for - expectRfc1950Header. In this case, the library will expect to find a ZLIB - header, as defined in RFC - 1950, in the compressed stream. If you will be reading a DEFLATE or - GZIP stream, which does not have such a header, you will want to specify - false. - - - whether to expect an RFC1950 header byte pair when reading - the stream of data to be inflated. - The number of window bits to use. If you need to ask what that is, - then you shouldn't be calling this initializer. - Z_OK if everything goes well. - - - - Inflate the data in the InputBuffer, placing the result in the OutputBuffer. - - - You must have set InputBuffer and OutputBuffer, NextIn and NextOut, and AvailableBytesIn and - AvailableBytesOut before calling this method. - - - - private void InflateBuffer() - { - int bufferSize = 1024; - byte[] buffer = new byte[bufferSize]; - ZlibCodec decompressor = new ZlibCodec(); - - Console.WriteLine("\n============================================"); - Console.WriteLine("Size of Buffer to Inflate: {0} bytes.", CompressedBytes.Length); - MemoryStream ms = new MemoryStream(DecompressedBytes); - - int rc = decompressor.InitializeInflate(); - - decompressor.InputBuffer = CompressedBytes; - decompressor.NextIn = 0; - decompressor.AvailableBytesIn = CompressedBytes.Length; - - decompressor.OutputBuffer = buffer; - - // pass 1: inflate - do - { - decompressor.NextOut = 0; - decompressor.AvailableBytesOut = buffer.Length; - rc = decompressor.Inflate(FlushType.None); - - if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) - throw new Exception("inflating: " + decompressor.Message); - - ms.Write(decompressor.OutputBuffer, 0, buffer.Length - decompressor.AvailableBytesOut); - } - while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); - - // pass 2: finish and flush - do - { - decompressor.NextOut = 0; - decompressor.AvailableBytesOut = buffer.Length; - rc = decompressor.Inflate(FlushType.Finish); - - if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) - throw new Exception("inflating: " + decompressor.Message); - - if (buffer.Length - decompressor.AvailableBytesOut > 0) - ms.Write(buffer, 0, buffer.Length - decompressor.AvailableBytesOut); - } - while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); - - decompressor.EndInflate(); - } - - - - The flush to use when inflating. - Z_OK if everything goes well. - - - - Ends an inflation session. - - - Call this after successively calling Inflate(). This will cause all buffers to be flushed. - After calling this you cannot call Inflate() without a intervening call to one of the - InitializeInflate() overloads. - - Z_OK if everything goes well. - - - - I don't know what this does! - - Z_OK if everything goes well. - - - - Initialize the ZlibCodec for deflation operation. - - - The codec will use the MAX window bits and the default level of compression. - - - - int bufferSize = 40000; - byte[] CompressedBytes = new byte[bufferSize]; - byte[] DecompressedBytes = new byte[bufferSize]; - - ZlibCodec compressor = new ZlibCodec(); - - compressor.InitializeDeflate(CompressionLevel.Default); - - compressor.InputBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); - compressor.NextIn = 0; - compressor.AvailableBytesIn = compressor.InputBuffer.Length; - - compressor.OutputBuffer = CompressedBytes; - compressor.NextOut = 0; - compressor.AvailableBytesOut = CompressedBytes.Length; - - while (compressor.TotalBytesIn != TextToCompress.Length && compressor.TotalBytesOut < bufferSize) - { - compressor.Deflate(FlushType.None); - } - - while (true) - { - int rc= compressor.Deflate(FlushType.Finish); - if (rc == ZlibConstants.Z_STREAM_END) break; - } - - compressor.EndDeflate(); - - - - Z_OK if all goes well. You generally don't need to check the return code. - - - - Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel. - - - The codec will use the maximum window bits (15) and the specified - CompressionLevel. It will emit a ZLIB stream as it compresses. - - The compression level for the codec. - Z_OK if all goes well. - - - - Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, - and the explicit flag governing whether to emit an RFC1950 header byte pair. - - - The codec will use the maximum window bits (15) and the specified CompressionLevel. - If you want to generate a zlib stream, you should specify true for - wantRfc1950Header. In this case, the library will emit a ZLIB - header, as defined in RFC - 1950, in the compressed stream. - - The compression level for the codec. - whether to emit an initial RFC1950 byte pair in the compressed stream. - Z_OK if all goes well. - - - - Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, - and the specified number of window bits. - - - The codec will use the specified number of window bits and the specified CompressionLevel. - - The compression level for the codec. - the number of window bits to use. If you don't know what this means, don't use this method. - Z_OK if all goes well. - - - - Initialize the ZlibCodec for deflation operation, using the specified - CompressionLevel, the specified number of window bits, and the explicit flag - governing whether to emit an RFC1950 header byte pair. - - - The compression level for the codec. - whether to emit an initial RFC1950 byte pair in the compressed stream. - the number of window bits to use. If you don't know what this means, don't use this method. - Z_OK if all goes well. - - - - Deflate one batch of data. - - - You must have set InputBuffer and OutputBuffer before calling this method. - - - - private void DeflateBuffer(CompressionLevel level) - { - int bufferSize = 1024; - byte[] buffer = new byte[bufferSize]; - ZlibCodec compressor = new ZlibCodec(); - - Console.WriteLine("\n============================================"); - Console.WriteLine("Size of Buffer to Deflate: {0} bytes.", UncompressedBytes.Length); - MemoryStream ms = new MemoryStream(); - - int rc = compressor.InitializeDeflate(level); - - compressor.InputBuffer = UncompressedBytes; - compressor.NextIn = 0; - compressor.AvailableBytesIn = UncompressedBytes.Length; - - compressor.OutputBuffer = buffer; - - // pass 1: deflate - do - { - compressor.NextOut = 0; - compressor.AvailableBytesOut = buffer.Length; - rc = compressor.Deflate(FlushType.None); - - if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) - throw new Exception("deflating: " + compressor.Message); - - ms.Write(compressor.OutputBuffer, 0, buffer.Length - compressor.AvailableBytesOut); - } - while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); - - // pass 2: finish and flush - do - { - compressor.NextOut = 0; - compressor.AvailableBytesOut = buffer.Length; - rc = compressor.Deflate(FlushType.Finish); - - if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) - throw new Exception("deflating: " + compressor.Message); - - if (buffer.Length - compressor.AvailableBytesOut > 0) - ms.Write(buffer, 0, buffer.Length - compressor.AvailableBytesOut); - } - while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); - - compressor.EndDeflate(); - - ms.Seek(0, SeekOrigin.Begin); - CompressedBytes = new byte[compressor.TotalBytesOut]; - ms.Read(CompressedBytes, 0, CompressedBytes.Length); - } - - - whether to flush all data as you deflate. Generally you will want to - use Z_NO_FLUSH here, in a series of calls to Deflate(), and then call EndDeflate() to - flush everything. - - Z_OK if all goes well. - - - - End a deflation session. - - - Call this after making a series of one or more calls to Deflate(). All buffers are flushed. - - Z_OK if all goes well. - - - - Reset a codec for another deflation session. - - - Call this to reset the deflation state. For example if a thread is deflating - non-consecutive blocks, you can call Reset() after the Deflate(Sync) of the first - block and before the next Deflate(None) of the second block. - - Z_OK if all goes well. - - - - Set the CompressionStrategy and CompressionLevel for a deflation session. - - the level of compression to use. - the strategy to use for compression. - Z_OK if all goes well. - - - - Set the dictionary to be used for either Inflation or Deflation. - - The dictionary bytes to use. - Z_OK if all goes well. - - - - The Adler32 checksum on the data transferred through the codec so far. You probably don't need to look at this. - - - - - A bunch of constants used in the Zlib interface. - - - - - The maximum number of window bits for the Deflate algorithm. - - - - - The default number of window bits for the Deflate algorithm. - - - - - indicates everything is A-OK - - - - - Indicates that the last operation reached the end of the stream. - - - - - The operation ended in need of a dictionary. - - - - - There was an error with the stream - not enough data, not open and readable, etc. - - - - - There was an error with the data - not enough data, bad data, etc. - - - - - There was an error with the working buffer. - - - - - The size of the working buffer used in the ZlibCodec class. Defaults to 8192 bytes. - - - - - The minimum size of the working buffer used in the ZlibCodec class. Currently it is 128 bytes. - - - - - Represents a Zlib stream for compression or decompression. - - - - - The ZlibStream is a Decorator on a . It adds ZLIB compression or decompression to any - stream. - - - Using this stream, applications can compress or decompress data via - stream Read() and Write() operations. Either compresssion or - decompression can occur through either reading or writing. The compression - format used is ZLIB, which is documented in IETF RFC 1950, "ZLIB Compressed - Data Format Specification version 3.3". This implementation of ZLIB always uses - DEFLATE as the compression method. (see IETF RFC 1951, "DEFLATE - Compressed Data Format Specification version 1.3.") - - - The ZLIB format allows for varying compression methods, window sizes, and dictionaries. - This implementation always uses the DEFLATE compression method, a preset dictionary, - and 15 window bits by default. - - - - This class is similar to , except that it adds the - RFC1950 header and trailer bytes to a compressed stream when compressing, or expects - the RFC1950 header and trailer bytes when decompressing. It is also similar to the - . - - - - - - - - Create a ZlibStream using the specified CompressionMode. - - - - - When mode is CompressionMode.Compress, the ZlibStream - will use the default compression level. The "captive" stream will be - closed when the ZlibStream is closed. - - - - - - This example uses a ZlibStream to compress a file, and writes the - compressed data to another file. - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) - { - using (Stream compressor = new ZlibStream(raw, CompressionMode.Compress)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(fileToCompress & ".zlib") - Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - - The stream which will be read or written. - Indicates whether the ZlibStream will compress or decompress. - - - - Create a ZlibStream using the specified CompressionMode and - the specified CompressionLevel. - - - - - - When mode is CompressionMode.Decompress, the level parameter is ignored. - The "captive" stream will be closed when the ZlibStream is closed. - - - - - - This example uses a ZlibStream to compress data from a file, and writes the - compressed data to another file. - - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) - { - using (Stream compressor = new ZlibStream(raw, - CompressionMode.Compress, - CompressionLevel.BestCompression)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(fileToCompress & ".zlib") - Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - - The stream to be read or written while deflating or inflating. - Indicates whether the ZlibStream will compress or decompress. - A tuning knob to trade speed for effectiveness. - - - - Create a ZlibStream using the specified CompressionMode, and - explicitly specify whether the captive stream should be left open after - Deflation or Inflation. - - - - - - When mode is CompressionMode.Compress, the ZlibStream will use - the default compression level. - - - - This constructor allows the application to request that the captive stream - remain open after the deflation or inflation occurs. By default, after - Close() is called on the stream, the captive stream is also - closed. In some cases this is not desired, for example if the stream is a - that will be re-read after - compression. Specify true for the parameter to leave the stream - open. - - - - See the other overloads of this constructor for example code. - - - - - The stream which will be read or written. This is called the - "captive" stream in other places in this documentation. - Indicates whether the ZlibStream will compress or decompress. - true if the application would like the stream to remain - open after inflation/deflation. - - - - Create a ZlibStream using the specified CompressionMode - and the specified CompressionLevel, and explicitly specify - whether the stream should be left open after Deflation or Inflation. - - - - - - This constructor allows the application to request that the captive - stream remain open after the deflation or inflation occurs. By - default, after Close() is called on the stream, the captive - stream is also closed. In some cases this is not desired, for example - if the stream is a that will be - re-read after compression. Specify true for the parameter to leave the stream open. - - - - When mode is CompressionMode.Decompress, the level parameter is - ignored. - - - - - - - This example shows how to use a ZlibStream to compress the data from a file, - and store the result into another file. The filestream remains open to allow - additional data to be written to it. - - - using (var output = System.IO.File.Create(fileToCompress + ".zlib")) - { - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (Stream compressor = new ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - // can write additional data to the output stream here - } - - - Using output As FileStream = File.Create(fileToCompress & ".zlib") - Using input As Stream = File.OpenRead(fileToCompress) - Using compressor As Stream = New ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - ' can write additional data to the output stream here. - End Using - - - - The stream which will be read or written. - - Indicates whether the ZlibStream will compress or decompress. - - - true if the application would like the stream to remain open after - inflation/deflation. - - - - A tuning knob to trade speed for effectiveness. This parameter is - effective only when mode is CompressionMode.Compress. - - - - - Dispose the stream. - - - - This may or may not result in a Close() call on the captive - stream. See the constructors that have a leaveOpen parameter - for more information. - - - This method may be invoked in two distinct scenarios. If disposing - == true, the method has been called directly or indirectly by a - user's code, for example via the public Dispose() method. In this - case, both managed and unmanaged resources can be referenced and - disposed. If disposing == false, the method has been called by the - runtime from inside the object finalizer and this method should not - reference other objects; in that case only unmanaged resources must - be referenced or disposed. - - - - indicates whether the Dispose method was invoked by user code. - - - - - Flush the stream. - - - - - Read data from the stream. - - - - - - If you wish to use the ZlibStream to compress data while reading, - you can create a ZlibStream with CompressionMode.Compress, - providing an uncompressed data stream. Then call Read() on that - ZlibStream, and the data read will be compressed. If you wish to - use the ZlibStream to decompress data while reading, you can create - a ZlibStream with CompressionMode.Decompress, providing a - readable compressed data stream. Then call Read() on that - ZlibStream, and the data will be decompressed as it is read. - - - - A ZlibStream can be used for Read() or Write(), but - not both. - - - - - - The buffer into which the read data should be placed. - - - the offset within that data array to put the first byte read. - - the number of bytes to read. - - the number of bytes read - - - - Calling this method always throws a . - - - The offset to seek to.... - IF THIS METHOD ACTUALLY DID ANYTHING. - - - The reference specifying how to apply the offset.... IF - THIS METHOD ACTUALLY DID ANYTHING. - - - nothing. This method always throws. - - - - Calling this method always throws a . - - - The new value for the stream length.... IF - THIS METHOD ACTUALLY DID ANYTHING. - - - - - Write data to the stream. - - - - - - If you wish to use the ZlibStream to compress data while writing, - you can create a ZlibStream with CompressionMode.Compress, - and a writable output stream. Then call Write() on that - ZlibStream, providing uncompressed data as input. The data sent to - the output stream will be the compressed form of the data written. If you - wish to use the ZlibStream to decompress data while writing, you - can create a ZlibStream with CompressionMode.Decompress, and a - writable output stream. Then call Write() on that stream, - providing previously compressed data. The data sent to the output stream - will be the decompressed form of the data written. - - - - A ZlibStream can be used for Read() or Write(), but not both. - - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Compress a string into a byte array using ZLIB. - - - - Uncompress it with . - - - - - - - - A string to compress. The string will first be encoded - using UTF8, then compressed. - - - The string in compressed form - - - - Compress a byte array into a new byte array using ZLIB. - - - - Uncompress it with . - - - - - - - A buffer to compress. - - - The data in compressed form - - - - Uncompress a ZLIB-compressed byte array into a single string. - - - - - - - A buffer containing ZLIB-compressed data. - - - The uncompressed string - - - - Uncompress a ZLIB-compressed byte array into a byte array. - - - - - - - A buffer containing ZLIB-compressed data. - - - The data in uncompressed form - - - - This property sets the flush behavior on the stream. - Sorry, though, not sure exactly how to describe all the various settings. - - - - - The size of the working buffer for the compression codec. - - - - - The working buffer is used for all stream operations. The default size is - 1024 bytes. The minimum size is 128 bytes. You may get better performance - with a larger buffer. Then again, you might not. You would have to test - it. - - - - Set this before the first call to Read() or Write() on the - stream. If you try to set it afterwards, it will throw. - - - - - Returns the total number of bytes input so far. - - - Returns the total number of bytes output so far. - - - - Indicates whether the stream can be read. - - - The return value depends on whether the captive stream supports reading. - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream can be written. - - - The return value depends on whether the captive stream supports writing. - - - - - Reading this property always throws a . - - - - - The position of the stream pointer. - - - - Setting this property always throws a . Reading will return the total bytes - written out, if used in writing, or the total bytes read in, if used in - reading. The count may refer to compressed bytes or uncompressed bytes, - depending on how you've used the stream. - - - - - Computes a CRC-32. The CRC-32 algorithm is parameterized - you - can set the polynomial and enable or disable bit - reversal. This can be used for GZIP, BZip2, or ZIP. - - - This type is used internally by DotNetZip; it is generally not used - directly by applications wishing to create, read, or manipulate zip - archive files. - - - - - Returns the CRC32 for the specified stream. - - The stream over which to calculate the CRC32 - the CRC32 calculation - - - - Returns the CRC32 for the specified stream, and writes the input into the - output stream. - - The stream over which to calculate the CRC32 - The stream into which to deflate the input - the CRC32 calculation - - - - Get the CRC32 for the given (word,byte) combo. This is a - computation defined by PKzip for PKZIP 2.0 (weak) encryption. - - The word to start with. - The byte to combine it with. - The CRC-ized result. - - - - Update the value for the running CRC32 using the given block of bytes. - This is useful when using the CRC32() class in a Stream. - - block of bytes to slurp - starting point in the block - how many bytes within the block to slurp - - - - Process one byte in the CRC. - - the byte to include into the CRC . - - - - Process a run of N identical bytes into the CRC. - - - - This method serves as an optimization for updating the CRC when a - run of identical bytes is found. Rather than passing in a buffer of - length n, containing all identical bytes b, this method accepts the - byte value and the length of the (virtual) buffer - the length of - the run. - - - the byte to include into the CRC. - the number of times that byte should be repeated. - - - - Combines the given CRC32 value with the current running total. - - - This is useful when using a divide-and-conquer approach to - calculating a CRC. Multiple threads can each calculate a - CRC32 on a segment of the data, and then combine the - individual CRC32 values at the end. - - the crc value to be combined with this one - the length of data the CRC value was calculated on - - - - Create an instance of the CRC32 class using the default settings: no - bit reversal, and a polynomial of 0xEDB88320. - - - - - Create an instance of the CRC32 class, specifying whether to reverse - data bits or not. - - - specify true if the instance should reverse data bits. - - - - In the CRC-32 used by BZip2, the bits are reversed. Therefore if you - want a CRC32 with compatibility with BZip2, you should pass true - here. In the CRC-32 used by GZIP and PKZIP, the bits are not - reversed; Therefore if you want a CRC32 with compatibility with - those, you should pass false. - - - - - - Create an instance of the CRC32 class, specifying the polynomial and - whether to reverse data bits or not. - - - The polynomial to use for the CRC, expressed in the reversed (LSB) - format: the highest ordered bit in the polynomial value is the - coefficient of the 0th power; the second-highest order bit is the - coefficient of the 1 power, and so on. Expressed this way, the - polynomial for the CRC-32C used in IEEE 802.3, is 0xEDB88320. - - - specify true if the instance should reverse data bits. - - - - - In the CRC-32 used by BZip2, the bits are reversed. Therefore if you - want a CRC32 with compatibility with BZip2, you should pass true - here for the reverseBits parameter. In the CRC-32 used by - GZIP and PKZIP, the bits are not reversed; Therefore if you want a - CRC32 with compatibility with those, you should pass false for the - reverseBits parameter. - - - - - - Reset the CRC-32 class - clear the CRC "remainder register." - - - - Use this when employing a single instance of this class to compute - multiple, distinct CRCs on multiple, distinct data blocks. - - - - - - Indicates the total number of bytes applied to the CRC. - - - - - Indicates the current CRC for all blocks slurped in. - - - - - A Stream that calculates a CRC32 (a checksum) on all bytes read, - or on all bytes written. - - - - - This class can be used to verify the CRC of a ZipEntry when - reading from a stream, or to calculate a CRC when writing to a - stream. The stream should be used to either read, or write, but - not both. If you intermix reads and writes, the results are not - defined. - - - - This class is intended primarily for use internally by the - DotNetZip library. - - - - - - The default constructor. - - - - Instances returned from this constructor will leave the underlying - stream open upon Close(). The stream uses the default CRC32 - algorithm, which implies a polynomial of 0xEDB88320. - - - The underlying stream - - - - The constructor allows the caller to specify how to handle the - underlying stream at close. - - - - The stream uses the default CRC32 algorithm, which implies a - polynomial of 0xEDB88320. - - - The underlying stream - true to leave the underlying stream - open upon close of the CrcCalculatorStream; false otherwise. - - - - A constructor allowing the specification of the length of the stream - to read. - - - - The stream uses the default CRC32 algorithm, which implies a - polynomial of 0xEDB88320. - - - Instances returned from this constructor will leave the underlying - stream open upon Close(). - - - The underlying stream - The length of the stream to slurp - - - - A constructor allowing the specification of the length of the stream - to read, as well as whether to keep the underlying stream open upon - Close(). - - - - The stream uses the default CRC32 algorithm, which implies a - polynomial of 0xEDB88320. - - - The underlying stream - The length of the stream to slurp - true to leave the underlying stream - open upon close of the CrcCalculatorStream; false otherwise. - - - - A constructor allowing the specification of the length of the stream - to read, as well as whether to keep the underlying stream open upon - Close(), and the CRC32 instance to use. - - - - The stream uses the specified CRC32 instance, which allows the - application to specify how the CRC gets calculated. - - - The underlying stream - The length of the stream to slurp - true to leave the underlying stream - open upon close of the CrcCalculatorStream; false otherwise. - the CRC32 instance to use to calculate the CRC32 - - - - Read from the stream - - the buffer to read - the offset at which to start - the number of bytes to read - the number of bytes actually read - - - - Write to the stream. - - the buffer from which to write - the offset at which to start writing - the number of bytes to write - - - - Flush the stream. - - - - - Seeking is not supported on this stream. This method always throws - - - N/A - N/A - N/A - - - - This method always throws - - - N/A - - - - Closes the stream. - - - - - Gets the total number of bytes run through the CRC32 calculator. - - - - This is either the total number of bytes read, or the total number of - bytes written, depending on the direction of this stream. - - - - - Provides the current CRC for all blocks slurped in. - - - - The running total of the CRC is kept as data is written or read - through the stream. read this property after all reads or writes to - get an accurate CRC for the entire stream. - - - - - - Indicates whether the underlying stream will be left open when the - CrcCalculatorStream is Closed. - - - - Set this at any point before calling . - - - - - - Indicates whether the stream supports reading. - - - - - Indicates whether the stream supports seeking. - - - - Always returns false. - - - - - - Indicates whether the stream supports writing. - - - - - Returns the length of the underlying stream. - - - - - The getter for this property returns the total bytes read. - If you use the setter, it will throw - . - - -
-
diff --git a/lib/dotnetzip/License.txt b/lib/dotnetzip/License.txt deleted file mode 100644 index c3103fd07de..00000000000 --- a/lib/dotnetzip/License.txt +++ /dev/null @@ -1,33 +0,0 @@ -Microsoft Public License (Ms-PL) - -This license governs use of the accompanying software, the DotNetZip library ("the software"). If you use the software, you accept this license. If you do not accept the license, do not use the software. - -1. Definitions - -The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. - -A "contribution" is the original software, or any additions or changes to the software. - -A "contributor" is any person that distributes its contribution under this license. - -"Licensed patents" are a contributor's patent claims that read directly on its contribution. - -2. Grant of Rights - -(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. - -(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. - -3. Conditions and Limitations - -(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. - -(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. - -(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. - -(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. - -(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. - - diff --git a/lib/fluentpath/FluentPath.dll b/lib/fluentpath/FluentPath.dll deleted file mode 100644 index 4fdcdf49755..00000000000 Binary files a/lib/fluentpath/FluentPath.dll and /dev/null differ diff --git a/lib/fluentpath/license.txt b/lib/fluentpath/license.txt deleted file mode 100644 index a7380237913..00000000000 --- a/lib/fluentpath/license.txt +++ /dev/null @@ -1,23 +0,0 @@ -Microsoft Public License (Ms-PL) - - -This license governs use of the accompanying software. If you use the software, you -accept this license. If you do not accept the license, do not use the software. - -1. Definitions -The terms "reproduce," "reproduction," "derivative works," and "distribution" have the -same meaning here as under U.S. copyright law. -A "contribution" is the original software, or any additions or changes to the software. -A "contributor" is any person that distributes its contribution under this license. -"Licensed patents" are a contributor's patent claims that read directly on its contribution. - -2. Grant of Rights -(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. -(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. - -3. Conditions and Limitations -(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. -(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. -(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. -(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. -(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. \ No newline at end of file diff --git a/lib/historyjs/history.js b/lib/historyjs/history.js deleted file mode 100644 index 814c2d74bad..00000000000 --- a/lib/historyjs/history.js +++ /dev/null @@ -1 +0,0 @@ -(function(e,t){"use strict";var n=e.console||t,r=e.document,i=e.navigator,s=e.sessionStorage||!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.History=e.History||{},p=e.history;try{s.setItem("TEST","1"),s.removeItem("TEST")}catch(d){s=!1}l.stringify=l.stringify||l.encode,l.parse=l.parse||l.decode;if(typeof h.init!="undefined")throw new Error("History.js Core has already been loaded...");h.init=function(e){return typeof h.Adapter=="undefined"?!1:(typeof h.initCore!="undefined"&&h.initCore(),typeof h.initHtml4!="undefined"&&h.initHtml4(),!0)},h.initCore=function(d){if(typeof h.initCore.initialized!="undefined")return!1;h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.disableSuid=h.options.disableSuid||!1,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||r.title,h.options.html4Mode=h.options.html4Mode||!1,h.options.delayInit=h.options.delayInit||!1,h.intervalList=[],h.clearAllIntervals=function(){var e,t=h.intervalList;if(typeof t!="undefined"&&t!==null){for(e=0;e")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||h.getLocationHref(),n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.getLocationHref=function(e){return e=e||r,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:e.URL.indexOf("#")==-1&&e.location.href.indexOf("#")!=-1?e.location.href:e.URL||e.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};return t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(e.url?e.url:h.getLocationHref()),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data),(t.title||n)&&h.options.disableSuid!==!0&&(t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r,i;return e.indexOf("#")!=-1?i=e.split("#")[0]:i=e,n=/(.*)\&_suid=([0-9]+)$/.exec(i),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getCurrentIndex=function(){var e=null;return h.savedStates.length<1?e=0:e=h.savedStates.length-1,e},h.getHash=function(e){var t=h.getLocationHref(e),n;return n=h.getHashByUrl(t),n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=decodeURIComponent(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(h.busy(!0),n=h.extractState(e,!0),n&&!h.emulated.pushState?h.pushState(n.data,n.title,n.url,!1):h.getHash()!==e&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+e,!1)):r.location.hash=e),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.encodeURIComponent(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","<").replace(">",">").replace(" & "," & ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(h.getLocationHref()),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var v=function(){};h.pushState=h.pushState||v,h.replaceState=h.replaceState||v}else h.onPopState=function(t,n){var r=!1,i=!1,s,o;return h.doubleCheckComplete(),s=h.getHash(),s?(o=h.extractState(s||h.getLocationHref(),!0),o?h.replaceState(o.data,o.title,o.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",t,n)||!1,r?i=h.getStateById(r):h.expectedStateId?i=h.getStateById(h.expectedStateId):i=h.extractState(h.getLocationHref()),i||(i=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(i)?(h.busy(!1),!1):(h.storeState(i),h.saveState(i),h.setTitle(i),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(m){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),s&&(h.onUnload=function(){var e,t,n;try{e=l.parse(s.getItem("History.store"))||{}}catch(r){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),n=l.stringify(e);try{s.setItem("History.store",n)}catch(i){if(i.code!==DOMException.QUOTA_EXCEEDED_ERR)throw i;s.length&&(s.removeItem("History.store"),s.setItem("History.store",n))}},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},(!h.options||!h.options.delayInit)&&h.init()})(window) \ No newline at end of file diff --git a/lib/historyjs/license.txt b/lib/historyjs/license.txt deleted file mode 100644 index 647bfd26d49..00000000000 --- a/lib/historyjs/license.txt +++ /dev/null @@ -1,10 +0,0 @@ -Copyright (c) 2011, Benjamin Arthur Lupton -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - • 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. - • Neither the name of Benjamin Arthur Lupton nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS 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. \ No newline at end of file diff --git a/lib/html5shim/html5.js b/lib/html5shim/html5.js deleted file mode 100644 index 852646e46ac..00000000000 --- a/lib/html5shim/html5.js +++ /dev/null @@ -1,3 +0,0 @@ -// html5shiv MIT @rem remysharp.com/html5-enabling-script -// iepp v1.5.1 MIT @jon_neal iecss.com/print-protector -/*@cc_on(function(p,e){var q=e.createElement("div");q.innerHTML="i";q.childNodes.length!==1&&function(){function r(a,b){if(g[a])g[a].styleSheet.cssText+=b;else{var c=s[l],d=e[j]("style");d.media=a;c.insertBefore(d,c[l]);g[a]=d;r(a,b)}}function t(a,b){for(var c=new RegExp("\\b("+m+")\\b(?!.*[;}])","gi"),d=function(k){return".iepp_"+k},h=-1;++h\\s*$","i");i.innerHTML=a.outerHTML.replace(/\r|\n/g," ").replace(c,a.currentStyle.display=="block"?"":"");c=i.childNodes[0];c.className+=" iepp_"+d;c=f[f.length]=[a,c];a.parentNode.replaceChild(c[1],c[0])}t(e.styleSheets,"all")});p.attachEvent("onafterprint",function(){for(var a=-1,b;++a - - - HtmlAgilityPack - - - - - Represents an HTML navigator on an HTML document seen as a data store. - - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - Indicates whether to look for byte order marks at the beginning of the stream. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - The character encoding to use. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the stream. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the stream. - The minimum buffer size. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a TextReader. - - The TextReader used to feed the HTML data into the document. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - The character encoding to use. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size. - - - - Creates a new HtmlNavigator positioned at the same node as this HtmlNavigator. - - A new HtmlNavigator object positioned at the same node as the original HtmlNavigator. - - - - Gets the value of the HTML attribute with the specified LocalName and NamespaceURI. - - The local name of the HTML attribute. - The namespace URI of the attribute. Unsupported with the HtmlNavigator implementation. - The value of the specified HTML attribute. String.Empty or null if a matching attribute is not found or if the navigator is not positioned on an element node. - - - - Returns the value of the namespace node corresponding to the specified local name. - Always returns string.Empty for the HtmlNavigator implementation. - - The local name of the namespace node. - Always returns string.Empty for the HtmlNavigator implementation. - - - - Determines whether the current HtmlNavigator is at the same position as the specified HtmlNavigator. - - The HtmlNavigator that you want to compare against. - true if the two navigators have the same position, otherwise, false. - - - - Moves to the same position as the specified HtmlNavigator. - - The HtmlNavigator positioned on the node that you want to move to. - true if successful, otherwise false. If false, the position of the navigator is unchanged. - - - - Moves to the HTML attribute with matching LocalName and NamespaceURI. - - The local name of the HTML attribute. - The namespace URI of the attribute. Unsupported with the HtmlNavigator implementation. - true if the HTML attribute is found, otherwise, false. If false, the position of the navigator does not change. - - - - Moves to the first sibling of the current node. - - true if the navigator is successful moving to the first sibling node, false if there is no first sibling or if the navigator is currently positioned on an attribute node. - - - - Moves to the first HTML attribute. - - true if the navigator is successful moving to the first HTML attribute, otherwise, false. - - - - Moves to the first child of the current node. - - true if there is a first child node, otherwise false. - - - - Moves the XPathNavigator to the first namespace node of the current element. - Always returns false for the HtmlNavigator implementation. - - An XPathNamespaceScope value describing the namespace scope. - Always returns false for the HtmlNavigator implementation. - - - - Moves to the node that has an attribute of type ID whose value matches the specified string. - - A string representing the ID value of the node to which you want to move. This argument does not need to be atomized. - true if the move was successful, otherwise false. If false, the position of the navigator is unchanged. - - - - Moves the XPathNavigator to the namespace node with the specified local name. - Always returns false for the HtmlNavigator implementation. - - The local name of the namespace node. - Always returns false for the HtmlNavigator implementation. - - - - Moves to the next sibling of the current node. - - true if the navigator is successful moving to the next sibling node, false if there are no more siblings or if the navigator is currently positioned on an attribute node. If false, the position of the navigator is unchanged. - - - - Moves to the next HTML attribute. - - - - - - Moves the XPathNavigator to the next namespace node. - Always returns falsefor the HtmlNavigator implementation. - - An XPathNamespaceScope value describing the namespace scope. - Always returns false for the HtmlNavigator implementation. - - - - Moves to the parent of the current node. - - true if there is a parent node, otherwise false. - - - - Moves to the previous sibling of the current node. - - true if the navigator is successful moving to the previous sibling node, false if there is no previous sibling or if the navigator is currently positioned on an attribute node. - - - - Moves to the root node to which the current node belongs. - - - - - Gets the base URI for the current node. - Always returns string.Empty in the case of HtmlNavigator implementation. - - - - - Gets the current HTML document. - - - - - Gets the current HTML node. - - - - - Gets a value indicating whether the current node has child nodes. - - - - - Gets a value indicating whether the current node has child nodes. - - - - - Gets a value indicating whether the current node is an empty element. - - - - - Gets the name of the current HTML node without the namespace prefix. - - - - - Gets the qualified name of the current node. - - - - - Gets the namespace URI (as defined in the W3C Namespace Specification) of the current node. - Always returns string.Empty in the case of HtmlNavigator implementation. - - - - - Gets the associated with this implementation. - - - - - Gets the type of the current node. - - - - - Gets the prefix associated with the current node. - Always returns string.Empty in the case of HtmlNavigator implementation. - - - - - Gets the text value of the current node. - - - - - Gets the xml:lang scope for the current node. - Always returns string.Empty in the case of HtmlNavigator implementation. - - - - - Represents a complete HTML document. - - - - - Adds Debugging attributes to node. Default is false. - - - - - Defines if closing for non closed nodes must be done at the end or directly in the document. - Setting this to true can actually change how browsers render the page. Default is false. - - - - - Defines if non closed nodes will be checked at the end of parsing. Default is true. - - - - - Defines if a checksum must be computed for the document while parsing. Default is false. - - - - - Defines the default stream encoding to use. Default is System.Text.Encoding.Default. - - - - - Defines if source text must be extracted while parsing errors. - If the document has a lot of errors, or cascading errors, parsing performance can be dramatically affected if set to true. - Default is false. - - - - - Defines the maximum length of source text or parse errors. Default is 100. - - - - - Defines if LI, TR, TH, TD tags must be partially fixed when nesting errors are detected. Default is false. - - - - - Defines if output must conform to XML, instead of HTML. - - - - - Defines if attribute value output must be optimized (not bound with double quotes if it is possible). Default is false. - - - - - Defines if name must be output with it's original case. Useful for asp.net tags and attributes - - - - - Defines if name must be output in uppercase. Default is false. - - - - - Defines if declared encoding must be read from the document. - Declared encoding is determined using the meta http-equiv="content-type" content="text/html;charset=XXXXX" html node. - Default is true. - - - - - Defines the name of a node that will throw the StopperNodeException when found as an end node. Default is null. - - - - - Defines if the 'id' attribute must be specifically used. Default is true. - - - - - Defines if empty nodes must be written as closed during output. Default is false. - - - - - Creates an instance of an HTML document. - - - - - Creates a new XPathNavigator object for navigating this HTML document. - - An XPathNavigator object. The XPathNavigator is positioned on the root of the document. - - - - Gets a valid XML name. - - Any text. - A string that is a valid XML name. - - - - Applies HTML encoding to a specified string. - - The input string to encode. May not be null. - The encoded string. - - - - Determines if the specified character is considered as a whitespace character. - - The character to check. - true if if the specified character is considered as a whitespace character. - - - - Creates an HTML attribute with the specified name. - - The name of the attribute. May not be null. - The new HTML attribute. - - - - Creates an HTML attribute with the specified name. - - The name of the attribute. May not be null. - The value of the attribute. - The new HTML attribute. - - - - Creates an HTML comment node. - - The new HTML comment node. - - - - Creates an HTML comment node with the specified comment text. - - The comment text. May not be null. - The new HTML comment node. - - - - Creates an HTML element node with the specified name. - - The qualified name of the element. May not be null. - The new HTML node. - - - - Creates an HTML text node. - - The new HTML text node. - - - - Creates an HTML text node with the specified text. - - The text of the node. May not be null. - The new HTML text node. - - - - Detects the encoding of an HTML stream. - - The input stream. May not be null. - The detected encoding. - - - - Detects the encoding of an HTML file. - - Path for the file containing the HTML document to detect. May not be null. - The detected encoding. - - - - Detects the encoding of an HTML text provided on a TextReader. - - The TextReader used to feed the HTML. May not be null. - The detected encoding. - - - - Detects the encoding of an HTML document from a file first, and then loads the file. - - The complete file path to be read. - - - - Detects the encoding of an HTML document from a file first, and then loads the file. - - The complete file path to be read. May not be null. - true to detect encoding, false otherwise. - - - - Detects the encoding of an HTML text. - - The input html text. May not be null. - The detected encoding. - - - - Gets the HTML node with the specified 'id' attribute value. - - The attribute id to match. May not be null. - The HTML node with the matching id or null if not found. - - - - Loads an HTML document from a stream. - - The input stream. - - - - Loads an HTML document from a stream. - - The input stream. - Indicates whether to look for byte order marks at the beginning of the stream. - - - - Loads an HTML document from a stream. - - The input stream. - The character encoding to use. - - - - Loads an HTML document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the stream. - - - - Loads an HTML document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the stream. - The minimum buffer size. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - The character encoding to use. May not be null. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - The character encoding to use. May not be null. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - The character encoding to use. May not be null. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size. - - - - Loads the HTML document from the specified TextReader. - - The TextReader used to feed the HTML data into the document. May not be null. - - - - Loads the HTML document from the specified string. - - String containing the HTML document to load. May not be null. - - - - Saves the HTML document to the specified stream. - - The stream to which you want to save. - - - - Saves the HTML document to the specified stream. - - The stream to which you want to save. May not be null. - The character encoding to use. May not be null. - - - - Saves the mixed document to the specified file. - - The location of the file where you want to save the document. - - - - Saves the mixed document to the specified file. - - The location of the file where you want to save the document. May not be null. - The character encoding to use. May not be null. - - - - Saves the HTML document to the specified StreamWriter. - - The StreamWriter to which you want to save. - - - - Saves the HTML document to the specified TextWriter. - - The TextWriter to which you want to save. May not be null. - - - - Saves the HTML document to the specified XmlWriter. - - The XmlWriter to which you want to save. - - - - Gets the document CRC32 checksum if OptionComputeChecksum was set to true before parsing, 0 otherwise. - - - - - Gets the document's declared encoding. - Declared encoding is determined using the meta http-equiv="content-type" content="text/html;charset=XXXXX" html node. - - - - - Gets the root node of the document. - - - - - Gets the document's output encoding. - - - - - Gets a list of parse errors found in the document. - - - - - Gets the remaining text. - Will always be null if OptionStopperNodeName is null. - - - - - Gets the offset of Remainder in the original Html text. - If OptionStopperNodeName is null, this will return the length of the original Html text. - - - - - Gets the document's stream encoding. - - - - - A utility class to get HTML document from HTTP. - - - - - Occurs after an HTTP request has been executed. - - - - - Occurs before an HTML document is handled. - - - - - Occurs before an HTTP request is executed. - - - - - Gets the MIME content type for a given path extension. - - The input path extension. - The default content type to return if any error occurs. - The path extension's MIME content type. - - - - Gets the path extension for a given MIME content type. - - The input MIME content type. - The default path extension to return if any error occurs. - The MIME content type's path extension. - - - - Creates an instance of the given type from the specified Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The requested type. - An newly created instance. - - - - Creates an instance of the given type from the specified Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The URL that specifies the XSLT stylesheet to load. - An containing the namespace-qualified arguments used as input to the transform. - The requested type. - An newly created instance. - - - - Creates an instance of the given type from the specified Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The URL that specifies the XSLT stylesheet to load. - An containing the namespace-qualified arguments used as input to the transform. - The requested type. - A file path where the temporary XML before transformation will be saved. Mostly used for debugging purposes. - An newly created instance. - - - - Gets an HTML document from an Internet resource and saves it to the specified file. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The location of the file where you want to save the document. - - - - Gets an HTML document from an Internet resource and saves it to the specified file. - Proxy aware - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The location of the file where you want to save the document. - - - - - - Gets an HTML document from an Internet resource and saves it to the specified file. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The location of the file where you want to save the document. - The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. - - - - Gets an HTML document from an Internet resource and saves it to the specified file. Understands Proxies - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The location of the file where you want to save the document. - - The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. - - - - - Gets the cache file path for a specified url. - - The url fo which to retrieve the cache path. May not be null. - The cache file path. - - - - Gets an HTML document from an Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - A new HTML document. - - - - Gets an HTML document from an Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - Host to use for Proxy - Port the Proxy is on - User Id for Authentication - Password for Authentication - A new HTML document. - - - - Loads an HTML document from an Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. - A new HTML document. - - - - Loads an HTML document from an Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. - Proxy to use with this request - Credentials to use when authenticating - A new HTML document. - - - - Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The XmlTextWriter to which you want to save. - - - - Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter, after an XSLT transformation. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The URL that specifies the XSLT stylesheet to load. - An XsltArgumentList containing the namespace-qualified arguments used as input to the transform. - The XmlTextWriter to which you want to save. - - - - Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter, after an XSLT transformation. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". May not be null. - The URL that specifies the XSLT stylesheet to load. - An XsltArgumentList containing the namespace-qualified arguments used as input to the transform. - The XmlTextWriter to which you want to save. - A file path where the temporary XML before transformation will be saved. Mostly used for debugging purposes. - - - - Gets or Sets a value indicating if document encoding must be automatically detected. - - - - - Gets or Sets a value indicating whether to get document only from the cache. - If this is set to true and document is not found in the cache, nothing will be loaded. - - - - - Gets or Sets the cache path. If null, no caching mechanism will be used. - - - - - Gets a value indicating if the last document was retrieved from the cache. - - - - - Gets the last request duration in milliseconds. - - - - - Gets the URI of the Internet resource that actually responded to the request. - - - - - Gets the last request status. - - - - - Gets or Sets the size of the buffer used for memory operations. - - - - - Gets or Sets a value indicating if cookies will be stored. - - - - - Gets or Sets a value indicating whether the caching mechanisms should be used or not. - - - - - Represents the method that will handle the PostResponse event. - - - - - Represents the method that will handle the PreHandleDocument event. - - - - - Represents the method that will handle the PreRequest event. - - - - - Represents the type of fragment in a mixed code document. - - - - - The fragment contains code. - - - - - The fragment contains text. - - - - - Represents a combined list and collection of HTML nodes. - - - - - Adds supplied item to collection - - - - - - Explicit clear - - - - - Retreives existence of supplied item - - - - - - - Copies collection to array - - - - - - - Get Explicit enumerator - - - - - - Explicit non-generic enumerator - - - - - - Retrieves the index for the supplied item, -1 if not found - - - - - - - Inserts given item into collection at supplied index - - - - - - - Explicit collection remove - - - - - - - Removes the attribute at the specified index. - - The index of the attribute to remove. - - - - Adds a new attribute to the collection with the given values - - - - - - - Inserts the specified attribute as the last attribute in the collection. - - The attribute to insert. May not be null. - The appended attribute. - - - - Creates and inserts a new attribute as the last attribute in the collection. - - The name of the attribute to insert. - The appended attribute. - - - - Creates and inserts a new attribute as the last attribute in the collection. - - The name of the attribute to insert. - The value of the attribute to insert. - The appended attribute. - - - - Checks for existance of attribute with given name - - - - - - - Inserts the specified attribute as the first node in the collection. - - The attribute to insert. May not be null. - The prepended attribute. - - - - Removes a given attribute from the list. - - The attribute to remove. May not be null. - - - - Removes an attribute from the list, using its name. If there are more than one attributes with this name, they will all be removed. - - The attribute's name. May not be null. - - - - Remove all attributes in the list. - - - - - Returns all attributes with specified name. Handles case insentivity - - Name of the attribute - - - - - Removes all attributes from the collection - - - - - Clears the attribute collection - - - - - Gets a given attribute from the list using its name. - - - - - Gets the number of elements actually contained in the list. - - - - - Gets readonly status of colelction - - - - - Gets the attribute at the specified index. - - - - - Flags that describe the behavior of an Element node. - - - - - The node is a CDATA node. - - - - - The node is empty. META or IMG are example of such nodes. - - - - - The node will automatically be closed during parsing. - - - - - The node can overlap. - - - - - Represents a combined list and collection of HTML nodes. - - - - - Initialize the HtmlNodeCollection with the base parent node - - The base node of the collection - - - - Add node to the collection - - - - - - Clears out the collection of HtmlNodes. Removes each nodes reference to parentnode, nextnode and prevnode - - - - - Gets existence of node in collection - - - - - - - Copy collection to array - - - - - - - Get Enumerator - - - - - - Get Explicit Enumerator - - - - - - Get index of node - - - - - - - Insert node at index - - - - - - - Remove node - - - - - - - Remove at index - - - - - - Get first instance of node in supplied collection - - - - - - - - Add node to the end of the collection - - - - - - Get first instance of node with name - - - - - - - Get index of node - - - - - - - Add node to the beginning of the collection - - - - - - Remove node at index - - - - - - - Replace node at index - - - - - - - Get all node descended from this collection - - - - - - Get all node descended from this collection - - - - - - Get all node descended from this collection with matching name - - - - - - Gets all first generation elements in collection - - - - - - Gets all first generation elements matching name - - - - - - - All first generation nodes in collection - - - - - - Gets a given node from the list. - - - - - Get node with tag name - - - - - - - Gets the number of elements actually contained in the list. - - - - - Is collection read only - - - - - Gets the node at the specified index. - - - - - A utility class to compute CRC32. - - - - - Compute a checksum for a given array of bytes. - - The array of bytes to compute the checksum for. - The computed checksum. - - - - Compute a checksum for a given string. - - The string to compute the checksum for. - The computed checksum. - - - - Represents an HTML node. - - - - - Gets the name of a comment node. It is actually defined as '#comment'. - - - - - Gets the name of the document node. It is actually defined as '#document'. - - - - - Gets the name of a text node. It is actually defined as '#text'. - - - - - Gets a collection of flags that define specific behaviors for specific element nodes. - The table contains a DictionaryEntry list with the lowercase tag name as the Key, and a combination of HtmlElementFlags as the Value. - - - - - Initialize HtmlNode. Builds a list of all tags that have special allowances - - - - - Initializes HtmlNode, providing type, owner and where it exists in a collection - - - - - - - - Creates a new XPathNavigator object for navigating this HTML node. - - An XPathNavigator object. The XPathNavigator is positioned on the node from which the method was called. It is not positioned on the root of the document. - - - - Determines if an element node can be kept overlapped. - - The name of the element node to check. May not be null. - true if the name is the name of an element node that can be kept overlapped, false otherwise. - - - - Creates an HTML node from a string representing literal HTML. - - The HTML text. - The newly created node instance. - - - - Determines if an element node is a CDATA element node. - - The name of the element node to check. May not be null. - true if the name is the name of a CDATA element node, false otherwise. - - - - Determines if an element node is closed. - - The name of the element node to check. May not be null. - true if the name is the name of a closed element node, false otherwise. - - - - Determines if an element node is defined as empty. - - The name of the element node to check. May not be null. - true if the name is the name of an empty element node, false otherwise. - - - - Determines if a text corresponds to the closing tag of an node that can be kept overlapped. - - The text to check. May not be null. - true or false. - - - - Returns a collection of all ancestor nodes of this element. - - - - - - Get Ancestors with matching name - - - - - - - Returns a collection of all ancestor nodes of this element. - - - - - - Gets all anscestor nodes and the current node - - - - - - - Adds the specified node to the end of the list of children of this node. - - The node to add. May not be null. - The node added. - - - - Adds the specified node to the end of the list of children of this node. - - The node list to add. May not be null. - - - - Gets all Attributes with name - - - - - - - Creates a duplicate of the node - - - - - - Creates a duplicate of the node and changes its name at the same time. - - The new name of the cloned node. May not be null. - The cloned node. - - - - Creates a duplicate of the node and changes its name at the same time. - - The new name of the cloned node. May not be null. - true to recursively clone the subtree under the specified node; false to clone only the node itself. - The cloned node. - - - - Creates a duplicate of the node. - - true to recursively clone the subtree under the specified node; false to clone only the node itself. - The cloned node. - - - - Creates a duplicate of the node and the subtree under it. - - The node to duplicate. May not be null. - - - - Creates a duplicate of the node. - - The node to duplicate. May not be null. - true to recursively clone the subtree under the specified node, false to clone only the node itself. - - - - Creates an XPathNavigator using the root of this document. - - - - - - Gets all Descendant nodes for this node and each of child nodes - - - - - - Returns a collection of all descendant nodes of this element, in document order - - - - - - Gets all Descendant nodes in enumerated list - - - - - - Get all descendant nodes with matching name - - - - - - - Returns a collection of all descendant nodes of this element, in document order - - - - - - Gets all descendant nodes including this node - - - - - - - Gets first generation child node matching name - - - - - - - Gets matching first generation child nodes matching name - - - - - - - Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned. - - The name of the attribute to get. May not be null. - The default value to return if not found. - The value of the attribute if found, the default value if not found. - - - - Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned. - - The name of the attribute to get. May not be null. - The default value to return if not found. - The value of the attribute if found, the default value if not found. - - - - Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned. - - The name of the attribute to get. May not be null. - The default value to return if not found. - The value of the attribute if found, the default value if not found. - - - - Inserts the specified node immediately after the specified reference node. - - The node to insert. May not be null. - The node that is the reference node. The newNode is placed after the refNode. - The node being inserted. - - - - Inserts the specified node immediately before the specified reference node. - - The node to insert. May not be null. - The node that is the reference node. The newChild is placed before this node. - The node being inserted. - - - - Adds the specified node to the beginning of the list of children of this node. - - The node to add. May not be null. - The node added. - - - - Adds the specified node list to the beginning of the list of children of this node. - - The node list to add. May not be null. - - - - Removes node from parent collection - - - - - Removes all the children and/or attributes of the current node. - - - - - Removes all the children of the current node. - - - - - Removes the specified child node. - - The node being removed. May not be null. - The node removed. - - - - Removes the specified child node. - - The node being removed. May not be null. - true to keep grand children of the node, false otherwise. - The node removed. - - - - Replaces the child node oldChild with newChild node. - - The new node to put in the child list. - The node being replaced in the list. - The node replaced. - - - - Selects a list of nodes matching the expression. - - The XPath expression. - An containing a collection of nodes matching the query, or null if no node matched the XPath expression. - - - - Selects the first XmlNode that matches the XPath expression. - - The XPath expression. May not be null. - The first that matches the XPath query or a null reference if no matching node was found. - - - - Helper method to set the value of an attribute of this node. If the attribute is not found, it will be created automatically. - - The name of the attribute to set. May not be null. - The value for the attribute. - The corresponding attribute instance. - - - - Saves all the children of the node to the specified TextWriter. - - The TextWriter to which you want to save. - - - - Saves all the children of the node to a string. - - The saved string. - - - - Saves the current node to the specified TextWriter. - - The TextWriter to which you want to save. - - - - Saves the current node to the specified XmlWriter. - - The XmlWriter to which you want to save. - - - - Saves the current node to a string. - - The saved string. - - - - Gets the collection of HTML attributes for this node. May not be null. - - - - - Gets all the children of the node. - - - - - Gets a value indicating if this node has been closed or not. - - - - - Gets the collection of HTML attributes for the closing tag. May not be null. - - - - - Gets the first child of the node. - - - - - Gets a value indicating whether the current node has any attributes. - - - - - Gets a value indicating whether this node has any child nodes. - - - - - Gets a value indicating whether the current node has any attributes on the closing tag. - - - - - Gets or sets the value of the 'id' HTML attribute. The document must have been parsed using the OptionUseIdAttribute set to true. - - - - - Gets or Sets the HTML between the start and end tags of the object. - - - - - Gets or Sets the text between the start and end tags of the object. - - - - - Gets the last child of the node. - - - - - Gets the line number of this node in the document. - - - - - Gets the column number of this node in the document. - - - - - Gets or sets this node's name. - - - - - Gets the HTML node immediately following this element. - - - - - Gets the type of this node. - - - - - The original unaltered name of the tag - - - - - Gets or Sets the object and its content in HTML. - - - - - Gets the to which this node belongs. - - - - - Gets the parent of this node (for nodes that can have parents). - - - - - Gets the node immediately preceding this node. - - - - - Gets the stream position of this node in the document, relative to the start of the document. - - - - - Gets a valid XPath string that points to this node - - - - - Represents an HTML attribute. - - - - - Compares the current instance with another attribute. Comparison is based on attributes' name. - - An attribute to compare with this instance. - A 32-bit signed integer that indicates the relative order of the names comparison. - - - - Creates a duplicate of this attribute. - - The cloned attribute. - - - - Removes this attribute from it's parents collection - - - - - Gets the line number of this attribute in the document. - - - - - Gets the column number of this attribute in the document. - - - - - Gets the qualified name of the attribute. - - - - - Name of attribute with original case - - - - - Gets the HTML document to which this attribute belongs. - - - - - Gets the HTML node to which this attribute belongs. - - - - - Specifies what type of quote the data should be wrapped in - - - - - Gets the stream position of this attribute in the document, relative to the start of the document. - - - - - Gets or sets the value of the attribute. - - - - - Gets a valid XPath string that points to this Attribute - - - - - An Enum representing different types of Quotes used for surrounding attribute values - - - - - A single quote mark ' - - - - - A double quote mark " - - - - - A utility class to replace special characters by entities and vice-versa. - Follows HTML 4.0 specification found at http://www.w3.org/TR/html4/sgml/entities.html - - - - - Replace known entities by characters. - - The source text. - The result text. - - - - Clone and entitize an HtmlNode. This will affect attribute values and nodes' text. It will also entitize all child nodes. - - The node to entitize. - An entitized cloned node. - - - - Replace characters above 127 by entities. - - The source text. - The result text. - - - - Replace characters above 127 by entities. - - The source text. - If set to false, the function will not use known entities name. Default is true. - The result text. - - - - Replace characters above 127 by entities. - - The source text. - If set to false, the function will not use known entities name. Default is true. - If set to true, the [quote], [ampersand], [lower than] and [greather than] characters will be entitized. - The result text - - - - A collection of entities indexed by name. - - - - - A collection of entities indexed by value. - - - - - Represents a fragment of text in a mixed code document. - - - - - Represents a base class for fragments in a mixed code document. - - - - - Gets the fragement text. - - - - - Gets the type of fragment. - - - - - Gets the line number of the fragment. - - - - - Gets the line position (column) of the fragment. - - - - - Gets the fragment position in the document's stream. - - - - - Gets the fragment text. - - - - - Represents an exception thrown by the HtmlWeb utility class. - - - - - Creates an instance of the HtmlWebException. - - The exception's message. - - - - Represents the type of parsing error. - - - - - A tag was not closed. - - - - - A tag was not opened. - - - - - There is a charset mismatch between stream and declared (META) encoding. - - - - - An end tag was not required. - - - - - An end tag is invalid at this position. - - - - - Represents an HTML comment. - - - - - Gets or Sets the comment text of the node. - - - - - Gets or Sets the HTML between the start and end tags of the object. In the case of a text node, it is equals to OuterHtml. - - - - - Gets or Sets the object and its content in HTML. - - - - - Represents a document with mixed code and text. ASP, ASPX, JSP, are good example of such documents. - - - - - Gets or sets the token representing code end. - - - - - Gets or sets the token representing code start. - - - - - Gets or sets the token representing code directive. - - - - - Gets or sets the token representing response write directive. - - - - - Creates a mixed code document instance. - - - - - Create a code fragment instances. - - The newly created code fragment instance. - - - - Create a text fragment instances. - - The newly created text fragment instance. - - - - Loads a mixed code document from a stream. - - The input stream. - - - - Loads a mixed code document from a stream. - - The input stream. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads a mixed code document from a stream. - - The input stream. - The character encoding to use. - - - - Loads a mixed code document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads a mixed code document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - The character encoding to use. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size. - - - - Loads the mixed code document from the specified TextReader. - - The TextReader used to feed the HTML data into the document. - - - - Loads a mixed document from a text - - The text to load. - - - - Saves the mixed document to the specified stream. - - The stream to which you want to save. - - - - Saves the mixed document to the specified stream. - - The stream to which you want to save. - The character encoding to use. - - - - Saves the mixed document to the specified file. - - The location of the file where you want to save the document. - - - - Saves the mixed document to the specified file. - - The location of the file where you want to save the document. - The character encoding to use. - - - - Saves the mixed document to the specified StreamWriter. - - The StreamWriter to which you want to save. - - - - Saves the mixed document to the specified TextWriter. - - The TextWriter to which you want to save. - - - - Gets the code represented by the mixed code document seen as a template. - - - - - Gets the list of code fragments in the document. - - - - - Gets the list of all fragments in the document. - - - - - Gets the encoding of the stream used to read the document. - - - - - Gets the list of text fragments in the document. - - - - - Represents a parsing error found during document parsing. - - - - - Gets the type of error. - - - - - Gets the line number of this error in the document. - - - - - Gets the column number of this error in the document. - - - - - Gets a description for the error. - - - - - Gets the the full text of the line containing the error. - - - - - Gets the absolute stream position of this error in the document, relative to the start of the document. - - - - - Represents a fragment of code in a mixed code document. - - - - - Gets the fragment code text. - - - - - Represents the type of a node. - - - - - The root of a document. - - - - - An HTML element. - - - - - An HTML comment. - - - - - A text node is always the child of an element or a document node. - - - - - Represents a list of mixed code fragments. - - - - - Gets an enumerator that can iterate through the fragment list. - - - - - Appends a fragment to the list of fragments. - - The fragment to append. May not be null. - - - - Gets an enumerator that can iterate through the fragment list. - - - - - Prepends a fragment to the list of fragments. - - The fragment to append. May not be null. - - - - Remove a fragment from the list of fragments. If this fragment was not in the list, an exception will be raised. - - The fragment to remove. May not be null. - - - - Remove all fragments from the list. - - - - - Remove a fragment from the list of fragments, using its index in the list. - - The index of the fragment to remove. - - - - Gets the Document - - - - - Gets the number of fragments contained in the list. - - - - - Gets a fragment from the list using its index. - - - - - Represents a fragment enumerator. - - - - - Advances the enumerator to the next element of the collection. - - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - - - - Sets the enumerator to its initial position, which is before the first element in the collection. - - - - - Gets the current element in the collection. - - - - - Gets the current element in the collection. - - - - - Represents an HTML text node. - - - - - Gets or Sets the HTML between the start and end tags of the object. In the case of a text node, it is equals to OuterHtml. - - - - - Gets or Sets the object and its content in HTML. - - - - - Gets or Sets the text of the node. - - - - diff --git a/lib/htmlagilitypack/HtmlAgilityPack.dll b/lib/htmlagilitypack/HtmlAgilityPack.dll deleted file mode 100644 index a30005e94ed..00000000000 Binary files a/lib/htmlagilitypack/HtmlAgilityPack.dll and /dev/null differ diff --git a/lib/htmlagilitypack/HtmlAgilityPack.pdb b/lib/htmlagilitypack/HtmlAgilityPack.pdb deleted file mode 100644 index 8a5f31a00fd..00000000000 Binary files a/lib/htmlagilitypack/HtmlAgilityPack.pdb and /dev/null differ diff --git a/lib/imageresizer/ImageResizer.XML b/lib/imageresizer/ImageResizer.XML deleted file mode 100644 index 76f46baf174..00000000000 --- a/lib/imageresizer/ImageResizer.XML +++ /dev/null @@ -1,4986 +0,0 @@ - - - - ImageResizer - - - - - Represents the widths of edges of a box. - - - - - Create a box with all edges the same width. - - - - - - Create a box, specifying individual widths for each size - - - - - - - - - Copies the specified BoxEdges instance - - - - - - Sets the width of all edges, returning a new instance - - - - - - - Gets edge offsets as a clockwise array, starting with Top. - - - - - - Returns double.NaN unless all edges are the same width, in which case that width is returned - - - - - Returns an instance with a width of 0 - - - - - Returns true if th - - - - - Provides culture-invariant parsing of byte, int, double, float, bool, and enum values. - - - - - - - - Provides culture-invariant parsing of byte, int, double, float, bool, and enum values. - - - - - - - - - Provides culture-invariant parsing of byte, int, double, float, bool, and enum values. - - - - - - - - - Serializes the given value by calling .ToString(). If the value is null, the key is removed. - - - - - - - - - Provides culture-invariant serialization of value types, in lower case for querystring readability. Setting a key to null removes it. - - - - - - - - - - Writes the diagnostic message at the specified level. - - The log level. - A to be written. - - - - Writes the diagnostic message at the Trace level. - - A to be written. - - - - Writes the diagnostic message at the Debug level. - - A to be written. - - - - Writes the diagnostic message at the Info level. - - A to be written. - - - - Writes the diagnostic message at the Warn level. - - A to be written. - - - - Writes the diagnostic message at the Error level. - - A to be written. - - - - Writes the diagnostic message at the Fatal level. - - A to be written. - - - - Checks if the specified log level is enabled. - - The log level. - A value indicating whether the specified log level is enabled. - - - - Gets a value indicating whether the Trace level is enabled. - - - - - Gets a value indicating whether the Debug level is enabled. - - - - - Gets a value indicating whether the Info level is enabled. - - - - - Gets a value indicating whether the Warn level is enabled. - - - - - Gets a value indicating whether the Error level is enabled. - - - - - Gets a value indicating whether the Fatal level is enabled. - - - - - Gets or sets the logger name. - - - - - Loads NLog configuration from the specified file. - - The name of the file to load NLog configuration from. - - - - Creates the specified logger object and assigns a LoggerName to it. - - Logger name. - The new logger instance. - - - - Provides automatic download of native dependencies (which VS doesn't see). Gets the correct bitness as well - very nice if you're changing app pool bitness and forgot to change binaries. - - - - - Returns a copy of the list of reported issues. - - - - - - Adds the specified issue to the list unless it is an exact duplicate of another instance. - - - - - - Thread safe countdown class - - - - - Extends enumerations by allowing them to define alternate strings with the [EnumString("Alternate Name",true)] attribute, and support it through TryParse and ToPreferredString - - - - - Attempts case-insensitive parsing of the specified enum. Returns the specified default value if parsing fails. - Supports [EnumString("Alternate Value")] attributes and parses flags. If any segment of a comma-delimited list isn't parsed as either a number or string, defaultValue will be returned. - - - - - - - - Attempts case-insensitive parsing of the specified enum. Returns null if parsing failed. - Supports [EnumString("Alternate Value")] attributes and parses flags. If any segment of a comma-delimited list isn't parsed as either a number or string, null will be returned. - - - - - - - - Retuns the string representation for the given enumeration - - - - - - - - Provides culture-invariant parsing of int, double, float, bool, and enum values. - - - - - - - - - Provides culture-invariant parsing of int, double, float, bool, and enum values. - - - - - - - - - - Provides culture-invariant parsing of int, double, float, bool, and enum values. - - - - - - - - - - Provides culture-invariant parsing of int, double, float, bool, and enum values. - - - - - - - - - Serializes the given value by calling .ToString(). If the value is null, the key is removed. - - - - - - - - - - Provides culture-invariant serialization of value types, in lower case for querystring readability. Setting a key to null removes it. - - - - - - - - - - Parses a comma-delimited list of primitive values. If there are unparsable items in the list, they will be replaced with 'fallbackValue'. If fallbackValue is null, the function will return null - - - - - - - - - - Returns true if any of the specified keys contain a value - - - - - - - - Normalizes a command that has two possible names. - If either of the commands has a null or empty value, those keys are removed. - If both the the primary and secondary are present, the secondary is removed. - Otherwise, the secondary is renamed to the primary name. - - - - - - - Creates and returns a new NameValueCollection instance that contains only the specified keys from the current collection. - - - - - - - - Creates and returns a new NameValueCollection instance that contains all of the - keys/values from 'q', and any keys/values from 'defaults' that 'q' does not already - contain. - - The settings specific to a particular query - Default settings to use when not overridden by 'q'. - - - - - Provides extension methods for copying streams - - - - - Copies the remaining data in the current stream to a new MemoryStream instance. - - - - - - - Copies the current stream into a new MemoryStream instance. - - - True to copy entire stream if seeakable, false to only copy remaining data - - - - - Copies the current stream into a new MemoryStream instance. - - - True to copy entire stream if seeakable, false to only copy remaining data - The buffer size to use (in bytes) if a buffer is required. Default: 4KiB - - - - - Copies the remaining data in the current stream to a byte[] array of exact size. - - - - - - - Copies the current stream into a byte[] array of exact size. - - - True to copy entire stream if seeakable, false to only copy remaining data - - - - - Copies the remaining data from the this stream into the given stream. - - - The stream to write to - - - - Copies this stream into the given stream - - - The stream to write to - True to copy entire stream if seeakable, false to only copy remaining data - - - - Copies this stream into the given stream - - - The stream to write to - True to copy entire stream if seeakable, false to only copy remaining data - True to copy entire stream if seeakable, false to only copy remaining data - - - - Copies the current stream into a byte[] array of exact size - - - True to copy entire stream if seeakable, false to only copy remaining data. - The buffer size to use (in bytes) if a buffer is required. Default: 4KiB - - - - - Attempts to return a byte[] array containing the remaining portion of the stream. - Unlike CopyToBytes(), does not return a byte[] array of exact length, and may re-use the actual Stream's byte array, making it unsafe to write to in the future. - - - - - - - - - Creates an ImageJob that won't run a full build - it will only do enough work in order to supply the requested data fields. - - - Pass null to use "source.width","source.height", "result.ext","result.mime". - - - - Shorthand method for ImageBuilder.Current.Build(this) - - - - - - Sets CreateParentDirectory to true. Provided for easy chaining so you can do one-liners. - new ImageJob(source,dest,settings).CreateDir().Build() - - - - - - Internal use only. - Resolves the specified (potenetially templated) path into a physical path. - Applies the AddFileExtension setting using the 'ext' variable. - Supplies the guid, settings.*, filename, path, and originalExt variables. - The resolver method should supply 'ext', 'width', and 'height' (all of which refer to the final image). - If AllowDestinationPathVariables=False, only AddFileExtenson will be processed. - - - - - - - - A list of strings which define properties that can be returned to the caller. "source.width", "source.height", "result.ext", "result.mime" are the most commonly used. Defaults to none - - - - - A dictionary of key/value pairs provided along with the result. - - - - - The source image's physical path, app-relative virtual path, or a Stream, byte array, Bitmap, VirtualFile, IVirtualFile, HttpPostedFile, or HttpPostedFileBase instance. - - - - - The destination Stream, physical path, or app-relative virtual path. If a Bitmap instance is desired, - set this to typeof(System.Drawing.Bitmap). The result will be stored in .Result - - - - - The result if a Bitmap, BitmapSource, or IWICBitmapSource instance is requested. - - - - - The width, in pixels, of the first frame or page in the source image file - - - - - The height, in pixels, of the first frame or page in the source image file - - - - - The correct file extension for the resulting file stream, without a leading dot. Will be null if the result is not an encoded image. - - - - - The correct mime type for the resulting file stream, without a leading dot. Will be null if the result is not an encoded image. - - - - - The image processing settings - - - - - The image processing instructions - - - - - If true, and if 'source' is a IDisposable instead like Bitmap or Stream instance, it will be disposed after it has been used. Defaults to true. - - - - - If true, and if 'source' is seekable, the stream will be reset to its previous position after being read. - Always true for HttpPostedFile(Base) instances, defaults to false for all others. - - - - - If true, and if 'dest' is a Stream instance, it will be disposed after the image has been written. Defaults to false. - - - - - Contains the final physical path to the image (if 'dest' was a path - null otherwise) - - - - - If 'source' contains any path-related data, it is copied into this member for use by format detetction code, so decoding can be optimized. - May be a physical or virtual path, or just a file name. - - - - - If true, the appropriate extension for the encoding format will be added to the destination path, and the result will be stored in FinalPath in physical path form. - - - - - If true (the default), destination paths can include variables that are expanded during the image build process. - Ex. Dest = "~/folder/<guid>.<ext>" will expand to "C:\WWW\App\folder\1ddadaadaddaa75da75ad34ad33da3a.jpg". - - - - - Defaults to false. When true, the parent directory of the destination filename will be created if it doesn't already exist. - - - - - A name/value collection of image processsing instructions. The successor to ResizeSettings. - Just because a key doesn't have a property wrapper doesn't mean you can't use it. i["key"] = value; isnt' that scary. - - - - - Returns a human-friendly representation of the instruction set. Not suitable for URL usage; use ToQueryString() for that. - - - - - - Returns a URL-safe querystring containing the instruction set - - - - - - Creates an empty instructions collection. - - - - - Copies the specified collection into a new Instructions instance. - - - - - - Parses the specified querystring into name/value pairs. Supports standard and semicolon syntaxes. The most readable format is 'key=value;key2=value2' Discards everything after the first '#' character as a URL fragment. - - - - - - The width in pixels to constrain the image to. See 'Mode' and 'Scale' for constraint logic. - - - - - The height in pixels to constrain the image to. See 'Mode' and 'Scale' for constraint logic. - - - - - The fit mode to use when both Width and Height are specified. Defaults to Pad. - - - - - The alignment to use when cropping or padding the image automatically. Defaults to MiddleCenter. - - - - - Flip instruction to perform immediately after loading source image. Maps to 'sflip' and 'sourceFlip'. - - - - - Flip instruction to perform after rendering is complete - - - - - Control how upscaling is performed. Defaults to DownscaleOnly. - - - - - Allows disk caching to be forced or prevented. - - - - - Allows processing to be forced or prevented. - - - - - The frame of the animated GIF to display. 1-based - - - - - The page of the TIFF file to display. 1-based - - - - - Determines Jpeg encoding quality. Maps to 'quality' setting. - - - - - Maps to 'subsampling'. Requires encoder=wic|freeimage or builder=wic|freeimage to take effect. Not supported by the GDI pipeline. - - - - - Maps to 'colors'. Sets the palette size for the final png or gif image (not relevant for jpegs). - Set to 'null' to use the largest palette size available in the format. - Requires the PrettyGifs or WicEncoder plugin. - - - - - A multiplier to apply to all sizing settings (still obeys Scale=down, though). Useful when you need to apply a page-wide scaling factor, such as for mobile devices. - - - - - Defines the horizontal width of the crop rectangle's coordinate space. For example, setting this to 100 makes the crop X1 and X2 values percentages of the image width. - - - - - Defines the vertical height of the crop rectangle's coordinate space. For example, setting this to 100 makes the crop Y1 and Y1 values percentages of the image height. - - - - - An X1,Y1,X2,Y2 array of coordinates. Unless CropXUnits and CropYUnits are specified, these are in the coordinate space of the original image. - - - - - An X1,Y1,X2,Y2 array of coordinates. Unless CropXUnits and CropYUnits are specified, these are in the coordinate space of the original image. - - - - - Automatically rotates images based on gravity sensor data embedded in Exif. Requires the AutoRotate plugin - - - - - Maps to 'srotate'. Rotates the source image prior to processing. Only 90 degree angles are currently supported. - - - - - Maps to 'rotate'. Rotates the image during rendering. Arbitrary angles are supported. - - - - - Use 'OutputFormat' unless you need a custom value. Determines the format and encoding of the output image. - - - - - Selects the image encoding format. Maps to 'format'. Returns null if the format is unspecified or if it isn't defined in the enumeration. - - - - - If true, the ICC profile will be discared instead of being evaluated server side (which typically causes inconsistent and unexpected effects). - - - - - The fallback image to redirect to if the original image doesn't exist. Must be the name of a pre-defined 404 image or a filename in the default 404 images directory. - Requires the Image404 plugin to be installed. - - - - - The color of margin and padding regions. Defaults to Transparent, or White (when jpeg is the selected output color). - - - - - Defaults to 'bgcolor'. Allows a separate color to be used for padding areas vs. margins. - - - - - The color to draw the border with, if a border width is specified. - - - - - The name of a pre-defined preset, or a comma-delimited list of presets to apply. These may overwrite other settings. Requires the Presets plugin. - - - - - The name of a pre-defined watermark layer or group from Web.config, or a comma-delimited list of names. Requires the Watermark plugin. - - - - - Applies a Negative filter to the image. Requires the SimpleFilters plugin - - - - - Applies a Sepia filter to the image. Requires the SimpleFilters plugin - - - - - Applies the specified kind of grayscale filter to the image. Requires the SimpleFilters plugin - - - - - Value between 0 and 1. Makes the rendered image transparent. Does not affect borders or background colors - those accept 4-byte colors with alpha channels, however. - Requires the SimpleFilters plugin. Unless the output format is PNG, the image will be blended against white or the background color. - - - - - -1..1 Adjust the brightness of the image. Requires the SimpleFilters plugin - - - - - -1..1 Adjust the contrast of the image. Requires the SimpleFilters plugin - - - - - -1..1 Adjust the saturation of the image. Requires the SimpleFilters plugin - - - - - Setting this enables automatic whitespace trimming using an energy function. 50 is safe, even 255 rarely cuts anything off except a shadow. Set TrimPadding to pad the result slightly and improve appearance. - Requires the WhitespaceTrimmer plugin. - - - - - Set TrimThreshold first. This specifies a percentage of the image size to 'add' to the crop rectangle. Setting to 0.5 or 1 usually produces good results. - Requires the WhitespaceTrimmer plugin. - - - - - Guassian Blur. Requires the AdvancedFilters plugin. - - - - - Unsharp Mask. Requires the AdvancedFilters plugin. - - - - - Safe noise removal. Requires the AdvancedFilters plugin. - - - - - Controls dithering when rendering to an 8-bit PNG or GIF image. Requires PrettyGifs or WicEncoder. Accepted values for PrettyGifs: true|false|4pass|30|50|79|[percentage]. Accepted values for WicEncoder: true|false. - - - - - Specify a preferred encoder for compressing the output image file. Defaults to 'gdi'. Other valid values are 'freeimage' and 'wic', which require the FreeImageEncoder and WicEncoder plugins respectively. - FreeImage offers faster jpeg encoding, while WIC offers faster PNG and GIF encoding. Both, however, require full trust. - - - - - Specify a preferred decoder for parsing the original image file. Defaults to 'gdi'. Other values include 'freeimage', 'wic', and 'psdreader'. The preferred decoder gets the first chance at reading the files. If that fails, all other decoders try, in order of declaration in Web.config. - Requires the matching FreeImageDecoder, WicDecoder, or PsdReader plugin to be installed. - - - - - Specify the image processing pipeline to use. Defaults to 'gdi'. If FreeImageBuilder or WicBuilder is installed, you can specify 'freeimage' or 'wic' to use that pipeline instead. - The WIC pipeline offers a 2-8X performance increase of GDI, at the expense of slightly reduced image quality, the full trust requirement, and support for only basic resize and crop commands. - FreeImage offers *nix-level image support, and handles many images that gdi and wic can't deal with. It is also restricted to a subset of the full command series. - - - - - Gets or sets a 1 or 4-element array defining cornder radii. If the array is 1 element, it applies to all corners. If it is 4 elements, each corner gets an individual radius. Values are percentages of the image width or height, whichever is smaller. - Requires the SimpleFilters plugin. - - - - - ["paddingWidth"]: Gets/sets the width(s) of padding inside the image border. - - - - - ["margin"]: Gets/sets the width(s) of the margin outside the image border and effects. - - - - - Friendly get/set accessor for the ["borderWidth"] value. Returns null when unspecified. - - - - - Provides a useable base class that can be used to modify the behavior of ImageBuilder. - When registered with an ImageBuilder instance, the ImageBuilder will call the corresponding methods on the extension prior to executing its own methods. - - - - - Not for external use. Inherit from BuilderExtension instead. - Dual-purpose base class for both ImageBuilder and BuilderExtension - Extensions can inherit and override certain methods. - ImageBuilder inherits this method to utilize its extension invocation code. - Each method of AbstractImageProcessor loops through all extensions and executes the same method on each. Provides a sort of multiple-inheritance mechanisim. - - - - - Creates a new AbstractImageProcessor with no extensions - - - - - Creates a new AbstractImageProcessor which will run the specified extensions with each method call. - - - - - - Contains the set of extensions that are called for every method. - - - - - Extend this to allow additional types of source objects to be accepted by transforming them into Bitmap instances. - - - - - - - - - Extend this to allow additional types of source objects to be accepted by transforming them into Stream instances. First plugin to return a Stream wins. - - - - - - - - - - - Extensions are executed until one extension returns a non-null value. - This is taken to mean that the error has been resolved. - Extensions should not throw an exception unless they wish to cause subsequent extensions to not execute. - If extensions throw an ArgumentException or ExternalException, it will be wrapped in an ImageCorruptedException instance. - If the Bitmap class is used for decoding, read gdi-bugs.txt and make sure you set b.Tag to new BitmapTag(optionalPath,stream); - - - - - Extend this to support alternate image source formats. - If the Bitmap class is used for decoding, read gdi-bugs.txt and make sure you set b.Tag to new BitmapTag(optionalPath,stream); - - - - - - - - - Extend this to modify the Bitmap instance after it has been decoded by DecodeStream or DecodeStreamFailed - - - - - Extend this to allow additional types of *destination* objects to be accepted by transforming them into a stream. - - - - - - - The method to override if you want to replace the entire pipeline. - All Build() calls call this method first. - Does nothing in ImageBuilder - - - - - - - Called for Build() calls that want the result encoded. (Not for Bitmap Build(source,settings) calls. - Only override this method if you need to replace the behavior of image encoding and image processing together, such as adding support - for resizing multi-page TIFF files or animated GIFs. - - Does NOT dispose of 'source' or 'source's underlying stream. - - - - - - - - - Most calls funnel through here. Default behavior configures an ImageState instance and calls Process(imageState); - Shouldn't be overriden for any reason I can think of - use the appropriate virtual method under Process(). - If an extension returns a Bitmap instance, it will be used instead of the default behavior. - Does NOT dispose of 'source' or 'source's underlying stream. - - - - - - - - - Process.0 First step of the Process() method. Can replace the entire Process method if RequestAction.Cancel is returned. - Can be used to add points to translate (for image maps), and also to modify the settings - - - - - - Process.1 Switches the bitmap to the correct frame or page, and applies source flipping commands. - - - - - - Process.2 Extend this to apply any pre-processing to the source bitmap that needs to occur before Layout begins - - - - - - Process.3(Layout).0: This is the last point at which points to translate should be added. - Only return RequestedAction.Cancel if you wish to replace the entire Layout sequence logic. - - - - - - Process.3(Layout).1: This is where the points in the layout are flipped the same way the source bitmap was flipped (unless their flags specify otherwise) - - - - - - Process.3(Layout).2: Rings 'image' and 'imageArea' are added to the layout. - - - - - - Process.3(Layout).3: Add rings here to insert them between the image area and the padding - - - - - - Process.3(Layout).4: Ring "padding" is added to the layout - - - - - - Process.3(Layout).5: Add rings here to insert them between the padding and the border - - - - - - Process.3(Layout).6: Ring "border" is added to the layout - - - - - - Process.3(Layout).7: Add rings here to insert them between the border and the effect rings - - - - - - Process.3(Layout).8: Effects such as 'shadow' are added here. - - - - - - Process.3(Layout).9: Add rings here to insert them between the effects and the margin - - - - - - Process.3(Layout).10: Margins are added to the layout - - - - - - Process.3(Layout).11: Add rings here to insert them around the margin. Rings will be outermost - - - - - - Process.3(Layout).anytime: Occurs when the layout is rotated. May be called anytime during Layout() - - - - - - Process.3(Layout).anytime: Occurs after the layout is rotated. May be called anytime during Layout() - - - - - - Process.3(Layout).anytime: Occurs when the layout is normalized to 0,0. May be called anytime during Layout() - - - - - - Process.3(Layout).anytime: Occurs after the layout is normalized. May be called anytime during Layout() - - - - - - Process.3(Layout).anytime: Occurs when the layout point values are rounded to integers. May be called anytime during Layout() - - - - - - Process.3(Layout).anytime: Occurs after the layout point values are rounded to integers. May be called anytime during Layout() - - - - - - Process.3(Layout).12: Occurs once layout has finished. No more changes should occur to points or rings in the layout after this method. destSize is calculated here. - - - - - - Process.4: The destination bitmap is created and sized based destSize. A graphics object is initialized for rendering. - - - - - - Process.5(Render) Rendering. Do not return RequestedAction.Cancel unless you want to replace the entire rendering system. - - - - - - Process.5(Render).1 The background color is rendered - - - - - - Process.5(Render).2 After the background color is rendered - - - - - - Process.5(Render).3 Effects (such as a drop shadow or outer glow) are rendered - - - - - - Process.5(Render).4 After outer effects are rendered - - - - - - Process.5(Render).5 Image padding is drawn - - - - - - Process.5(Render).6 After image padding is drawn - - - - - - Process.5(Render).7: An ImageAttributes instance is created if it doesn't already exist. - - - - - - Process.5(Render).8: The ImageAttributes instance exists and can be modified or replaced. - - - - - - Process.5(Render).9: Plugins have a chance to pre-process the source image before it gets rendered, and save it to s.preRenderBitmap - - - - - - Process.5(Render).10: The image is copied to the destination parallelogram specified by ring 'image'. - - - - - - Process.5(Render).11: After the image is drawn - - - - - - Process.5(Render).12: The border is rendered - - - - - - Process.5(Render).13: After the border is drawn - - - - - - Process.5(Render).14: Any last-minute changes before watermarking or overlays are applied - - - - - - Process.5(Render).15: Watermarks can be rendered here. All image processing should be done - - - - - - Process.5(Render).16: Called before changes are flushed and the graphics object is destroyed. - - - - - - Process.5(Render).17: Changes are flushed to the bitmap here and the graphics object is destroyed. - - - - - - Process.5(Render).18: Changes have been flushed to the bitmap, but the final bitmap has not been flipped yet. - - - - - - Process.6: Non-rendering changes to the bitmap object occur here, such as flipping. The graphics object is unavailable. - - - - - - Process.7: Layout and rendering are both complete. - - - - - - All plugins must implement this. Enables web.config addition and removal. - - - - - Installs the plugin in the specified Config instance. The plugin must handle all the work of loading settings, registering the plugin etc. - - - - - - - Uninstalls the plugin. Should reverse all changes made during Install - - - - - - - For plugins that access the query string (important!) - - - - - If the plugin reads any values from the querystring, the names of the keys should be specified here. - This information is required so that the HttpModule knows when to handle an image request. - - - - - - Provides a way to modify settings before they reach the managed API. Does not execute early enough to affect disk caching, although that may change in a later version. - - - - - Implementations should support being called on their own result multiple times without behavioral differences. Currently only executed in the managed API, too late to affect the disk cache, but that will probably change (it's likely all ISettingsModifiers will get executed twice, once after PostRewrite and once before the managed API executes). - - - - - - - We duplicate efforts in PostRewrite to ensure that the DiskCache doesn't block configuration changes. - This won't help CloudFront, however. - - - - - - - - The default scale mode to use when 'width' and/or 'height' are used, and mode is not 'max'. - - - - - The default scale mode to use when 'maxwidth' and/or 'maxheight' are used (or mode=max). - - - - - Matches /resize(x,y,f)/ syntax - Fixed Bug - will replace both slashes.. make first a lookbehind - - - - - Parses and removes the resize folder syntax "resize(x,y,f)/" from the specified file path. - Places settings into the referenced querystring - - - The collection to place parsed values into - - - - - Causes IE6 and earlier to use GIF versions of PNG files. - By default, only fixes requests with ?iefix=true in the querystring. - When catchall is enabled, it will filter all png images, unless iefix=false on those requests. - Not compatible with CDNs or proxy servers, as they do not allow varying by user agent reliably. - - - - - Returns true if the specified querystring and file will cause a PNG file to be returned. - - - - - - - Returns true if the user agent string specifies MSIE versions 1 through 6 for Windows. Cached in context.Items after first call. - - - - - - - If true, 'iefix=true' will be the default for all PNG images, instead of 'iefix=false'. - - - - - If true, the requests from IE will be HTTP redirected to new URLs. If false, the GIF will be silently served instead of the PNG, without any redirection. - A CDN or caching proxy will mess things up regardless, but using redirection ensures that the CDN/proxy never caches the GIF version instead of the PNG. - - - - - Adds URL syntax support for legacy projects: - http://webimageresizer.codeplex.com/, - http://imagehandler.codeplex.com/, - http://bbimagehandler.codeplex.com/, - DAMP: http://our.umbraco.org/projects/backoffice-extensions/digibiz-advanced-media-picker, - Support for http://bip.codeplex.com/ and http://dynamicimageprocess.codeplex.com/ urls is default since w/h are supported. - - - - - Provides default client-caching behavior. Sends Last-Modified header if present, and Expires header if <clientcache minutes="value" /> is configured. - Also defaults Cache-control to Public for anonymous requests (and private for authenticated requests) - - - - - Allows gradients to be dynamically generated like so: - /gradient.png?color1=white&color2=black&angle=40&width=20&height=100 - - - - - Implement this to allow your class (or VirtualPathProvider subclass) to be used without registering it with the whole ASP.NET system. - - - - - Returns true if the specified file exists. - - - - - - - - Returns a virtual file instance for the specified path and querystring. - - - - - - - - A virtual file to support IVirtualImageProvider - - - - - Returns an opened stream to the file contents. - - - - - - The virtual path of the file (relative to the domain, like /app/folder/file.ext) - - - - - For virtual files who want to provide their data in Bitmap form (like a PSD reader or gradient generator). Plugins should never assume this interface will be used, .Open() must also be implemented. - - - - - Returns a Bitmap instance of the file's contents - - - - - - This interface has nothing to do with output caching. This allows VirtualFile instances to override the default cache key (.VirtualPath) for source caching of VirtualFile instances. - See IVirtualFileCache - - - - - Redirects image 404 errors to a querystring-specified server-local location, - while maintaining querystring values (by default) so layout isn't disrupted. - - - - The image to use in place of missing images can be specified by the "404" - parameter in the querystring. The "404" value can also refer to a named - value in the <plugins>/<Image404> setting in Web.config. - - - - - Using <img src="missingimage.jpg?404=image.jpg&width=200" /> - with the default setting (<image404 baseDir="~/" />) will - redirect to ~/image.jpg?width=200. - - - You may also configure 'variables', which is the recommended approach. - For example, <image404 propertyImageDefault="~/images/nophoto.png" /> - in the config file, and <img src="missingimage.jpg?404=propertyImageDefault&width=200" /> - will result in a redirect to ~/images/nophoto.png?width=200. - Any querystring values in the config variable take precedence over - querystring values in the image querystring. For example, - <image404 propertyImageDefault="~/images/nophoto.png?format=png" /> - in the config file and - <img src="missingimage.jpg?format=jpg&404=propertImageDefault&width=200" /> - will result in a redirect to ~/images/nophoto.png?format=png&width=200. - - - - - - Implements IHttpHandler, serves content for the NoCache plugin - - - - - IResponseArgs implementation - - - - - A collection of data and callbacks that can be passed to a caching object. - - - - - A string derived from the request, which can contain any kind of data. To get a cache key that varies with the source modified date, - it should be combined with the value of GetModifiedDateUTC() and hashed. - - - - - The rewritten querystring. Can be useful for caching systems that accept querystring arguments. - - - - - A file extension appropriate for the resulting data. May be different than the extension on the original request. - - - - - The content-type of the data, among other things. Set ResponseHeaders.ApplyDuringPreSendRequestHeaders to automatically - write caching headers based on ResponseHeaders values. - Caching systems that use redirects may use this data as hints when configuring caching on the remote server. - - - - - A delegate that returns the modified date of the source data. - - - - - True if a modified date is available for verifying cache integrity. - - - - - A callback method that will resize, encode, and write the data to the given stream. - - - - - A callback method to return the last modified date of the source file if available, or DateTime.MinValue if not. - - - - - - A callback method that will resize and encode the image into a stream. - - - - - A value derived from the request. Can be used as a cache key. - - - - - True if the source file/record has a modified date - - - - - The content-type of the data, among other things. Set ResponseHeaders.ApplyDuringPreSendRequestHeaders to automatically - write caching headers based on ResponseHeaders values. - Caching systems that use redirects may use this data as hints when configuring caching on the remote server. - - - - - The rewritten querystring. Can be useful for caching systems that accept querystring arguments. - - - - - Provides cache selection logic - - - - - Selects a caching system for the specified request and response - - - - - - - - Allows customization of response headers for a processed image, as well as configuration of the caching system. - - - - - The mime-type of the output data. Defaults to null. - - - - - The cache setting. Defaults to ServerAndPrivate - - - - - The UTC time at which the cached data should expire. - Browsers generally don't re-request resources until the they have expired (unlike modififeddate). - If MinValue, will be ignored. - - - - - The UTC modified date send with the response. Used by browsers with If-Modified-Since to check a cached value is still valid. - If = MinValue, will be ignored. - - - - - When true: If a client requests a refresh, the response will *still* be served from the server cache. - Defaults to false - - - - - ASP.Net sometimes sends Vary: * which obliterates caching. Vary is to be avoided anyhow. - Defaults to true - - - - - These headers should be applied first, prior to the application of other settings - - - - - These headers are applied after applying all of the other settings. (and they will overwrite exisiting values). - - - - - Returns a collection of dependencies used for invalidating the server cache. - Note, having items here will disable kernel-mode caching. Perhaps it is better to simply use LastModified - - - - - - A delegate method to apply the values stored in IResponseHeaders to the specified HttpContext. - - - - - True if the application should automatically execute ApplyToResponse() during the PreSendRequestHeaders event. - - - - - Default cache when DiskCache isn't installed. - Useful for debugging purposes but unsuited for production use, and will use large quanities of RAM. (Scales to fewer than 5 concurrent requests). - Serves content directly to the client from memory. - - - - - Provides caching behavior - - - - - Returns false if the cache is unable to process the request. If false, the caller should fall back to a different cache - - - - - - - Must update the cache if needed, then either rewrite, redirect or serve the cached data. - - - - - - - Installs the caching system as the first choice. - - - - - - - Removes the plugin. - - - - - - - Sends the response directly to the client with no caching logic. - - - - - - - The mime-type of the encoded image. Defaults to null - - - - - Allows subclasses to be used instead of ImageBuilder. Replacements must override the Create method and call their own constructor instead. - - - - - - Shortuct to CurrentImageBuilder.Build (Useful for COM clients). Also creates a destination folder if needed, unlike the normal .Build() call. - - - - - - - - - Returns a deep copy of the specified node - - - - - - Returns a deep copy if the current state of the configuration tree (starting with the 'resizer' element as the root) - - - - - Replaces the configuration tree with the specified alternative - - - - - - Replaces the configuration tree with the specified alternative - - - - - - Writes a diagnostic page to the specified physical path - - - - - - Returns a string of the diagnostics page - - - - - - Gets the current (app-wide) config instance. - - - - - - Access and modify plugins - - - - - Access and modify settings related to the HttpModule pipline. Register URL rewriting hooks, etc. - - - - - Returns a shared instance of ImageManager, (or a subclass if it has been upgraded). - Instances change whenever ImageBuilderExtensions change. - - - - - - The ResizeConfigrationSection is not thread safe, and should not be modified - Dynamically loads the ResizerSection from web.config when accessed for the first time. - If the resizer node doesn't exist, an empty configuration object is created with just the root resizer node. - - - - - Returns a list of all issues reported by the resizing core, as well as by all the plugins - - - - - Creates a 'gatherer' that pulls issues from IIssueProviders throughout the Config structure. Even plugins are queried. - - - - - - Security and stability issues. - - - - - Behavioral issues, such as having no registered image encoders - - - - - Errors in the module configuration - - - - - Non-optimal settings - - - - - Domain-relative path which also includes the path info portion. I.e, '/app/folder/file.aspx/path/info' could be a valid value. Relative to the domain root, not the site or app root. - - - - - True if the specified extension is one that the pipeline can handle - - - - - - - True if the querystring contains any directives that are understood by the pipeline - - - - - - - Removes the first fake extension detected at the end of 'path' (like image.jpg.ashx -> image.jpg). - - - - - - - Returns an ImageBuilder instance to use for image processing. - - - - - - Returns a ICacheProvider instance that provides caching system selection and creation. - - - - - - Returns an IVirtualFile instance if the specified file exists. - - - - - - - - Returns true if (a) A registered IVirtualImageProvider says it exists, or (b) if the VirtualPathProvider chain says it exists. - - - - - - - - The key in Context.Items to store the modified querystring (i.e, post-rewrite). - Allows VirtualPathProviders to access the rewritten data. - - - - - The key in Context.Items to store the IResponseArgs object - - - - - The key in Context.Items to set if we want to cancel MVC routing for the request - - - - - The key in Context.Items to access a the path to use instead of Request.path - - - - - The behavior to use when accessing the file system. - - - - - Get or sets whether the file extension check should be applied to the current request. Defaults to true. - If set to true, will only affect the current request, and will only cause the Resizer to evaluate the rewriting rules on the request. - Processing may still not occur if no querystring values are specified. Add 'cache=always' to force caching to occur. - - - - - True once the InterceptModule has been installed. - - - - - Returns the value of Context.Items["resizer.newPath"] if present. If not, returns FilePath + PathInfo. - Sets Context.Items["resizer.newPath"]. - Only useful during the Pipeline.PostAuthorizeRequestStart event. - - - - - Populates the cache if it is empty. Not thread safe. - - - - - The specified path must not include a querystring. Slashes, spaces, question marks, ampersands, and colons are not permitted in the extension. - If it contains a multipart extension like .txt.zip, only "zip" will be recognized. Must contain a dot - passing in "jpg" will fail. - - - - - - - Returns true if any of the querystring keys match any of the directives supported by the pipeline (such as width, height, format, bgcolor, etc) - - - - - - - Removes the first fake extensionm detected at the end of 'path' - - - - - - - Returns either an IVirtualFile instance or a VirtualFile instance. - - - - - - - - Returns true if (a) A registered IVirtualImageProvider says it exists, or (b) if the VirtualPathProvider chain says it exists. - - - - - - - - Cache selection occurs as follows: (1) The first registered CachingSystem that returns true from .CanProcess() is the default - (2) The SelectCachingSystem event is fired, allowing handlers to modify the selected cache. - This method may return null. - - - - - - - - Returns a unqiue copy of the image extensions supported by the pipeline. Performs a cached query to all registered IQuerystringPlugin instances. - Use IsAcceptedImageType for better performance. - - - - - Returns a unqiue copy of all querystring keys supported by the pipeline. Performs a cached query to all registered IQuerystringPlugin instances. - Use HasPipelineDirective for better performance. (binary search) - - - - - Cached access to pipeline.fakeExtensions - - - - - Returns the value of Context.Items["resizer.newPath"] if present. If not, returns FilePath + PathInfo. - Sets Context.Items["resizer.newPath"]. - Only useful during the Pipeline.PostAuthorizeRequestStart event. - - - - - Returns the modified query string. If never set, returns a copy of Request.QueryString. - Returns the same instance if called multiple times. Copy it if you want to make changes without causing issues. - - - - - Get or sets whether the file extension check should be applied to the current request. Defaults to true. - If set to true, will only affect the current request, and will only cause the Resizer to evaluate the rewriting rules on the request. - Processing may still not occur if no querystring values are specified. Add 'cache=always' to force caching to occur. - - - - - Returns true if the current request is being processed and/or cached by the pipeline. - Will return false until *after* the FileExists method is called on the VirtualPathProviders, which is after the - AuthorizeImage event fires. - This will return a usable value if used from VirtualFile.Open(), or if used inside the PreHandleImage event or later. - - - - - Fired once, on the first PostAuthorizeRequest event. - - - - - Fires during the PostAuthorizeRequest phase, prior to any module-specific logic. - Executes for every request to the website. Use only as a last resort. Other events occur only for image requests, and thus have lower overhead. - - - - - Fired during PostAuthorizeRequest, after ResizeExtension has been removed. - On fired on requests with extensions that match supported image types. - - You can add additonal supported image extentions by registering a plugin that implementes IQuerystringPlugin, or you can add an - extra extension in the URL and remove it here. Example: .psd.jpg - - - - - Fired during PostAuthorizeRequest, after Rewrite. - Any changes made here (which conflict) will be overwritten by the the current querystring values. I.e, this is a good place to specify default settings. - Only fired on accepted image types. (see Rewrite) - - - - - Fired after all other rewrite events. - Only fired on accepted image types. (see Rewrite) - - - - - Fired after all rewriting is finished. - e.AllowAccess defaults to the result of the UrlAuthorization module's verdict. It can be changed. - Set e.AllowAccess to true to cause and 403 Access Dened result. - - - - - Fired when the specified image doesn't exist. Only called for images that would normally be processed. - May be called during PostAuthorizeRequest or later - End the request completely with a redirect if you want alternate behavior. - - - - - Fired immediately before the image request is sent off to the caching system for proccessing. - Allows modification of response headers, caching arguments, and callbacks. - - - - - The number of images processed by this pipeline. - - - - - True once the InterceptModule has been installed and is intercepting requests. - - - - - Provides thread-safe access to plugin addition, removal, and querying methods - - - - - A provider (or selector) of IEncoder instances. - - - - - Returns an encoder based on the provided settings and the source object - - Request settings, like format, quality, colors, dither, etc. - May be a Drawing.Image instance, a path, or null. To provide both, set Image.tag to the path. Helps the encoder detect the original format if the format was not specified. - - - - - Creates a new plugin config section, attached to the specified parent - - - - - - Processes the <plugins> section if they are not already loaded. Thread safe. - Only executes once. - - - - - Forces loading of the plugins specified in configuration, even if they have already been loaded. Will add duplicate plugins and throw exceptions if you do not call RemoveAll() first. - - - - - Not thread safe. Performs actual work. - - - - - Returns the subset of installed plugins which implement the specified type or interface - - - - - - - Returns all registered instances of the specified plugins - - - - - - - Returns true if at least one plugin of the specified type is registered. - - - - - - - Returns true if 1 or more instances of the type are registered. - - - - - - - Returns the first registerd instance of the specified plugin. For IMultiInstancePlugins, use GetAll() - - - - - - - Returns the first registered instance of the specified plugin, or creates a new instance if the plugin isn't installed. - - - - - - - Returns the first registered instance of the specified plugin, or installs the given instance instead, then re-tries the query - - - - - - - - Installs the specified plugin, returning the plugin instance. - Convenience method, same as plugin.Install(Config.Current). - - - - - - - Attempts uninstallation of the specified plugin, returning true if successful. - Convenience method, same as plugin.Uninstall(Config.Current). - - - - - - - Returns an instance of the first encoder that claims to be able to handle the specified settings. - Returns null if no encoders are available. - - Request settings, like format, quality, colors, dither, etc. - May be a Drawing.Image instance, a path, or null. To provide both, set Image.tag to the path. Helps the encoder detect the original format if the format was not specified. - May also be used for palette generation hinting by some encoders. - - - - - This is called to get a sorted list of plugins based on their likelyhood of having the plugin. - - - - - - - - Searches all loaded assemblies for the specified type, applying rules and prefixes to resolve the namespace and assembly. - Returns null if it could not find the type, and logs an issue. - - - - - - - For use only by plugins during .Uninstall. - Removes the specified plugin from AllPlugins, QuerystringPlugins, CachingSystems, ImageEncoders, and ImageBuiderExtensions, based - on which interfaces the instance implements. - Plugins may register event handlers and modify settings - thus you should use the plugin's method to uninstall them vs. using this method. - - - - - - Only for use by plugins during IPlugin.Install. Call Plugin.Install instead of this method, since plugins often must perform other initialization actions. - Adds the specified plugin to AllPlugins, QuerystringPlugins, CachingSystems, ImageEncoders, and ImageBuiderExtensions, based - on which interfaces the instance implements. For ICache and IEncoder, the plugin is inserted at the beginning of CachingSystems and ImageEncoders respectively. - To reiterate, plugins may register event handlers and modify settings - thus you should use the plugin's method to uninstall them vs. using this method. - Will not register a plugin that is already installed, unless it implementes IMultiInstancePlugin. - - - - - - Removes all plugins, of every kind. Logs any errors encountered. (Not all plugins support uninstallation) - - - - - Returns true if the <plugins> section has been processed - - - - - Currently registered ICurrentConfigProviders. - - - - - Currently registered set of ImageBuilderExtensions. - - - - - Currently registered IEncoders. - - - - - Currently registered ICache instances - - - - - Plugins which accept querystring arguments are registered here. - - - - - Plugins which accept new file extensions (in the url) are registered here. - - - - - Plugins which provide virtual files are registered here. - - - - - Plugins which modify image processing settings. - - - - - All plugins should be registered here. Used for diagnostic purposes. - - - - - Returns the most recently registered Logging plugin, or null. - - - - - No support for namespaces, no intention of eventual serialization. - Everything is case-insensitive, but preserves case. Not thread safe. - - - - - Builds a tree of Nodes from the specified XML subtree. Duplicate attributes are sent to 'ir' - - - - - - - Returns the subset of Children with a matching element name. (Case-insensitive) - - - - - - - Queryies the subtree for the specified attribute on the specified element. Example selector: element.element.attrname - Assumes that the last segment of the selector is an attribute name. - Throws an ArgumentException if there is only one segment ( element ). - Uses the cache. - - - - - - - Sets the specified attribute value, creating parent elements if needed. Clears the query cache. - - - - - - - Sets the specified attribute value, creating parent elements if needed. Clears the query cache. - - - - - - - - Traverses the specified path, creating any missing elements along the way. Uses existing nodes if found. - - - - - - - Same as query(), except results are cached until clearQueryCache() is called. - Faster, but can be incorrect if existing nodes are renamed, moved, or deleted. - - - - - - - Makes a recusive copy of the subtree, keeping no duplicate references to mutable types. - - - - - - Attributes - - - - - Access attributes by name - - - - - - - The concatenated text, significant whitespace, and entity references within this element. - Not XML compliant for sure. - - - - - The name of the element. - - - - - Child nodes - - - - - Returns true if the element has neither attributes nor children. - - - - - Encapsulates a node/attribute selection query, such as "node.node.attribute" - - - - - Returns a subset of the list starting at the specified index - - - - - - - Adds drop shadow capabilities (shadowColor, shadowOffset, and shadowWidth commands) - - - - - Draws a gradient around the specified polygon. Fades from 'inner' to 'outer' over a distance of 'width' pixels. - - - - - - - - - - Returns an new NameValueCollection instance that only includes the "preset" and ("hmac" and "urlb64", if specified) querystring pairs from the specified instance. - - - - - - - - If true, the plugin will block all commands except those specified in a preset, and the &preset command itself. - Only applies to InterceptModule (the URL API). Does not apply to ImageBuilder.Build calls. To replicate the behavior, simply prevent any querystring keys except 'preset' from being passed to ImageBuilder.Build. - - - - - Allows multi-tenancy support. The 'root' config only needs one plugin, which implements this interface. - - - - - Returns a Config instance appropriate for the current request. If null is returned, the default/root instance will be used. - Implementations MUST return the same instance of Config for two identical requests. Multiple Config instances per tenant/area will cause problems. - MUST be thread-safe, concurrent calls WILL ocurr, and WILL occur during initial call. - - - - - - Provides license verification and enforcement services. Do not access directly; use your local embedded static method to verify instance integrity. - - - - - Notify the license service that the given feature is being used for the given domain. - - - - - - - - Configure the display name for the given feature id - - - - - - - Returns a changing shared secret to make interface hijacking difficult. - - - - - - - Returns a plaintext report on licensing status - - If true, pending verifications will be completed before the method returns - - - - - Provides a place to cache/store licenses. Only responsible for licenses used by plugins attached to the current Config instance. - - - - - Returns a collection containing all licenses for the plugin's Config instance, in encrypted binary form. - - - - - - Stores the given licenses (excluding those present in web.config). - - A collection of 'description' and 'encrypted binary license' pairs. - - - - Permits plugins to redact data from the diagnostics page, like passwords - - - - - Implement this if you are caching files provided by a virtual image provider (For example, remote or s3-hosted images). - - - - - Returns a cached copy of virtual file if it is cached, and if caching is desired. - - - - - - - - - For plugins that add support for new source file image extensions. - - - - - If the plugin adds support for new file extensions (such as "psd"), they should be returned by this method. - - - - - - Can be used by plugins to implement 'trial version' functionality. Not currently used. - - - - - The Trial plugin cannot be removed using this method. - - - - - - - Determines when the diagnostics page can be viewed. - - - - - Diagnostics are disabled - - - - - Only local requests can access diagnostics - - - - - All hosts can view diagnostics. - - - - - Provides the incredibly helpful /resizer.debug page we all love. - - Mimics the behavior of customErrors by default. Not available if CustomErrors=true or retail=true. Available only to localhost if customErrors=RemoteOnly. - Can be overriden by adding in the <resizer> section <diagnostics enableFor="None|AllHosts|LocalHost" /> - - - - - - True if diagnostics can be displayed to the current user. - If <diagnostics enableFor="None" />, returns false. - If <diagnostics enableFor="Localhost" />, returns false for remote requests - If <diagnostics enableFor="AllHosts" />, returns true. - If unspecified, uses the same behavior as ASP.NET Custom Errors. - - - - - - - Returns the ASP.NET trust level - - - - - - Tag your plugin with this interface if it supports having multiple instances registered at once - - - - - Wraps a standard ASP.NET VirtualFile instance in an IVirtualFile-compatible wrapper. - - - - - The VirtualFile instance this class is wrapping - - - - - Handles reading the <resizer> section from Web.Config - - - - - Create a ResizerSection instance that wraps the specified node. The node should be a <resizer> element. - - - - - - Parse the specified XML into a Node. The text should include 1 root element, <resizer> - - - - - - Returns the specified subtree, deep copied so it can be used without locking. - - - - - - - Called for each child element not specified declaratively - - - - - - - - SafeList is mutable, but it uses immutable data structures to minimize the need for locking. - The provided manipulation - Exposes a immutable list. Changes are made by copying the lists. - SafeList is - Never perform logic on SafeList directly, always use GetList() or GetCollection() first, followed by SetList(). - If you need involved list-fu, use ModifyList and specify a callback. It will execute inside a lock, preventing changes on other threads from overwriting each other. - - - - - - Returns an immutable snapshot of the collection - - - - - - Returns a mutable snapshot of the list - - - - - - Replaces the current collection with a new one. (copied to ensure safety) - Use ModifyList when modifying the list. Use this only when the previous or current state of the list is irrelevant. - - - - - - Adds the specified item to the end of the list - - - - - - Removes the item from the list - - - - - - Adds the specified item to the beginning of the list - - - - - - Allows a caller to perform logic on the list inside a lock, and return a modified list. - Callbacks should be fast, and should reference the IList they are fed, not this SafeList instance. - Calling methods on the SafeList instance will cause a deadlock. - - - - - - Returns true if the collection contains the specified item at the moment. - - - - - - - Returns the first item in the list. May return null if the list is empty. - - - - - Returns the first item in the list. May return null if the list is empty. - - - - - Provides basic encoding functionality for Jpeg, png, and gif output. Allows adjustable Jpeg compression, but doesn't implement indexed PNG files or quantized GIF files. - - - - - An image encoder. Exposes methods for suitability checking, encoding, transparency compatibility checking, and mime-type/extension calculation. - - - - - If the encoder can handle the requirements specified by 'settings' and 'source', it should return an encoder instance. - If not, it should return null. - - Request settings, like format, quality, colors, dither, etc. - May be a Drawing.Image instance, a path, or null. To provide both, set Image.tag to the path. Helps the encoder detect the original format if the format was not specified. - May also be used for palette generation hinting by some encoders. - - - - - Encodes the image to the specified stream - - - - - - - True if the output format will support transparency as it is currently configured. - - - - - Returns the appropriate mime-time for the output format as currently configured. - - - - - Returns a file extension appropriate for the output format as currently configured, without a leading dot. - - - - - Returns true if the this encoder supports the specified image format - - - - - - - Writes the specified image to the stream using Quality and OutputFormat - - - - - - - Tries to parse an ImageFormat from the settings.Format value. - If an unrecogized format is specified, returns null. - If an unsupported format is specified, it is returned. - If *no* format is specified, returns defaultValue. - - - - - - - - Attempts to determine the ImageFormat of the source image. First attempts to parse the path, if a string is present in original.Tag. (or if 'original' is a string) - Falls back to using original.RawFormat. Returns null if both 'original' is null. - RawFormat has a bad reputation, so this may return unexpected values, like MemoryBitmap or something in some situations. - - The source image that was loaded from a stream, or a string path - - - - - Returns the ImageFormat enumeration value based on the extension in the specified physical path. Extensions can lie, just a guess. - - - - - - - Returns an string instance from the specfied ImageFormat. First matching entry in imageExtensions is used. - Returns null if not recognized. - - - - - - - Returns a dict of (lowercase invariant) image extensions and ImageFormat values - - - - - Returns an ImageFormat instance from the specfied file extension. Extensions lie sometimes, just a guess. - returns null if not recognized. - - - - - - - NOT thread-safe! - - - - - - - Supports Png, Jpeg, Gif, Bmp, and Tiff. Throws a ArgumentOutOfRangeException if not png, jpeg, gif, bmp, or tiff - - - - - - - Returns the first ImageCodeInfo instance with the specified mime type. Returns null if there are no matches. - - - - - - - Saves the specified image to the specified stream using jpeg compression of the specified quality. - - - A number between 0 and 100. Defaults to 90 if passed a negative number. Numbers over 100 are truncated to 100. - 90 is a *very* good setting. - - - - - - Saves the image in png form. If Stream 'target' is not seekable, a temporary MemoryStream will be used to buffer the image data into the stream - - - - - - - Returns the querystring keys used by DefaultEncoder (quality, format, and thumbnail) - - - - - - Returns signatures for jpeg, bmp, gif, png, wmf, ico, and tif - - - - - - If you set this to anything other than Gif, Png, or Jpeg, it will throw an exception. Defaults to Jpeg - - - - - 0..100 value. The Jpeg compression quality. 90 is the best setting. Not relevant in Png or Gif compression - - - - - Returns true if the desired output type supports transparency. - - - - - Returns the default mime-type for the OutputFormat - - - - - Returns the default file extesnion for OutputFormat - - - - - Implements app-wide size Limits on image size - - - - - The image and total size limits - - - - - What to do about remaining handlers/methods for the specified section - - - - - Does nothing - - - - - Requests that ImageBuilder cancels the default logic of the method, and stop executing plugin calls for the method immediately. - - - - - Represents the widths of edges of a box. - - - - - Create a box with all edges the same width. - - - - - - Create a box, specifying individual widths for each size - - - - - - - - - Copies the specified BoxPadding instance - - - - - - Sets the width of all edges, returning a new instance - - - - - - - Gets edge offsets as a clockwise array, starting with Top. - - - - - - Returns double.NaN unless all edges are the same width, in which case that width is returned - - - - - Returns an instance with a width of 0 - - - - - Returns true if th - - - - - Output image formats - - - - - Jpeg - the best format for photographs and thumbnails - - - - - The best format for transparent images and vector graphics - - - - - A really poor choice for pretty much everything except animation - - - - - When to disk cache the image - - - - - Request no disk caching of the resulting image. - - - - - Request that the resulting image always be disk cached on the server, even if no modifications are made. - - - - - Default caching behavior. Modified images are disk cached, unmodified images are not. - - - - - When to process and re-encode the file. - - - - - Request no processing of the image or file (generally used with cache=always). - The file contents will be used as-is. - - - - - Require the file or image to be processed. Will cause non-image files to fail with an ImageCorruptedException. - - - - - Default. Only files with both a supported image extension and resizing settings specified in the querystring will be processed. - - - - - Controls whether the image is allowed to upscale, downscale, both, or if only the canvas gets to be upscaled. - - - - - The default. Only downsamples images - never enlarges. If an image is smaller than 'width' and 'height', the image coordinates are used instead. - - - - - Only upscales (zooms) images - never downsamples except to meet web.config restrictions. If an image is larger than 'width' and 'height', the image coordinates are used instead. - - - - - Upscales and downscales images according to 'width' and 'height', within web.config restrictions. - - - - - When the image is smaller than the requested size, padding is added instead of stretching the image - - - - - [Deprecated (Use FitMode.Stretch)] Previously used to force an image to be 'stretched' to match a different aspect ratio. - - - - - [Deprecated (Use FitMode)] Maintains aspect ratio. Default. - - - - - [Deprecated (Use FitMode)] Skews image to fit the new aspect ratio defined by 'width' and 'height' - - - - - How to resolve aspect ratio differences between the requested size and the original image's size. - - - - - Fit mode will be determined by other settings, such as &carve=true, &stretch=fill, and &crop=auto. If none are specified and width/height are specified , &mode=pad will be used. If maxwidth/maxheight are used, &mode=max will be used. - - - - - Width and height are considered maximum values. The resulting image may be smaller to maintain its aspect ratio. The image may also be smaller if the source image is smaller - - - - - Width and height are considered exact values - padding is used if there is an aspect ratio difference. Use &anchor to override the MiddleCenter default. - - - - - Width and height are considered exact values - cropping is used if there is an aspect ratio difference. Use &anchor to override the MiddleCenter default. - - - - - Width and height are considered exact values - seam carving is used if there is an aspect ratio difference. Requires the SeamCarving plugin to be installed, otherwise behaves like 'pad'. - - - - - Width and height are considered exact values - if there is an aspect ratio difference, the image is stretched. - - - - - Default. No cropping - uses letterboxing if strecth=proportionally and both width and height are specified. - - - - - [Deprecated] Use Mode=Crop. Minimally crops to preserve aspect ratio if stretch=proportionally. - - - - - Crops using the custom crop rectangle. Letterboxes if stretch=proportionally and both widht and height are specified. - - - - - Indicates the crop units are pixels on the original image. - - - - - Indicates a custom range is being specified for the values. Base 0. - - - - - Horizontal and vertical flipping. Convertible to System.Drawing.RotateFlipType by casting. - - - - - No flipping - - - - - Flip horizontally - - - - - Flip vertically (identical to 180 degree rotation) - - - - - Flip horizontally and vertically - - - - - Anchor location. Convertible to System.Drawing.ContentAlignment by casting. - - - - - Content is vertically aligned at the top, and horizontally aligned on the left. - - - - - Content is vertically aligned at the top, and horizontally aligned at the center. - - - - - Content is vertically aligned at the top, and horizontally aligned on the right. - - - - - Content is vertically aligned in the middle, and horizontally aligned onthe left. - - - - - Content is vertically aligned in the middle, and horizontally aligned at the center. - - - - - Content is vertically aligned in the middle, and horizontally aligned on the right. - - - - - Content is vertically aligned at the bottom, and horizontally aligned on the left. - - - - - Content is vertically aligned at the bottom, and horizontally aligned at the center. - - - - - Content is vertically aligned at the bottom, and horizontally aligned on the right. - - - - - Modes of converting the image to Grayscale. GrayscaleMode.Y usually produces the best resuts - - - - - The reccomended value. Y and NTSC are identical. - - - - - Red, green, and blue are averaged to get the grayscale image. Usually produces poor results compared to other algorithms. - - - - - The Jpeg subsampling mode to use. Requires FreeImageEncoder, FreeImageBuilder, WicEncoder, or WicBuilder. - - - - - The encoder's default subsampling method will be used. - - - - - 411 Subsampling - Only supported by FreeImageBuilder and FreeImageEncoder. Poor quality. - - - - - 420 Subsampling - Commonly used in H262 and H264. Low quality compared to 422 and 444. - - - - - 422 Subsampling - Great balance of quality and file size, commonly used in high-end video formats. - - - - - 444 subsampling - Highest quality, largest file size. - - - - - 444 subsampling - Highest quality, largest file size. - - - - - Provides methods for generating resized images, and for reading and writing them to disk. - Use ImageBuilder.Current to get the current instance (as configured in the application configuration), or use ImageBuilder.Current.Create() to control which extensions are used. - - - - - Shouldn't be used except to make a factory instance. - - - - - Create a new instance of ImageBuilder using the specified extensions, encoder provider, file provider, and settings filter. Extension methods will be fired in the order they exist in the collection. - - - - - - - - - Creates another instance of the class using the specified extensions. Subclasses should override this and point to their own constructor. - - - - - - - - - - Copies the instance along with extensions. Subclasses must override this. - - - - - - Loads a Bitmap from the specified source. If a filename is available, it will be attached to bitmap.Tag in a BitmapTag instance. The Bitmap.Tag.Path value may be a virtual, relative, UNC, windows, or unix path. - Does not dispose 'source' if it is a Stream or Image instance - that's the responsibility of the calling code. - - May be an instance of string, VirtualFile, IVirtualFile IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. If passed an Image instance, the image will be cloned, which will cause metadata, indexed state, and any additional frames to be lost. Accepts physical paths and application relative paths. (C:\... and ~/path) - Will ignore ICC profile if ?ignoreicc=true. - A Bitmap. The .Tag property will include a BitmapTag instance. If .Tag.Source is not null, remember to dispose it when you dispose the Bitmap. - - - - Returns a dictionary of information about the given image. - - - Pass null to get the defaults ("source.width", source.height") - - - - - Loads a Bitmap from the specified source. If a filename is available, it will be attached to bitmap.Tag in a BitmapTag instance. The Bitmap.Tag.Path value may be a virtual, relative, UNC, windows, or unix path. - Does not dispose 'source' if it is a Stream or Image instance - that's the responsibility of the calling code. - - May be an instance of string, VirtualFile, IVirtualFile IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. If passed an Image instance, the image will be cloned, which will cause metadata, indexed state, and any additional frames to be lost. Accepts physical paths and application relative paths. (C:\... and ~/path) - Will ignore ICC profile if ?ignoreicc=true. - If true, the position of the source stream will be restored after being read - A Bitmap. The .Tag property will include a BitmapTag instance. If .Tag.Source is not null, remember to dispose it when you dispose the Bitmap. - - - - Decodes the stream into a System.Drawing.Bitmap instance. As of 3.0.7, now ensures the stream can safely be closed after the method returns. - May copy the stream. The copied stream will be in b.Tag.Source. Does not close or dispose any streams. - - - - - - - - - For plugin use only. - Returns a stream instance from the specified source object and settings object. - To exend this method, override GetStream. - - The physical or app-relative path, or a VirtualFile, IVirtualFile, Stream, HttpPostedFile, or HttpPostedFileBase instance. - Querystring settings to pass to the VirtualFileProvider - You should externally initialize this to true, unless the user-provided 'source' is a Stream instance. Will be set to false for HttpPostedFile and HttpPostedFileBase instances, so they can be reused. - The physical or virtual path associated with the stream (if present). Otherwise null - True if you should save and restore the seek position of the stream. True for HttpPostedFile and HttpPostedFileBase instances. - - - - - Resizes and processes the specified source image and returns a bitmap of the result. - Note! - This method assumes that transparency will be supported in the final output format, and therefore does not apply a matte color. Use &bgcolor to specify a background color - if you use this method with a non-transparent format such as Jpeg. - If passed a source Stream, Bitmap, or Image instance, it will be disposed after use. Use disposeSource=False to disable that behavior. - - May be an instance of string (a physical path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. - Resizing and processing command to apply to the. - - - - Resizes and processes the specified source image and returns a bitmap of the result. - Note! - This method assumes that transparency will be supported in the final output format, and therefore does not apply a matte color. Use &bgcolor to specify a background color - if you use this method with a non-transparent format such as Jpeg. - - If passed a source Stream, Bitmap, or Image instance, it will not be disposed unless disposeSource=true. - - May be an instance of string (a physical path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. - Resizing and processing command to apply to the. - If false, 'source' will not be disposed. - - - - Resizes and processes the specified source image and stores the encoded result in the specified destination. - If passed a source Stream, Bitmap, or Image instance, it will be disposed after use. Use disposeSource=False to disable that behavior. - - May be an instance of string (a physical path or app-relative virtual path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. App-relative virtual paths will use the VirtualPathProvider system - May be a physical path (string), or a Stream instance. Does not have to be seekable. - Resizing and processing command to apply to the image. - - - - Resizes and processes the specified source image and stores the encoded result in the specified destination. - If passed a source Stream, Bitmap, or Image instance, it will be disposed after use. Use disposeSource=False to disable that behavior. - - May be an instance of string (a physical path or app-relative virtual path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. App-relative virtual paths will use the VirtualPathProvider system - May be a physical path (string), or a Stream instance. Does not have to be seekable. - Resizing and processing command to apply to the image. - - - - Resizes and processes the specified source image and stores the encoded result in the specified destination. - If passed a source Stream, Bitmap, or Image instance, it will not be disposed unless disposeSource=true. - - May be an instance of string (a physical path or app-relative virtual path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. App-relative virtual paths will use the VirtualPathProvider system - May be a physical path (string), or a Stream instance. Does not have to be seekable. - Resizing and processing command to apply to the image. - True to dispose 'source' after use. False to leave intact. - - - - Resizes and processes the specified source image and stores the encoded result in the specified destination. - If passed a source Stream, Bitmap, or Image instance, it will not be disposed unless disposeSource=true. - If passed a path destination, the physical path of the written file will be returned. - - May be an instance of string (a physical path or app-relative virtual path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. App-relative virtual paths will use the VirtualPathProvider system - May be a physical path (string), or a Stream instance. Does not have to be seekable. - Resizing and processing command to apply to the image. - True to dispose 'source' after use. False to leave intact. - If true, will add the correct file extension to 'dest' if it is a string. - - - - The most flexible method for processing an image - - - - - - - Override this when you need to override the behavior of image encoding and/or Bitmap processing - Not for external use. Does NOT dispose of 'source' or 'source's underlying stream. - - - - - - - - Override this when you need to override the behavior of Bitmap processing. - Not for external use. Does NOT dispose of 'source' or 'source's underlying stream. - - - - True if the output method will support transparency. If false, the image should be provided a matte color - - - - - Processes an ImageState instance. Used by Build, GetFinalSize, and TranslatePoint. - Can be overriden by a plugin with the OnProcess method - - - - - - Process.3: Handles the layout phase of Processing - - - - - - Handles the rendering phase of processing - - - - - - Process.1 Switches the bitmap to the correct frame or page, and applies source flipping commands - - - - - - - Creates a bitmap of s.destSize dimensions, intializes a graphics object for it, and configures all the default settings. - - - - - - Sets the background color if needed or requested - - - - - - Doesn't support flipping. Translate a point on the original bitmap to a point on the new bitmap. If the original point no longer exists, returns Empty - - - - - - Gets the final size of an image - - - - - - Gets the final size of an image - - - - - - Populates copyRect, as well as Rings image and imageArea. Translates and scales any existing rings as if they existed on the original bitmap. - - - - - - Returns a list of the file extensions ImageBuilder can load by default. Plugins can implement IFileExtensionPlugin to add new ones. - - - - - - Returns a list of the querystring commands ImageBuilder can parse by default. Plugins can implement IQuerystringPlugin to add new ones. - - - - - - Handles the encoder selection and provision proccess. - - - - - May be null. A class to modify or normalize ResizeSettings instances before they are used. - - - - - Provides a resolution service for app-relative URLs. - - - - - Returns a shared instance of ImageBuilder or a subclass, equivalent to Config.Current.CurrentImageBuilder - - - - - - Monitors incoming image requests to determine if resizing (or other processing) is being requested. - - - - - Called when the app is initialized - - - - - - This is where we filter requests and intercept those that want resizing performed. - We first strip FakeExtension, then verify the remaining file extension is supported for decoding. - We fire URL rewriting events. If the result includes any supported querystring params afterwards, we process the request. Otherwise we let it fall back to IIS/ASP.NET. - If the file doesn't exist, we also ignore the request. They're going to cause a 404 anyway. - - - - - - - - Generates the resized image to disk (if needed), then rewrites the request to that location. - Perform 404 checking before calling this method. Assumes file exists. - Called during PostAuthorizeRequest - - - - - - - - - We don't actually send the data - but we still want to control the headers on the data. - PreSendRequestHeaders allows us to change the content-type and cache headers at excatly the last - - - - - - - Current configuration. Same as Config.Current.Pipeline - - - - - A callback method that will resize, encode, and write the data to the given stream. - Callback may throw FileNotFoundException when running on top of an optimistic VPP - - - - - A callback method to return the last modified date of the source file if available, or DateTime.MinValue if not available. - - - - - - Represents an non-recoverable exception that occured while processing the image. - Possible causes are: a corrupted source file, cache resource timeout (such as a locked file in imagecache), - unusable configuration (for example, no registered encoders or caches), invalid syntax, or a size limit was exceeded and the request was stopped by the SizeLimiting extension. - May also be caused by a missing source file/resource, in the form of the ImageMissingException subclass. - - - - - This error message is safe to display to the public (should not contain any sensitive information) - - - - - A source file was corrupted - - - - - One or more source files was missing - - - - - Encapsulates the state of an image being resized. - Can be used to simulate a resize as well as actually perform one. - All code should ignore when Bitmaps and Graphics objects are null, and go about simulating all the mathematical functions as normal. - - - - - - The commands to apply to the bitmap - - - - - The original size of the source bitmap. Use this instead of accessing the bitmap directly for this information, since the bitmap may not always be available - - - - - Rendering choices can depend on whether the output format supports transparency. - - - - - The layout object. Used for calculated and flowing the layout of the various rings around the image (padding, border, effect, margin, etc). - - - - - The size of the target bitmap image. Set after all sizing operations have completed. - - - - - The dimensions of the bitmap afer all operations have been applied to it (Calling FlipRotate can change the bitmap dimensions). - - - - - The rectangular portion of the source image to copy - - - - - The source bitmap. If null, skip drawing commands, but continue layout logic. - - - - - An optional intermediate bitmap, created by plugins who need to process the source bitmap it gets rendered to destBitmap. If defined, it should be used instead of sourceBitmap during RenderImage(), and disposed immediately after use. - - - - - If 'sourceBitmap' is CMYK and `preRenderBitmap` is null, converts `sourceBitmap` to RGB and stores in 'preRenderBitmap' - - - - - Clones 'sourceBitmap' into 'preRenderBitmap' if null. - - - - - Applies copyRect (if it will have any effect), placing the result in preRenderBitmap, and resetting copyRect - - - - - Ensures that the working bitmap is in 32bpp RGBA format - otherwise it is converted. - - - - - The destination bitmap. If null, skip drawing commands, but continue layout logic. - - - - - A graphics object to write to the destination bitmap. If null, skip drawing commands, but continue layout logic. - - - - - Allows color correction/modification during the image copy. - - - - - Disposes sourceBitmap, destGraphics, destBitmap, and copyAttributes if they are non-null - - - - - (read-only) Same as copyRect.Size, convenience property. - - - - - Allows extensions to store data along with the image state - - - - - An ordered, named collection of polygons. - pointsToTranslate, imageOuterEdge, imageAreaOuterEdge. - - - - - - - Inflates the last ring using the specified padding options. Returns the resulting ring object - - - - - - - - Add points this way to see where they will occur on the destination image - - - - - - - - Gets a bounding box that encloses all rings that don't have ExcludeFromBoundingBox set. - - - - - - Rotates all existing rings (Except those flagged ignore) - - - - - - - - Normalizes all rings and invisible polygons so that the outermost ring's bounding box starts at the specified orign. - - - - - - - Scales all rings and invisible polygons by the specified factor, around the specified point. - - - - - - - Translates and scales all rings and invisible polygons as specified. - - - - - - - Access and set the Point[] arrays of rings by key. Case-insensitive. - - - - - - - Returns the last ring that was added. Only returns PointSets where flags = Ring - - - - - This polygon participates in the layout phase, and reserves space when added. Affected by all batch operations. Will be returned by LastRing until a new ring is added. - - - - - Doesn't participate in layout, takes no space, but is affected by batch operations. Will never be returned by LastRing and ignored when calculating bounding boxes. - - - - - Completely ignored by all operations, left intact. - - - - - How the pointsToTranslate should be translated if they are cropped out of the destination image. - - - - - Enforces two kinds of maximum size constraints: a Total size limit, and an Image size limit. - Image limits do not include padding, border, or effect widths, and automatically shrink the 'width/height/maxwidth/maxheight' values to fit within the limits. - Total limits are absolute and apply to the actual result dimensions, causing an exception if they are exceeded. - Limits are checked during the layout phase, prior to resource-intensive bitmap operations. - - - - - The maximum final size an image generated by ImageBuilder can be. - Defaults to 3200x3200 - - - - - What action to take when the total size of the final image would exceed the TotalSize value. - Defaults to ThowException - - - - - Returns true if ImageSize is specified. - - - - - The maximum size an un-rotated image can be drawn when creating a resized image. - Rotation will increase the total size, as will any borders, paddings, margins, or - effects. Not effective at preventing attacks, use totalSize. - If larger values are specified in a querystring, they will automatically - be scaled to fit within these dimensions. - Defaults to 0x0, which means no limits - - - - - - - - - - Provides invariant parsing & serialization of primitive types, like Enums, integers, floats, and booleans. - - - - - Defines a parsing style that permits leading/trailing whitespace, a leading negitve/postiive sign, decimal points, exponential notation, and a thousands separator - - - - - A set of utility methods for manipulating virtual paths - - - - - Should be called SetFullExtension. - Sets the file extension of the specified path to the specified value, returning the result. - If an extension has multiple parts, it will replace all of them. - Leading dots will be stripped from 'newExtension' and re-addd as required. - The querystring and fragment is maintained as-is. Semicolon syntax not supported. - - - - - - - - Removes all extension segments from the filename or URL, leaving the querystring intact. I.e, image.jpg.bmp.tiff?hi would be image?hi - The querystring and fragment is maintained as-is. Semicolon syntax not supported. - - - - - - - Removes the extension from the filename or URL, leaving the querystring intact, where the extension is only the last extension segment. - I.e, image.jpg.bmp.tiff?hi would be image.jpg.bmp?hi after this call. - The querystring and fragment is maintained as-is. Semicolon syntax not supported. - - - - - - - Adds the specified extension to path, returning the result. Multiple calls will result in "path.ext.ext.ext.ext". - The querystring and fragment is maintained as-is. Semicolon syntax not supported. - - - - - - - - Will return the full extension, like ".jpg.ashx", not just the last bit. - Excludes extensions containing spaces or slashes. - The querystring and fragment is ignored. Semicolon syntax not supported. - - - - - - - Grabs the last segment of the filename extension. Returns an empty string if there is no extension, or if the extension contains a space. - Includes the leading '.' - The querystring and fragment is ignored. Semicolon syntax not supported. - - - - - - - Resolves app-relative paths to virtual paths. Does nothing with virtual or relative paths. - - - - - - - Turns relative paths into domain-relative paths. - Turns app-relative paths into domain relative paths. - - - - - - - Joins the path and querystring. If the path already contains a querystring, they are 'append joined' with the correct character. Fragment is maintained as-is. - Does not support the semicolon syntax. - - - - - - - - Removes the query string from the specifed path. If the path is only a querystring, an empty string is returned. Does not support the semicolon syntax. Fragment is maintained as-is. - - - - - - - Overwrites exisisting querystring values in 'path' with the values in 'newQuerystring'. Does not support the semicolon syntax. - - - - - - - - Adds the querystring values in 'newQuerystring' to the querystring in Path, but does not overwrite values. Does not support the semicolon syntax. - - - - - - - - Returns a string querystring in the form "?key=value&key=value". - Keys and values are UrlEncoded as they should be. - - - - - - - Returns a string querystring in the form "?key=value&key=value". - Keys and values are UrlEncoded if urlEncode=true. - - - - - - - - Returns a string querystring in the form ";key=value;key=value". - Keys and values are UrlEncoded if urlEncode=true. - - - - - - - - Build a customized querystring from a NameValueCollection - - - True to URL encode all values - If true, null-valued keys will be skipped - Usually ? or ; - Usually & or ; - Always = - - - - - Like ParseQueryString, but permits the leading '?' to be omitted. Does not support the semicolon syntax. - - - - - - - Like ParseQueryString, but permits the leading '?' to be omitted, and semicolons can be substituted for '&' - - - - - - - Parses the querystring from the given path into a NameValueCollection. - accepts "file?key=value" and "?key=value&key2=value2" formats. (no path is required) - UrlDecodes keys and values. - - - - - - - - - Parses a querystring into a name/value collection. The given string cannot include path or fragment information - it must be *just* the querystring. - - - - - - - - - Converts aribtrary bytes to a URL-safe version of base64 (no = padding, with - instead of + and _ instead of /) - - - - - - - Converts a URL-safe version of base64 to a byte array. (no = padding, with - instead of + and _ instead of /) - - - - - - - Converts aribtrary strings to a URL-safe version of base64 (no = padding, with - instead of + and _ instead of /) - - - - - - - Converts a URL-safe version of base64 to a string. 64U is (no = padding, with - instead of + and _ instead of /) - - - - - - - Returns the physcial mapped path for the specified virtual path if it starts with ~, otherwise retuns the original path. - - - - - - - Generates a resized image url for the specified physical or virtual path. - Not CloudFront compatible. Does not support remote URLs, use RemoteReader for that. - If you're running in IIS classic, add ".ashx" to the 'path' parameter. - - - - - - - - Attempts to guess the virtual path from physical path. Will be thrwarted if the path is mapped as a virtual folder inside the application. - If the path is a non-physical path, it will be returned as is. - Returns null if the physical path isn't a subfolder of the application's physical path. - - - - - - - Replaces variables in paths with their values. Ex. ~/uploads/thumbs/<guid>.<ext>. - Standard variables are <ext> (the default extension for the final file type), <guid>, a randomly generated GUID, - <filename>, the original filename without it's extension, <path>, the original path and filename without extension, - <settings.width>, (any specified settings value except preset), <width> (final width), and <height> (final height). - - - - - - - - - Allows a string to be filtered using the specified whitelisting expression (regex style). - - I.e, "hi YOU 3", "a-z3" will produce "hi3". - - - - - - - - Returns a new collection containing only the specified keys from the old one - - - - - - - - Returns HostingEnvironment.ApplicationVirtualPath or "/", if asp.net is not running - - - - - If not running in ASP.NET, returns the folder containing the DLL. - - - - - A method that resolves variable names to values for the ResolveVariablesInPath method - - - - - - - Defines a collection of utility functions for manipulating polygons. These functions may be (re)moved in future releases; be prepared. - - - - - Rounds the elements of the specified array [not used] - - - - - - - Rounds the elements of the specified array [not used] - - - - - - - Modifies the specified array by applying the specified function to each element. - - - object delegate(object o){} - - - - - Rotates the specified polygon (or set of points) around the origin. - - - - - - - - Rotates the specified polygon (or set of points) around the origin. - - - - - - - - - Returns a clockwise array of points on the rectangle. - Point 0 is top-left. - - - - - - - Moves the polygon so that the upper-left corner of its bounding box is located at 0,0. - - - - - - - Rotates the specified point around the origin. - - - - - - - - Rotates the specified point around the specified origin. - - - - - - - - - Returns a modified version of the specified vector with the desired length. - - - - - - - - Returns a bounding box for the specified set of points. - - - - - - - Returns a bounding box for the specified set of points. Odd points are Y values, even points are X values - - - - - - - Returns a modified version of the array, with each element being offset by the specified amount. - - - - - - - - Returns true if the member elements of the specified arrays match, and the arrays - are of the same length. - - - - - - - - Moves element 4 to spot 3 and truncates to 3 elements. - For compatiblity with Graphics.DrawImage - - - - - - - Determines the width and height of the paralellogram. - - - - - - - Grabs a single-dimension array from a 2 dimensional array, using the specified primary index. - - - - - - - - Approximates a radial brush using a high-rez PathGradientBrush. - - - - - - - - - - Scales 'inner' to fit inside 'bounding' while maintaining aspect ratio. Upscales and downscales. - - - - - - - - Scales 'outer' to be equal or larger than 'innerBounds' while maintaining aspect ratio. Upscales and downscales. - - - - - - - - Scales 'inner' to fit inside 'bounding' while maintaining aspect ratio. Only downscales. - - - - - - - - Returns true if 'inner' fits inside or equals 'outer' - - - - - - - - Returns an array of parallelograms. These parallelgrams are the 'corners' outside each vertex in 'poly'. - The adjacent edges are perpendicular to 'poly'. Point 1 of each parallelogram will match the respective point in 'poly' - Points are clockwise. - - TODO - some rounding issues going on, not exact numbers here - - - - - - - - Returns an array of parallelograms. These parallelgrams are the 'corners' outside each vertex in 'poly'. - The adjacent edges are perpendicular to 'poly'. Point 1 of each parallelogram will match the respective point in 'poly' - Points are clockwise. - - Each float in widths[] corresponds to the point in poly[]. This is the distance to go perpendicularly from - the line beween poly[i] and poly[i +1]. - - - - - - - - - Returns an array of parallelograms. These parallelgrams are the 'sides' bounding the polygon. - Points are clockwise. Point 1 is the top-left outer point, point 2 the top-right, point 3 the bottom-right, and point 4 the bottom-left. - - - - - - - - Expands all sides on the specified polygon by the specified offset. Assumes the polygon is concave. - Returns a new polygon - - - - - - - - Expands all sides on the specified polygon by the specified offsets. Assumes the polygon is concave. - Returns a new polygon. - - - - An array the same size as poly[], with the distances to expand the edges. Edges are between i and i+1 - - - - - Moves 'inner' so that the center of its bounding box equals the center of the bounding box of 'outer' - - - - - - - - Creates a rectangle of size 'size' with a center matching that of bounds. - - - - - - Rounds a floating-point rectangle to an integer rectangle using System.Round - - - - - - - Aligns the specified rectangle object with its reference ('container') rectangle using the specified alignment. The container can be smaller than 'obj'. - - - - - - - - - Aligns the specified polygon with its container (reference) polygon using the specified alignment. The container can be smaller than 'obj'. - - - - - - - - - Returns a point equidistant beweteen A and B - - - - - - - - Verifies that the specified 4 points are not rotated - that each point shares either the x or y coordinate with the previous point - - - - - - Returns the length of the shortest line segment in the given polygon. - - - - - - Returns the distance between two points - - - - - - - - Normalizes the given angle to a positive multiple of 90 degrees between 0 and 270. - - - - - - - Combines the given flipping info and rotation angle into a RotateFlipType value. Rotation angle will snap to nearest 90-degree multiple - - - - - - - - Used for converting custom crop rectangle coordinates into a valid cropping rectangle. Positive values are relative to 0,0, negative values relative to width, height. - X2 and Y2 values of 0 become width and height respectively. - - An array of 4 elements defining x1, y1, x2, and y2 of the cropping rectangle - The width x1 and x2 are relative to - The height y1 and y2 are relative to - The size of the uncropped image - - - - - Returns 'box' clipped to be within 'bounds' - - - - - - - - Expands the given rectangle to be the given size while keeping it centered. - - - - - - - - Expands the given rectangle using the specified scale multipliers, leaving it centered - - - - - - - - - Always implement this if possible. Allows caching systems to detect changes to source files and invalidate cached data properly. - - - - - The modified (last write time) of the source file, in UTC form. - - - - - Represents the settings which will be used to process the image. - Extends NameValueCollection to provide friendly property names for commonly used settings. - Replaced by the Instructions class. Will be removed in V4.0 - - - - - Creates an empty settings collection. - - - - - Copies the specified collection into a new ResizeSettings instance. - - - - - - Parses the specified querystring into name/value pairs. leading ? not required. - Discards everything after the first '#' character as a URL fragment. - - - - - - Merges the specified collection with a set of defaults into a new - ResizeSettings instance. - - - - - - - Parses the specified querystring into name/value pairs and merges - it with defaultSettings in a new ResizeSettings instance. - - - - - - - Creates a new resize settings object with the specified resizing settings - - - - - The desired image format, like 'jpg', 'gif', or 'png'. Leave null if you want to preserve the original format. - - - - Returns true if any of the specified keys are present in this NameValueCollection - - - - - - - If 'thumbnail' and 'format' are not specified, sets 'format' to the specified value. - - - - - - Returns a string containing all the settings in the class, in querystring form. Use ToStringEncoded() to get a URL-safe querystring. - This method does not encode commas, spaces, etc. - - - - - - Returns a querystring with all the settings in this class. Querystring keys and values are URL encoded properly. - - - - - - This method will 'normalize' command aliases to the primary key name and resolve duplicates. - w->width, h->height, sourceFlip->sFlip, thumbnail->format - - - - - Normalizes a command that has two possible names. - If either of the commands has a null or empty value, those keys are removed. - If both the the primary and secondary are present, the secondary is removed. - Otherwise, the secondary is renamed to the primary name. - - - - - - - ["width"]: Sets the desired width of the image. (minus padding, borders, margins, effects, and rotation). - The only instance the resulting image will be smaller is if the original source image is smaller. - Set Scale=Both to upscale these images and ensure the output always matches 'width' and 'height'. - If both width and height are specified, the image will be 'letterboxed' to match the desired aspect ratio. - Change the Mode property to adjust this behavior. - - - - - ["height"]: Sets the desired height of the image. (minus padding, borders, margins, effects, and rotation) - The only instance the resulting image will be smaller is if the original source image is smaller. - Set Scale=Both to upscale these images and ensure the output always matches 'width' and 'height'. - If both width and height are specified, the image will be 'letterboxed' to match the desired aspect ratio. - Change the Mode property to adjust this behavior. - - - - - ["maxwidth"]: Sets the maximum desired width of the image. (minus padding, borders, margins, effects, and rotation). - The image may be smaller than this value to maintain aspect ratio when both maxwidth and maxheight are specified. - - - - - ["quality"]: The jpeg encoding quality to use. (10..100). 90 is the default and best value, you should leave it. - - - - - ["maxheight"]: Sets the maximum desired height of the image. (minus padding, borders, margins, effects, and rotation). - The image may be smaller than this value to maintain aspect ratio when both maxwidth and maxheight are specified. - - - - - ["mode"]: Sets the fit mode for the image. max, min, pad, crop, carve, stretch - - - - - ["rotate"] The degress to rotate the image clockwise. -360 to 360. - - - - - How to anchor the image when cropping or adding whitespace to meet sizing requirements. - - - - - Allows you to flip the entire resulting image vertically, horizontally, or both. Rotation is not supported. - - - - - ["sFlip"] Allows you to flip the source image vertically, horizontally, or both. Rotation is not supported. - - - - - ["scale"] Whether to downscale, upscale, upscale the canvas, or both upscale or downscale the image as needed. Defaults to - DownscaleOnly. See the DefaultSettings plugin to adjust the default. - - - - - [Deprecated] (Replaced by mode=stretch) Whether to preserve aspect ratio or stretch to fill the bounds. - - - - - ["cache"]: Server caching mode suggestion for the result - - - - - ["process"]: Server processing suggestion for the result. Allows you to 'disable' processing of the image (so you can use disk caching with non-image files). Allows you to 'force' processing of the image, for images without a querystring. - - - - - ["crop"]=none|auto Defaults to None - letterboxing is used if both width and height are supplied, and stretch = proportionally. - Set CropTopLeft and CropBottomRight when you need to specify a custom crop rectangle. - - - - - 4 values specify x1,y1,x2,y2 values for the crop rectangle. - Negative values are relative to the bottom right - on a 100x100 picture, (10,10,90,90) is equivalent to (10,10,-10,-10). And (0,0,0,0) is equivalent to (0,0,100,100). - - - - - ["crop"]=([x1],[y1],x2,y2). Sets x1 and y21, the top-right corner of the crop rectangle. If 0 or greater, the coordinate is relative to the top-left corner of the image. - If less than 0, the value is relative to the bottom-right corner. This allows for easy trimming: crop=(10,10,-10,-10). - Set ["cropxunits"] and ["cropyunits"] to the width/height of the rectangle your coordinates are relative to, if different from the original image size. - - - - - ["crop"]=(x1,y1,[x2],[y2]). Sets x2 and y2, the bottom-right corner of the crop rectangle. If 1 or greater, the coordinate is relative to the top-left corner of the image. - If 0 or less, the value is relative to the bottom-right corner. This allows for easy trimming: crop=(10,10,-10,-10). - Set ["cropxunits"] and ["cropyunits"] to the width/height of the rectangle your coordinates are relative to, if different from the original image size. - - - - - ["bgcolor"]: Named and hex values are supported. (rgb and rgba, both 3, 6, and 8 digits). - - - - - Gets/sets ["paddingColor"]. Named and hex values are supported. (rgb and rgba, both 3, 6, and 8 digits). - - - - - ["paddingWidth"]: Gets/sets the width(s) of padding inside the image border. - - - - - ["margin"]: Gets/sets the width(s) of the margin outside the image border and effects. - - - - - Gets/sets ["borderColor"]. Named and hex values are supported. (rgb and rgba, both 3, 6, and 8 digits). - - - - - Friendly get/set accessor for the ["borderWidth"] value. Returns BoxPadding.Empty when unspecified. - - - - - Like this["format"]. - Gets or sets the output file format to use. "png", "jpg", and "gif" are valid values. - Returns null if unspecified. When format is not specified, the original format of the image is used (unless it is not a web safe format - jpeg is the fallback in that scenario). - Also checks the 'thumbnail' value for V2 compatibility. When set, 'thumnail' is removed and only 'format' is used. - - - - - - The width which the X and X2 crop values should be applied. For example, a value of '100' makes X and X2 percentages of the original image width. - This can be set to any non-negative value. Very useful for performing cropping when the original image size is unknown. - 0 indicates that the crop values are relative to the original size of the image. - - - - - The width which the Y and Y2 crop values should be applied. For example, a value of '100' makes Y and Y2 percentages of the original image height. - This can be set to any non-negative value. Very useful for performing cropping when the original image size is unknown. - 0 indicates that the crop values are relative to the original size of the image. - - - - - A Stream utility class that helps to provide seekability to any source - stream. - - - - - Returns a seekable stream for a given source stream. If wrapped, - the source stream will be disposed when the returned stream is. - - The stream to wrap or return. - If the source stream is already seekable, it is returned - unwrapped. If not, it is wrapped in a SeekableStreamWrapper. - - - - Returns a seekable stream for a given source stream. If wrapped, - the source stream will be disposed when the returned stream is. - - The stream to wrap or return. - Whether to dispose the source stream - when the wrapper is disposed. If a wrapper is created, this - parameter will be true on the return to ensure the wrapper - gets properly disposed. - If the source stream is already seekable, it is returned - unwrapped. If not, it is wrapped in a SeekableStreamWrapper. - - - - Disposes the seekable stream wrapper, and the wrapped stream if - originally requested. - - - - - - Gets whether the stream wrapper can be written to or not. - This is only true while the wrapper is being initialized, and - otherwise false for all other callers. - - - - - Copies a read stream to a write stream. - - - - - - - Copies the remaining portion of the specified stream to a byte array of exact size. - - - - - - - Builds a key for the cached version, using the hashcode of the normalized URL. - if subfolders > 1, dirSeparator will be used to separate the subfolder and the key. - No extension is appended. - I.e, a13514\124211ab132592 or 12412ababc12141 - - - - - - - - - Returns a string for the subfolder name. The bits used are from the end of the hash - this should make - the hashes in each directory more unique, and speed up performance (8.3 filename calculations are slow when lots of files share the same first 6 chars. - Returns null if not configured. Rounds subfolders up to the nearest power of two. - - - - - - - - Parses lists in the form "3,4,5,2,5" and "(3,4,40,50)". If a number cannot be parsed (i.e, number 2 in "5,,2,3") defaultValue is used. - - - - - - - - Copies all remaining data from 'source' to 'dest' - - - - - - - Returns RotateNoneFlipNone if not a recognized value. - - - - - - - Returns 0 if not a recognized value. Rounds the value to 0, 90, 180, or 270 - - - - - - Throws an exception if the specified value is unsupported. Rotation values are not supported, and should be specified with the Rotate or srcRotate command. - - - - - - Parses padding, allowing syntax (all) and (left, top, right, bottom). Parens are optional. - - - - - - - Draws a gradient around the specified polygon. Fades from 'inner' to 'outer' over a distance of 'width' pixels. - - - - - - - - - - Functions exactly like an IIS virtual folder, but doesn't require IIS configuration. - - - - - Registers the VirtualFolder plugin as a virtual path provider. - - - - - - Converts relative and app-relative paths to domain-relative virtual paths. - - - - - - - Attempts to convert a phyiscal path into a collapsed rooted physical path. - - - - - - - Collapses any .. segments - - - - - - - Converts any virtual path in this folder to a physical path. Returns null if the virtual path is outside the folder. - - - - - - - Returns true if the specified path is inside this virtual folder - - - - - - - Returns true if (a) we have IOPermission, (b) the path is under our prefix, (c) the - expected physical file does not exist (because we shouldn't interfere in that case), and - (d) the other VPPs don't believe the file exists. - - - - - - - Returns the LastWriteTimeUtc value for the specified virtual file in this folder, or DateTime.MinValue if missing. - - - - - - - Returns true if the file exists in this virtual folder, and would not be masking an existing file. - Returns false if NoIOPermission is true. - - - - - - - - Unless the path is not within the virtual folder, or IO permissions are missing, will return an IVirtualFile instance for the path. - The file may or may not exist. - - - - - - - - For internal use only by the .NET VPP system. - - - - - - - For internal use only by the .NET VPP system. - - - - - - - For internal use only by the .NET VPP system. - - - - - - - - - True if the provider attempted to register itself as a VirtualPathProvider and failed due to limited security clearance. - False if it did not attempt (say, due to missing IOPermission) , or if it succeeded. - - - - - If true, the plugin will attempt to register itself as an application-wide VirtualPathProvider instead of a image resizer-specific IVirtualImageProvider. - - - - - The virtual path served by the VirtualFolder - - - - - The physical path - - - - - True if the plugin has detected it doesn't have sufficient IOPermission to operate. - - - - diff --git a/lib/imageresizer/ImageResizer.dll b/lib/imageresizer/ImageResizer.dll deleted file mode 100644 index 94a482c97cd..00000000000 Binary files a/lib/imageresizer/ImageResizer.dll and /dev/null differ diff --git a/lib/imageresizer/license.txt b/lib/imageresizer/license.txt deleted file mode 100644 index 38064af2cd6..00000000000 --- a/lib/imageresizer/license.txt +++ /dev/null @@ -1,23 +0,0 @@ -Please visit the web page at -http://imageresizing.net/licenses/ - -The core and 18 plugins are free and open-source, under a modified MIT license called the Freedom license. -See http://imageresizing.net/licenses/freedom - -The following DLLs are under the Freedom license: - -* ImageResizer.dll -* ImageResizer.Mvc.dll -* ImageResizer.Plugins.Logging.dll - - -Development of this project is funded by people purchasing Pro and Enterprise licenses -to the 4 paid plugin bundles. Both Pro and Enterprise licenses are as MIT-like as possible, -allowing redistribution, modification, and sub-licensing. - -The free trial license permits use of the paid plugins for development and testing purposes, but not for production use. -http://imageresizing.net/licenses/trial - -Once you begin using them on a production server, you will need a Pro or Enterprise-wide license. - -See http://imageresizing.net/plugins for information on buying licuenses. \ No newline at end of file diff --git a/lib/jquery-utils/jquery.utils.js b/lib/jquery-utils/jquery.utils.js deleted file mode 100644 index b189f9e441b..00000000000 --- a/lib/jquery-utils/jquery.utils.js +++ /dev/null @@ -1,2777 +0,0 @@ -/* - jQuery utils - 0.8.5 - http://code.google.com/p/jquery-utils/ - - (c) Maxime Haineault - http://haineault.com - - MIT License (http://www.opensource.org/licenses/mit-license.php - -*/ - -(function($){ - $.extend($.expr[':'], { - // case insensitive version of :contains - icontains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||"").toLowerCase().indexOf(m[3].toLowerCase())>=0;} - }); - - $.iterators = { - getText: function() { return $(this).text(); }, - parseInt: function(v){ return parseInt(v, 10); } - }; - - $.extend({ - - // Returns a range object - // Author: Matthias Miller - // Site: http://blog.outofhanwell.com/2006/03/29/javascript-range-function/ - range: function() { - if (!arguments.length) { return []; } - var min, max, step; - if (arguments.length == 1) { - min = 0; - max = arguments[0]-1; - step = 1; - } - else { - // default step to 1 if it's zero or undefined - min = arguments[0]; - max = arguments[1]-1; - step = arguments[2] || 1; - } - // convert negative steps to positive and reverse min/max - if (step < 0 && min >= max) { - step *= -1; - var tmp = min; - min = max; - max = tmp; - min += ((max-min) % step); - } - var a = []; - for (var i = min; i <= max; i += step) { a.push(i); } - return a; - }, - - // Taken from ui.core.js. - // Why are you keeping this gem for yourself guys ? :| - keyCode: { - BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, CONTROL: 17, DELETE: 46, DOWN: 40, - END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, - NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, - NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, - PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38 - }, - - // Takes a keyboard event and return true if the keycode match the specified keycode - keyIs: function(k, e) { - return parseInt($.keyCode[k.toUpperCase()], 10) == parseInt((typeof(e) == 'number' )? e: e.keyCode, 10); - }, - - // Returns the key of an array - keys: function(arr) { - var o = []; - for (k in arr) { o.push(k); } - return o; - }, - - // Redirect to a specified url - redirect: function(url) { - window.location.href = url; - return url; - }, - - // Stop event shorthand - stop: function(e, preventDefault, stopPropagation) { - if (preventDefault) { e.preventDefault(); } - if (stopPropagation) { e.stopPropagation(); } - return preventDefault && false || true; - }, - - // Returns the basename of a path - basename: function(path) { - var t = path.split('/'); - return t[t.length] === '' && s || t.slice(0, t.length).join('/'); - }, - - // Returns the filename of a path - filename: function(path) { - return path.split('/').pop(); - }, - - // Returns a formated file size - filesizeformat: function(bytes, suffixes){ - var b = parseInt(bytes, 10); - var s = suffixes || ['byte', 'bytes', 'KB', 'MB', 'GB']; - if (isNaN(b) || b === 0) { return '0 ' + s[0]; } - if (b == 1) { return '1 ' + s[0]; } - if (b < 1024) { return b.toFixed(2) + ' ' + s[1]; } - if (b < 1048576) { return (b / 1024).toFixed(2) + ' ' + s[2]; } - if (b < 1073741824) { return (b / 1048576).toFixed(2) + ' '+ s[3]; } - else { return (b / 1073741824).toFixed(2) + ' '+ s[4]; } - }, - - fileExtension: function(s) { - var tokens = s.split('.'); - return tokens[tokens.length-1] || false; - }, - - // Returns true if an object is a String - isString: function(o) { - return typeof(o) == 'string' && true || false; - }, - - // Returns true if an object is a RegExp - isRegExp: function(o) { - return o && o.constructor.toString().indexOf('RegExp()') != -1 || false; - }, - - isObject: function(o) { - return (typeof(o) == 'object'); - }, - - // Convert input to currency (two decimal fixed number) - toCurrency: function(i) { - i = parseFloat(i, 10).toFixed(2); - return (i=='NaN') ? '0.00' : i; - }, - - /*-------------------------------------------------------------------- - * javascript method: "pxToEm" - * by: - Scott Jehl (scott@filamentgroup.com) - Maggie Wachs (maggie@filamentgroup.com) - http://www.filamentgroup.com - * - * Copyright (c) 2008 Filament Group - * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses. - * - * Description: pxToEm converts a pixel value to ems depending on inherited font size. - * Article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/ - * Demo: http://www.filamentgroup.com/examples/pxToEm/ - * - * Options: - scope: string or jQuery selector for font-size scoping - reverse: Boolean, true reverses the conversion to em-px - * Dependencies: jQuery library - * Usage Example: myPixelValue.pxToEm(); or myPixelValue.pxToEm({'scope':'#navigation', reverse: true}); - * - * Version: 2.1, 18.12.2008 - * Changelog: - * 08.02.2007 initial Version 1.0 - * 08.01.2008 - fixed font-size calculation for IE - * 18.12.2008 - removed native object prototyping to stay in jQuery's spirit, jsLinted (Maxime Haineault ) - --------------------------------------------------------------------*/ - - pxToEm: function(i, settings){ - //set defaults - settings = jQuery.extend({ - scope: 'body', - reverse: false - }, settings); - - var pxVal = (i === '') ? 0 : parseFloat(i); - var scopeVal; - var getWindowWidth = function(){ - var de = document.documentElement; - return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth; - }; - - /* When a percentage-based font-size is set on the body, IE returns that percent of the window width as the font-size. - For example, if the body font-size is 62.5% and the window width is 1000px, IE will return 625px as the font-size. - When this happens, we calculate the correct body font-size (%) and multiply it by 16 (the standard browser font size) - to get an accurate em value. */ - - if (settings.scope == 'body' && $.browser.msie && (parseFloat($('body').css('font-size')) / getWindowWidth()).toFixed(1) > 0.0) { - var calcFontSize = function(){ - return (parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(3) * 16; - }; - scopeVal = calcFontSize(); - } - else { scopeVal = parseFloat(jQuery(settings.scope).css("font-size")); } - - var result = (settings.reverse === true) ? (pxVal * scopeVal).toFixed(2) + 'px' : (pxVal / scopeVal).toFixed(2) + 'em'; - return result; - } - }); - - $.extend($.fn, { - type: function() { - try { return $(this).get(0).nodeName.toLowerCase(); } - catch(e) { return false; } - }, - // Select a text range in a textarea - selectRange: function(start, end){ - // use only the first one since only one input can be focused - if ($(this).get(0).createTextRange) { - var range = $(this).get(0).createTextRange(); - range.collapse(true); - range.moveEnd('character', end); - range.moveStart('character', start); - range.select(); - } - else if ($(this).get(0).setSelectionRange) { - $(this).bind('focus', function(e){ - e.preventDefault(); - }).get(0).setSelectionRange(start, end); - } - return $(this); - }, - - /*-------------------------------------------------------------------- - * JQuery Plugin: "EqualHeights" - * by: Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com) - * - * Copyright (c) 2008 Filament Group - * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php) - * - * Description: Compares the heights or widths of the top-level children of a provided element - and sets their min-height to the tallest height (or width to widest width). Sets in em units - by default if pxToEm() method is available. - * Dependencies: jQuery library, pxToEm method (article: - http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/) - * Usage Example: $(element).equalHeights(); - Optional: to set min-height in px, pass a true argument: $(element).equalHeights(true); - * Version: 2.1, 18.12.2008 - * - * Note: Changed pxToEm call to call $.pxToEm instead, jsLinted (Maxime Haineault ) - --------------------------------------------------------------------*/ - - equalHeights: function(px){ - $(this).each(function(){ - var currentTallest = 0; - $(this).children().each(function(i){ - if ($(this).height() > currentTallest) { currentTallest = $(this).height(); } - }); - if (!px || !$.pxToEm) { currentTallest = $.pxToEm(currentTallest); } //use ems unless px is specified - // for ie6, set height since min-height isn't supported - if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': currentTallest}); } - $(this).children().css({'min-height': currentTallest}); - }); - return this; - }, - - // Copyright (c) 2009 James Padolsey - // http://james.padolsey.com/javascript/jquery-delay-plugin/ - delay: function(time, callback){ - jQuery.fx.step.delay = function(){}; - return this.animate({delay:1}, time, callback); - } - }); -})(jQuery); -/* - jQuery strings - 0.3 - http://code.google.com/p/jquery-utils/ - - (c) Maxime Haineault - http://haineault.com - - MIT License (http://www.opensource.org/licenses/mit-license.php) - - Implementation of Python3K advanced string formatting - http://www.python.org/dev/peps/pep-3101/ - - Documentation: http://code.google.com/p/jquery-utils/wiki/StringFormat - -*/ -(function($){ - var strings = { - strConversion: { - // tries to translate any objects type into string gracefully - __repr: function(i){ - switch(this.__getType(i)) { - case 'array':case 'date':case 'number': - return i.toString(); - case 'object': - var o = []; - for (x=0; x 0) { - o = new Array(Math.ceil(l / p.length)).join(p).substr(0, t = !t ? l : t == 1 ? 0 : Math.ceil(l / 2)) + str + p.substr(0, l - t); - } - return o; - }, - __getInput: function(arg, args) { - var key = arg.getKey(); - switch(this.__getType(args)){ - case 'object': // Thanks to Jonathan Works for the patch - var keys = key.split('.'); - var obj = args; - for(var subkey = 0; subkey < keys.length; subkey++){ - obj = obj[keys[subkey]]; - } - if (typeof(obj) != 'undefined') { - if (strings.strConversion.__getType(obj) == 'array') { - return arg.getFormat().match(/\.\*/) && obj[1] || obj; - } - return obj; - } - else { - // TODO: try by numerical index - } - break; - case 'array': - key = parseInt(key, 10); - if (arg.getFormat().match(/\.\*/) && typeof args[key+1] != 'undefined') { return args[key+1]; } - else if (typeof args[key] != 'undefined') { return args[key]; } - else { return key; } - break; - } - return '{'+key+'}'; - }, - __formatToken: function(token, args) { - var arg = new Argument(token, args); - return strings.strConversion[arg.getFormat().slice(-1)](this.__getInput(arg, args), arg); - }, - - // Signed integer decimal. - d: function(input, arg){ - var o = parseInt(input, 10); // enforce base 10 - var p = arg.getPaddingLength(); - if (p) { return this.__pad(o.toString(), p, arg.getPaddingString(), 0); } - else { return o; } - }, - // Signed integer decimal. - i: function(input, args){ - return this.d(input, args); - }, - // Unsigned octal - o: function(input, arg){ - var o = input.toString(8); - if (arg.isAlternate()) { o = this.__pad(o, o.length+1, '0', 0); } - return this.__pad(o, arg.getPaddingLength(), arg.getPaddingString(), 0); - }, - // Unsigned decimal - u: function(input, args) { - return Math.abs(this.d(input, args)); - }, - // Unsigned hexadecimal (lowercase) - x: function(input, arg){ - var o = parseInt(input, 10).toString(16); - o = this.__pad(o, arg.getPaddingLength(), arg.getPaddingString(),0); - return arg.isAlternate() ? '0x'+o : o; - }, - // Unsigned hexadecimal (uppercase) - X: function(input, arg){ - return this.x(input, arg).toUpperCase(); - }, - // Floating point exponential format (lowercase) - e: function(input, arg){ - return parseFloat(input, 10).toExponential(arg.getPrecision()); - }, - // Floating point exponential format (uppercase) - E: function(input, arg){ - return this.e(input, arg).toUpperCase(); - }, - // Floating point decimal format - f: function(input, arg){ - return this.__pad(parseFloat(input, 10).toFixed(arg.getPrecision()), arg.getPaddingLength(), arg.getPaddingString(),0); - }, - // Floating point decimal format (alias) - F: function(input, args){ - return this.f(input, args); - }, - // Floating point format. Uses exponential format if exponent is greater than -4 or less than precision, decimal format otherwise - g: function(input, arg){ - var o = parseFloat(input, 10); - return (o.toString().length > 6) ? Math.round(o.toExponential(arg.getPrecision())): o; - }, - // Floating point format. Uses exponential format if exponent is greater than -4 or less than precision, decimal format otherwise - G: function(input, args){ - return this.g(input, args); - }, - // Single character (accepts integer or single character string). - c: function(input, args) { - var match = input.match(/\w|\d/); - return match && match[0] || ''; - }, - // String (converts any JavaScript object to anotated format) - r: function(input, args) { - return this.__repr(input); - }, - // String (converts any JavaScript object using object.toString()) - s: function(input, args) { - return input.toString && input.toString() || ''+input; - } - }, - - format: function(str, args) { - var end = 0; - var start = 0; - var match = false; - var buffer = []; - var token = ''; - var tmp = (str||'').split(''); - for(start=0; start < tmp.length; start++) { - if (tmp[start] == '{' && tmp[start+1] !='{') { - end = str.indexOf('}', start); - token = tmp.slice(start+1, end).join(''); - if (tmp[start-1] != '{' && tmp[end+1] != '}') { - var tokenArgs = (typeof arguments[1] != 'object')? arguments2Array(arguments, 2): args || []; - buffer.push(strings.strConversion.__formatToken(token, tokenArgs)); - } - else { - buffer.push(token); - } - } - else if (start > end || buffer.length < 1) { buffer.push(tmp[start]); } - } - return (buffer.length > 1)? buffer.join(''): buffer[0]; - }, - - calc: function(str, args) { - return eval(format(str, args)); - }, - - repeat: function(s, n) { - return new Array(n+1).join(s); - }, - - UTF8encode: function(s) { - return unescape(encodeURIComponent(s)); - }, - - UTF8decode: function(s) { - return decodeURIComponent(escape(s)); - }, - - tpl: function() { - var out = ''; - var render = true; - // Set - // $.tpl('ui.test', ['', helloWorld ,'']); - if (arguments.length == 2 && $.isArray(arguments[1])) { - this[arguments[0]] = arguments[1].join(''); - return $(this[arguments[0]]); - } - // $.tpl('ui.test', 'hello world'); - if (arguments.length == 2 && $.isString(arguments[1])) { - this[arguments[0]] = arguments[1]; - return $(this[arguments[0]]); - } - // Call - // $.tpl('ui.test'); - if (arguments.length == 1) { - return $(this[arguments[0]]); - } - // $.tpl('ui.test', false); - if (arguments.length == 2 && arguments[1] == false) { - return this[arguments[0]]; - } - // $.tpl('ui.test', {value:blah}); - if (arguments.length == 2 && $.isObject(arguments[1])) { - return $($.format(this[arguments[0]], arguments[1])); - } - // $.tpl('ui.test', {value:blah}, false); - if (arguments.length == 3 && $.isObject(arguments[1])) { - return (arguments[2] == true) - ? $.format(this[arguments[0]], arguments[1]) - : $($.format(this[arguments[0]], arguments[1])); - } - } - }; - - var Argument = function(arg, args) { - this.__arg = arg; - this.__args = args; - this.__max_precision = parseFloat('1.'+ (new Array(32)).join('1'), 10).toString().length-3; - this.__def_precision = 6; - this.getString = function(){ - return this.__arg; - }; - this.getKey = function(){ - return this.__arg.split(':')[0]; - }; - this.getFormat = function(){ - var match = this.getString().split(':'); - return (match && match[1])? match[1]: 's'; - }; - this.getPrecision = function(){ - var match = this.getFormat().match(/\.(\d+|\*)/g); - if (!match) { return this.__def_precision; } - else { - match = match[0].slice(1); - if (match != '*') { return parseInt(match, 10); } - else if(strings.strConversion.__getType(this.__args) == 'array') { - return this.__args[1] && this.__args[0] || this.__def_precision; - } - else if(strings.strConversion.__getType(this.__args) == 'object') { - return this.__args[this.getKey()] && this.__args[this.getKey()][0] || this.__def_precision; - } - else { return this.__def_precision; } - } - }; - this.getPaddingLength = function(){ - var match = false; - if (this.isAlternate()) { - match = this.getString().match(/0?#0?(\d+)/); - if (match && match[1]) { return parseInt(match[1], 10); } - } - match = this.getString().match(/(0|\.)(\d+|\*)/g); - return match && parseInt(match[0].slice(1), 10) || 0; - }; - this.getPaddingString = function(){ - var o = ''; - if (this.isAlternate()) { o = ' '; } - // 0 take precedence on alternate format - if (this.getFormat().match(/#0|0#|^0|\.\d+/)) { o = '0'; } - return o; - }; - this.getFlags = function(){ - var match = this.getString().matc(/^(0|\#|\-|\+|\s)+/); - return match && match[0].split('') || []; - }; - this.isAlternate = function() { - return !!this.getFormat().match(/^0?#/); - }; - }; - - var arguments2Array = function(args, shift) { - var o = []; - for (l=args.length, x=(shift || 0)-1; x - http://haineault.com - - MIT License (http://www.opensource.org/licenses/mit-license.php) - -*/ - -(function($){ - var hash = window.location.hash; - var handlers = []; - var opt = {}; - - $.extend({ - anchorHandler: { - apply: function() { - $.map(handlers, function(handler){ - var match = hash.match(handler.r) && hash.match(handler.r)[0] || false; - if (match) { handler.cb.apply($('a[href*='+match+']').get(0), [handler.r, hash || '']); } - }); - return $.anchorHandler; - }, - add: function(regexp, callback, options) { - var opt = $.extend({handleClick: true, preserveHash: true}, options); - if (opt.handleClick) { - $('a[href*=#]').each(function(i, a){ - if (a.href.match(regexp)) { - $(a).bind('click.anchorHandler', function(){ - if (opt.preserveHash) { window.location.hash = a.hash; } - return callback.apply(this, [regexp, a.href]); - }); - } - }); - } - handlers.push({r: regexp, cb: callback}); - $($.anchorHandler.apply); - return $.anchorHandler; - } - } - }); -})(jQuery); -/** - * Cookie plugin - * - * Copyright (c) 2006 Klaus Hartl (stilbuero.de) - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - */ - -/** - * Create a cookie with the given name and value and other optional parameters. - * - * @example $.cookie('the_cookie', 'the_value'); - * @desc Set the value of a cookie. - * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); - * @desc Create a cookie with all available options. - * @example $.cookie('the_cookie', 'the_value'); - * @desc Create a session cookie. - * @example $.cookie('the_cookie', null); - * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain - * used when the cookie was set. - * - * @param String name The name of the cookie. - * @param String value The value of the cookie. - * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. - * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. - * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. - * If set to null or omitted, the cookie will be a session cookie and will not be retained - * when the the browser exits. - * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). - * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). - * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will - * require a secure protocol (like HTTPS). - * @type undefined - * - * @name $.cookie - * @cat Plugins/Cookie - * @author Klaus Hartl/klaus.hartl@stilbuero.de - */ - -/** - * Get the value of a cookie with the given name. - * - * @example $.cookie('the_cookie'); - * @desc Get the value of a cookie. - * - * @param String name The name of the cookie. - * @return The value of the cookie. - * @type String - * - * @name $.cookie - * @cat Plugins/Cookie - * @author Klaus Hartl/klaus.hartl@stilbuero.de - */ -jQuery.cookie = function(name, value, options) { - if (typeof value != 'undefined') { // name and value given, set cookie - options = options || {}; - if (value === null) { - value = ''; - options.expires = -1; - } - var expires = ''; - if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { - var date; - if (typeof options.expires == 'number') { - date = new Date(); - date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); - } else { - date = options.expires; - } - expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE - } - // CAUTION: Needed to parenthesize options.path and options.domain - // in the following expressions, otherwise they evaluate to undefined - // in the packed version for some reason... - var path = options.path ? '; path=' + (options.path) : ''; - var domain = options.domain ? '; domain=' + (options.domain) : ''; - var secure = options.secure ? '; secure' : ''; - document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); - } else { // only name given, get cookie - var cookieValue = null; - if (document.cookie && document.cookie != '') { - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; i++) { - var cookie = jQuery.trim(cookies[i]); - // Does this cookie string begin with the name we want? - if (cookie.substring(0, name.length + 1) == (name + '=')) { - cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); - break; - } - } - } - return cookieValue; - } -}; -/* - jQuery countdown - 0.2 - http://code.google.com/p/jquery-utils/ - - (c) Maxime Haineault - http://haineault.com - - MIT License (http://www.opensource.org/licenses/mit-license.php) - -*/ - -(function($) { - function countdown(el, options) { - var calc = function (target, current) { - /* Return true if the target date has arrived, - * an object of the time left otherwise. - */ - var current = current || new Date(); - if (current >= target) { return true; } - - var o = {}; - var remain = Math.floor((target.getTime() - current.getTime()) / 1000); - - o.days = Math.floor(remain / 86400); - remain %= 86400; - o.hours = Math.floor(remain / 3600); - remain %= 3600; - o.minutes = Math.floor(remain / 60); - remain %= 60; - o.seconds = remain; - o.years = Math.floor(o.days / 365); - o.months = Math.floor(o.days / 30); - o.weeks = Math.floor(o.days / 7); - - return o; - }; - - var getWeek = function(date) { - var onejan = new Date(date.getFullYear(),0,1); - return Math.ceil((((date - onejan) / 86400000) + onejan.getDay())/7); - }; - - var options = $.extend({ - date: new Date(), - modifiers: [], - interval: 1000, - msgFormat: '%d [day|days] %hh %mm %ss', - msgNow: 'Now !' - }, options); - - var tokens = { - y: new RegExp ('\\%y(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // years - M: new RegExp ('\\%M(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // months - w: new RegExp ('\\%w(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // weeks - d: new RegExp ('\\%d(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // days - h: new RegExp ('\\%h(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // hours - m: new RegExp ('\\%m(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // minutes - s: new RegExp ('\\%s(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g') // seconds - }; - - var formatToken = function(str, token, val) { - return (!tokens[token])? '': str.match(/\[|\]/g) - && (str.replace(tokens[token], val+'$1'+ ((parseInt(val, 10)<2)?'$2':'$3')) || '') - || str.replace('%'+token, val); - }; - - var format = function(str, obj) { - var o = str; - o = formatToken(o, 'y', obj.years); - o = formatToken(o, 'M', obj.months); - o = formatToken(o, 'w', obj.weeks); - o = formatToken(o, 'd', obj.days); - o = formatToken(o, 'h', obj.hours); - o = formatToken(o, 'm', obj.minutes); - o = formatToken(o, 's', obj.seconds); - return o; - }; - - var update = function() { - var date_obj = calc(cd.date); - if (date_obj === true) { - cd.stop(); clearInterval(cd.id); - $(cd.el).html(options.msgNow); - return true; - } - else { - $(cd.el).text(format(options.msgFormat, date_obj)); - } - }; - - var apply_modifiers = function (modifiers, date) { - if (modifiers.length === 0) { - return date; - } - - var modifier_re = /^([+-]\d+)([yMdhms])$/; - var conversions = { - s: 1000, - m: 60 * 1000, - h: 60 * 60 * 1000, - d: 24 * 60 * 60 * 1000, - M: 30 * 24 * 60 * 60 * 1000, - y: 365 * 24 * 60 * 60 * 1000 - }; - - var displacement = 0; - for (var i = 0, n = modifiers.length; i < n; ++i) { - var match = modifiers[i].match(modifier_re); - if (match !== null) { - displacement += parseInt(match[1], 10) * conversions[match[2]]; - } - } - return new Date(date.getTime() + displacement); - }; - - var cd = { - id : setInterval(update, options.interval), - el : el, - start : function(){ return new countdown($(this.el), options); }, - stop : function(){ return clearInterval(this.id); }, - date : apply_modifiers(options.modifiers, options.date) - }; - $(el).data('countdown', cd); - update(); - return $(el).data('countdown'); - } - $.fn.countdown = function(args) { if(this.get(0)) return new countdown(this.get(0), args); }; -})(jQuery); -/* - * jQuery Cycle Plugin for light-weight slideshows - * Examples and documentation at: http://malsup.com/jquery/cycle/ - * Copyright (c) 2007-2008 M. Alsup - * Version: 2.24 (07/30/2008) - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * Requires: jQuery v1.2.3 or later - * - * Based on the work of: - * 1) Matt Oakes (http://portfolio.gizone.co.uk/applications/slideshow/) - * 2) Torsten Baldes (http://medienfreunde.com/lab/innerfade/) - * 3) Benjamin Sterling (http://www.benjaminsterling.com/experiments/jqShuffle/) - */ -;(function($) { - -var ver = '2.24'; -var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent); - -function log() { - if (window.console && window.console.log) - window.console.log('[cycle] ' + Array.prototype.join.call(arguments,'')); -}; - -$.fn.cycle = function(options) { - return this.each(function() { - if (options === undefined || options === null) - options = {}; - if (options.constructor == String) { - switch(options) { - case 'stop': - if (this.cycleTimeout) clearTimeout(this.cycleTimeout); - this.cycleTimeout = 0; - $(this).data('cycle.opts', ''); - return; - case 'pause': - this.cyclePause = 1; - return; - case 'resume': - this.cyclePause = 0; - return; - default: - options = { fx: options }; - }; - } - else if (options.constructor == Number) { - // go to the requested slide slide - var num = options; - options = $(this).data('cycle.opts'); - if (!options) { - log('options not found, can not advance slide'); - return; - } - if (num < 0 || num >= options.elements.length) { - log('invalid slide index: ' + num); - return; - } - options.nextSlide = num; - if (this.cycleTimeout) { - clearTimeout(this.cycleTimeout); - this.cycleTimeout = 0; - } - go(options.elements, options, 1, 1); - return; - } - - // stop existing slideshow for this container (if there is one) - if (this.cycleTimeout) clearTimeout(this.cycleTimeout); - this.cycleTimeout = 0; - this.cyclePause = 0; - - var $cont = $(this); - var $slides = options.slideExpr ? $(options.slideExpr, this) : $cont.children(); - var els = $slides.get(); - if (els.length < 2) { - log('terminating; too few slides: ' + els.length); - return; // don't bother - } - - // support metadata plugin (v1.0 and v2.0) - var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {}); - if (opts.autostop) - opts.countdown = opts.autostopCount || els.length; - - $cont.data('cycle.opts', opts); - opts.container = this; - - opts.elements = els; - opts.before = opts.before ? [opts.before] : []; - opts.after = opts.after ? [opts.after] : []; - opts.after.unshift(function(){ opts.busy=0; }); - if (opts.continuous) - opts.after.push(function() { go(els,opts,0,!opts.rev); }); - - // clearType corrections - if (ie6 && opts.cleartype && !opts.cleartypeNoBg) - clearTypeFix($slides); - - // allow shorthand overrides of width, height and timeout - var cls = this.className; - opts.width = parseInt((cls.match(/w:(\d+)/)||[])[1]) || opts.width; - opts.height = parseInt((cls.match(/h:(\d+)/)||[])[1]) || opts.height; - opts.timeout = parseInt((cls.match(/t:(\d+)/)||[])[1]) || opts.timeout; - - if ($cont.css('position') == 'static') - $cont.css('position', 'relative'); - if (opts.width) - $cont.width(opts.width); - if (opts.height && opts.height != 'auto') - $cont.height(opts.height); - - if (opts.random) { - opts.randomMap = []; - for (var i = 0; i < els.length; i++) - opts.randomMap.push(i); - opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;}); - opts.randomIndex = 0; - opts.startingSlide = opts.randomMap[0]; - } - else if (opts.startingSlide >= els.length) - opts.startingSlide = 0; // catch bogus input - var first = opts.startingSlide || 0; - $slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) { - var z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i; - $(this).css('z-index', z) - }); - - $(els[first]).css('opacity',1).show(); // opacity bit needed to handle reinit case - if ($.browser.msie) els[first].style.removeAttribute('filter'); - - if (opts.fit && opts.width) - $slides.width(opts.width); - if (opts.fit && opts.height && opts.height != 'auto') - $slides.height(opts.height); - if (opts.pause) - $cont.hover(function(){this.cyclePause=1;},function(){this.cyclePause=0;}); - - // run transition init fn - var init = $.fn.cycle.transitions[opts.fx]; - if ($.isFunction(init)) - init($cont, $slides, opts); - else if (opts.fx != 'custom') - log('unknown transition: ' + opts.fx); - - $slides.each(function() { - var $el = $(this); - this.cycleH = (opts.fit && opts.height) ? opts.height : $el.height(); - this.cycleW = (opts.fit && opts.width) ? opts.width : $el.width(); - }); - - opts.cssBefore = opts.cssBefore || {}; - opts.animIn = opts.animIn || {}; - opts.animOut = opts.animOut || {}; - - $slides.not(':eq('+first+')').css(opts.cssBefore); - if (opts.cssFirst) - $($slides[first]).css(opts.cssFirst); - - if (opts.timeout) { - // ensure that timeout and speed settings are sane - if (opts.speed.constructor == String) - opts.speed = {slow: 600, fast: 200}[opts.speed] || 400; - if (!opts.sync) - opts.speed = opts.speed / 2; - while((opts.timeout - opts.speed) < 250) - opts.timeout += opts.speed; - } - if (opts.easing) - opts.easeIn = opts.easeOut = opts.easing; - if (!opts.speedIn) - opts.speedIn = opts.speed; - if (!opts.speedOut) - opts.speedOut = opts.speed; - - opts.slideCount = els.length; - opts.currSlide = first; - if (opts.random) { - opts.nextSlide = opts.currSlide; - if (++opts.randomIndex == els.length) - opts.randomIndex = 0; - opts.nextSlide = opts.randomMap[opts.randomIndex]; - } - else - opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1; - - // fire artificial events - var e0 = $slides[first]; - if (opts.before.length) - opts.before[0].apply(e0, [e0, e0, opts, true]); - if (opts.after.length > 1) - opts.after[1].apply(e0, [e0, e0, opts, true]); - - if (opts.click && !opts.next) - opts.next = opts.click; - if (opts.next) - $(opts.next).bind('click', function(){return advance(els,opts,opts.rev?-1:1)}); - if (opts.prev) - $(opts.prev).bind('click', function(){return advance(els,opts,opts.rev?1:-1)}); - if (opts.pager) - buildPager(els,opts); - - // expose fn for adding slides after the show has started - opts.addSlide = function(newSlide) { - var $s = $(newSlide), s = $s[0]; - if (!opts.autostopCount) - opts.countdown++; - els.push(s); - if (opts.els) - opts.els.push(s); // shuffle needs this - opts.slideCount = els.length; - - $s.css('position','absolute').appendTo($cont); - - if (ie6 && opts.cleartype && !opts.cleartypeNoBg) - clearTypeFix($s); - - if (opts.fit && opts.width) - $s.width(opts.width); - if (opts.fit && opts.height && opts.height != 'auto') - $slides.height(opts.height); - s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height(); - s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width(); - - $s.css(opts.cssBefore); - - if (opts.pager) - $.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts); - - if (typeof opts.onAddSlide == 'function') - opts.onAddSlide($s); - }; - - if (opts.timeout || opts.continuous) - this.cycleTimeout = setTimeout( - function(){go(els,opts,0,!opts.rev)}, - opts.continuous ? 10 : opts.timeout + (opts.delay||0)); - }); -}; - -function go(els, opts, manual, fwd) { - if (opts.busy) return; - var p = opts.container, curr = els[opts.currSlide], next = els[opts.nextSlide]; - if (p.cycleTimeout === 0 && !manual) - return; - - if (!manual && !p.cyclePause && - ((opts.autostop && (--opts.countdown <= 0)) || - (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) { - if (opts.end) - opts.end(opts); - return; - } - - if (manual || !p.cyclePause) { - if (opts.before.length) - $.each(opts.before, function(i,o) { o.apply(next, [curr, next, opts, fwd]); }); - var after = function() { - if ($.browser.msie && opts.cleartype) - this.style.removeAttribute('filter'); - $.each(opts.after, function(i,o) { o.apply(next, [curr, next, opts, fwd]); }); - }; - - if (opts.nextSlide != opts.currSlide) { - opts.busy = 1; - if (opts.fxFn) - opts.fxFn(curr, next, opts, after, fwd); - else if ($.isFunction($.fn.cycle[opts.fx])) - $.fn.cycle[opts.fx](curr, next, opts, after); - else - $.fn.cycle.custom(curr, next, opts, after); - } - if (opts.random) { - opts.currSlide = opts.nextSlide; - if (++opts.randomIndex == els.length) - opts.randomIndex = 0; - opts.nextSlide = opts.randomMap[opts.randomIndex]; - } - else { // sequence - var roll = (opts.nextSlide + 1) == els.length; - opts.nextSlide = roll ? 0 : opts.nextSlide+1; - opts.currSlide = roll ? els.length-1 : opts.nextSlide-1; - } - if (opts.pager) - $.fn.cycle.updateActivePagerLink(opts.pager, opts.currSlide); - } - if (opts.timeout && !opts.continuous) - p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, opts.timeout); - else if (opts.continuous && p.cyclePause) - p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, 10); -}; - -$.fn.cycle.updateActivePagerLink = function(pager, currSlide) { - $(pager).find('a').removeClass('activeSlide').filter('a:eq('+currSlide+')').addClass('activeSlide'); -}; - -// advance slide forward or back -function advance(els, opts, val) { - var p = opts.container, timeout = p.cycleTimeout; - if (timeout) { - clearTimeout(timeout); - p.cycleTimeout = 0; - } - if (opts.random && val < 0) { - // move back to the previously display slide - opts.randomIndex--; - if (--opts.randomIndex == -2) - opts.randomIndex = els.length-2; - else if (opts.randomIndex == -1) - opts.randomIndex = els.length-1; - opts.nextSlide = opts.randomMap[opts.randomIndex]; - } - else if (opts.random) { - if (++opts.randomIndex == els.length) - opts.randomIndex = 0; - opts.nextSlide = opts.randomMap[opts.randomIndex]; - } - else { - opts.nextSlide = opts.currSlide + val; - if (opts.nextSlide < 0) { - if (opts.nowrap) return false; - opts.nextSlide = els.length - 1; - } - else if (opts.nextSlide >= els.length) { - if (opts.nowrap) return false; - opts.nextSlide = 0; - } - } - -log('nextSlide: ' + opts.nextSlide + '; randomIndex: ' + opts.randomIndex); - if (opts.prevNextClick && typeof opts.prevNextClick == 'function') - opts.prevNextClick(val > 0, opts.nextSlide, els[opts.nextSlide]); - go(els, opts, 1, val>=0); - return false; -}; - -function buildPager(els, opts) { - var $p = $(opts.pager); - $.each(els, function(i,o) { - $.fn.cycle.createPagerAnchor(i,o,$p,els,opts); - }); - $.fn.cycle.updateActivePagerLink(opts.pager, opts.startingSlide); -}; - -$.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) { - var $a = (typeof opts.pagerAnchorBuilder == 'function') - ? $(opts.pagerAnchorBuilder(i,el)) - : $(''+(i+1)+''); - - // don't reparent if anchor is in the dom - if ($a.parents('body').length == 0) - $a.appendTo($p); - - $a.bind(opts.pagerEvent, function() { - opts.nextSlide = i; - var p = opts.container, timeout = p.cycleTimeout; - if (timeout) { - clearTimeout(timeout); - p.cycleTimeout = 0; - } - if (typeof opts.pagerClick == 'function') - opts.pagerClick(opts.nextSlide, els[opts.nextSlide]); - go(els,opts,1,opts.currSlide < i); - return false; - }); -}; - - -// this fixes clearType problems in ie6 by setting an explicit bg color -function clearTypeFix($slides) { - function hex(s) { - var s = parseInt(s).toString(16); - return s.length < 2 ? '0'+s : s; - }; - function getBg(e) { - for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) { - var v = $.css(e,'background-color'); - if (v.indexOf('rgb') >= 0 ) { - var rgb = v.match(/\d+/g); - return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]); - } - if (v && v != 'transparent') - return v; - } - return '#ffffff'; - }; - $slides.each(function() { $(this).css('background-color', getBg(this)); }); -}; - - -$.fn.cycle.custom = function(curr, next, opts, cb) { - var $l = $(curr), $n = $(next); - $n.css(opts.cssBefore); - var fn = function() {$n.animate(opts.animIn, opts.speedIn, opts.easeIn, cb)}; - $l.animate(opts.animOut, opts.speedOut, opts.easeOut, function() { - if (opts.cssAfter) $l.css(opts.cssAfter); - if (!opts.sync) fn(); - }); - if (opts.sync) fn(); -}; - -$.fn.cycle.transitions = { - fade: function($cont, $slides, opts) { - $slides.not(':eq('+opts.startingSlide+')').css('opacity',0); - opts.before.push(function() { $(this).show() }); - opts.animIn = { opacity: 1 }; - opts.animOut = { opacity: 0 }; - opts.cssBefore = { opacity: 0 }; - opts.cssAfter = { display: 'none' }; - } -}; - -$.fn.cycle.ver = function() { return ver; }; - -// override these globally if you like (they are all optional) -$.fn.cycle.defaults = { - fx: 'fade', // one of: fade, shuffle, zoom, scrollLeft, etc - timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance) - continuous: 0, // true to start next transition immediately after current one completes - speed: 1000, // speed of the transition (any valid fx speed value) - speedIn: null, // speed of the 'in' transition - speedOut: null, // speed of the 'out' transition - next: null, // id of element to use as click trigger for next slide - prev: null, // id of element to use as click trigger for previous slide - prevNextClick: null, // callback fn for prev/next clicks: function(isNext, zeroBasedSlideIndex, slideElement) - pager: null, // id of element to use as pager container - pagerClick: null, // callback fn for pager clicks: function(zeroBasedSlideIndex, slideElement) - pagerEvent: 'click', // event which drives the pager navigation - pagerAnchorBuilder: null, // callback fn for building anchor links - before: null, // transition callback (scope set to element to be shown) - after: null, // transition callback (scope set to element that was shown) - end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options) - easing: null, // easing method for both in and out transitions - easeIn: null, // easing for "in" transition - easeOut: null, // easing for "out" transition - shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 } - animIn: null, // properties that define how the slide animates in - animOut: null, // properties that define how the slide animates out - cssBefore: null, // properties that define the initial state of the slide before transitioning in - cssAfter: null, // properties that defined the state of the slide after transitioning out - fxFn: null, // function used to control the transition - height: 'auto', // container height - startingSlide: 0, // zero-based index of the first slide to be displayed - sync: 1, // true if in/out transitions should occur simultaneously - random: 0, // true for random, false for sequence (not applicable to shuffle fx) - fit: 0, // force slides to fit container - pause: 0, // true to enable "pause on hover" - autostop: 0, // true to end slideshow after X transitions (where X == slide count) - autostopCount: 0, // number of transitions (optionally used with autostop to define X) - delay: 0, // additional delay (in ms) for first transition (hint: can be negative) - slideExpr: null, // expression for selecting slides (if something other than all children is required) - cleartype: 0, // true if clearType corrections should be applied (for IE) - nowrap: 0 // true to prevent slideshow from wrapping -}; - -})(jQuery); - - -/* - * jQuery Cycle Plugin Transition Definitions - * This script is a plugin for the jQuery Cycle Plugin - * Examples and documentation at: http://malsup.com/jquery/cycle/ - * Copyright (c) 2007-2008 M. Alsup - * Version: 2.22 - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ -(function($) { - -// -// These functions define one-time slide initialization for the named -// transitions. To save file size feel free to remove any of these that you -// don't need. -// - -// scrollUp/Down/Left/Right -$.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) { - $cont.css('overflow','hidden'); - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore.top = next.offsetHeight; - opts.animOut.top = 0-curr.offsetHeight; - }); - opts.cssFirst = { top: 0 }; - opts.animIn = { top: 0 }; - opts.cssAfter = { display: 'none' }; -}; -$.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) { - $cont.css('overflow','hidden'); - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore.top = 0-next.offsetHeight; - opts.animOut.top = curr.offsetHeight; - }); - opts.cssFirst = { top: 0 }; - opts.animIn = { top: 0 }; - opts.cssAfter = { display: 'none' }; -}; -$.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) { - $cont.css('overflow','hidden'); - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore.left = next.offsetWidth; - opts.animOut.left = 0-curr.offsetWidth; - }); - opts.cssFirst = { left: 0 }; - opts.animIn = { left: 0 }; -}; -$.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) { - $cont.css('overflow','hidden'); - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore.left = 0-next.offsetWidth; - opts.animOut.left = curr.offsetWidth; - }); - opts.cssFirst = { left: 0 }; - opts.animIn = { left: 0 }; -}; -$.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) { - $cont.css('overflow','hidden').width(); -// $slides.show(); - opts.before.push(function(curr, next, opts, fwd) { - $(this).show(); - var currW = curr.offsetWidth, nextW = next.offsetWidth; - opts.cssBefore = fwd ? { left: nextW } : { left: -nextW }; - opts.animIn.left = 0; - opts.animOut.left = fwd ? -currW : currW; - $slides.not(curr).css(opts.cssBefore); - }); - opts.cssFirst = { left: 0 }; - opts.cssAfter = { display: 'none' } -}; -$.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) { - $cont.css('overflow','hidden'); -// $slides.show(); - opts.before.push(function(curr, next, opts, fwd) { - $(this).show(); - var currH = curr.offsetHeight, nextH = next.offsetHeight; - opts.cssBefore = fwd ? { top: -nextH } : { top: nextH }; - opts.animIn.top = 0; - opts.animOut.top = fwd ? currH : -currH; - $slides.not(curr).css(opts.cssBefore); - }); - opts.cssFirst = { top: 0 }; - opts.cssAfter = { display: 'none' } -}; - -// slideX/slideY -$.fn.cycle.transitions.slideX = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - $(curr).css('zIndex',1); - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssBefore = { zIndex: 2 }; - opts.animIn = { width: 'show' }; - opts.animOut = { width: 'hide' }; -}; -$.fn.cycle.transitions.slideY = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - $(curr).css('zIndex',1); - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssBefore = { zIndex: 2 }; - opts.animIn = { height: 'show' }; - opts.animOut = { height: 'hide' }; -}; - -// shuffle -$.fn.cycle.transitions.shuffle = function($cont, $slides, opts) { - var w = $cont.css('overflow', 'visible').width(); - $slides.css({left: 0, top: 0}); - opts.before.push(function() { $(this).show() }); - opts.speed = opts.speed / 2; // shuffle has 2 transitions - opts.random = 0; - opts.shuffle = opts.shuffle || {left:-w, top:15}; - opts.els = []; - for (var i=0; i < $slides.length; i++) - opts.els.push($slides[i]); - - for (var i=0; i < opts.startingSlide; i++) - opts.els.push(opts.els.shift()); - - // custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!) - opts.fxFn = function(curr, next, opts, cb, fwd) { - var $el = fwd ? $(curr) : $(next); - $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() { - fwd ? opts.els.push(opts.els.shift()) : opts.els.unshift(opts.els.pop()); - if (fwd) - for (var i=0, len=opts.els.length; i < len; i++) - $(opts.els[i]).css('z-index', len-i); - else { - var z = $(curr).css('z-index'); - $el.css('z-index', parseInt(z)+1); - } - $el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() { - $(fwd ? this : curr).hide(); - if (cb) cb(); - }); - }); - }; - opts.onAddSlide = function($s) { $s.hide(); }; -}; - -// turnUp/Down/Left/Right -$.fn.cycle.transitions.turnUp = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore.top = next.cycleH; - opts.animIn.height = next.cycleH; - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssFirst = { top: 0 }; - opts.cssBefore = { height: 0 }; - opts.animIn = { top: 0 }; - opts.animOut = { height: 0 }; - opts.cssAfter = { display: 'none' }; -}; -$.fn.cycle.transitions.turnDown = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.animIn.height = next.cycleH; - opts.animOut.top = curr.cycleH; - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssFirst = { top: 0 }; - opts.cssBefore = { top: 0, height: 0 }; - opts.animOut = { height: 0 }; - opts.cssAfter = { display: 'none' }; -}; -$.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore.left = next.cycleW; - opts.animIn.width = next.cycleW; - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssBefore = { width: 0 }; - opts.animIn = { left: 0 }; - opts.animOut = { width: 0 }; - opts.cssAfter = { display: 'none' }; -}; -$.fn.cycle.transitions.turnRight = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.animIn.width = next.cycleW; - opts.animOut.left = curr.cycleW; - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssBefore = { left: 0, width: 0 }; - opts.animIn = { left: 0 }; - opts.animOut = { width: 0 }; - opts.cssAfter = { display: 'none' }; -}; - -// zoom -$.fn.cycle.transitions.zoom = function($cont, $slides, opts) { - opts.cssFirst = { top:0, left: 0 }; - opts.cssAfter = { display: 'none' }; - - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore = { width: 0, height: 0, top: next.cycleH/2, left: next.cycleW/2 }; - opts.cssAfter = { display: 'none' }; - opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH }; - opts.animOut = { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 }; - $(curr).css('zIndex',2); - $(next).css('zIndex',1); - }); - opts.onAddSlide = function($s) { $s.hide(); }; -}; - -// fadeZoom -$.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - opts.cssBefore = { width: 0, height: 0, opacity: 1, left: next.cycleW/2, top: next.cycleH/2, zIndex: 1 }; - opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH }; - }); - opts.animOut = { opacity: 0 }; - opts.cssAfter = { zIndex: 0 }; -}; - -// blindX -$.fn.cycle.transitions.blindX = function($cont, $slides, opts) { - var w = $cont.css('overflow','hidden').width(); - $slides.show(); - opts.before.push(function(curr, next, opts) { - $(curr).css('zIndex',1); - }); - opts.cssBefore = { left: w, zIndex: 2 }; - opts.cssAfter = { zIndex: 1 }; - opts.animIn = { left: 0 }; - opts.animOut = { left: w }; -}; -// blindY -$.fn.cycle.transitions.blindY = function($cont, $slides, opts) { - var h = $cont.css('overflow','hidden').height(); - $slides.show(); - opts.before.push(function(curr, next, opts) { - $(curr).css('zIndex',1); - }); - opts.cssBefore = { top: h, zIndex: 2 }; - opts.cssAfter = { zIndex: 1 }; - opts.animIn = { top: 0 }; - opts.animOut = { top: h }; -}; -// blindZ -$.fn.cycle.transitions.blindZ = function($cont, $slides, opts) { - var h = $cont.css('overflow','hidden').height(); - var w = $cont.width(); - $slides.show(); - opts.before.push(function(curr, next, opts) { - $(curr).css('zIndex',1); - }); - opts.cssBefore = { top: h, left: w, zIndex: 2 }; - opts.cssAfter = { zIndex: 1 }; - opts.animIn = { top: 0, left: 0 }; - opts.animOut = { top: h, left: w }; -}; - -// growX - grow horizontally from centered 0 width -$.fn.cycle.transitions.growX = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - opts.cssBefore = { left: this.cycleW/2, width: 0, zIndex: 2 }; - opts.animIn = { left: 0, width: this.cycleW }; - opts.animOut = { left: 0 }; - $(curr).css('zIndex',1); - }); - opts.onAddSlide = function($s) { $s.hide().css('zIndex',1); }; -}; -// growY - grow vertically from centered 0 height -$.fn.cycle.transitions.growY = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - opts.cssBefore = { top: this.cycleH/2, height: 0, zIndex: 2 }; - opts.animIn = { top: 0, height: this.cycleH }; - opts.animOut = { top: 0 }; - $(curr).css('zIndex',1); - }); - opts.onAddSlide = function($s) { $s.hide().css('zIndex',1); }; -}; - -// curtainX - squeeze in both edges horizontally -$.fn.cycle.transitions.curtainX = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - opts.cssBefore = { left: next.cycleW/2, width: 0, zIndex: 1, display: 'block' }; - opts.animIn = { left: 0, width: this.cycleW }; - opts.animOut = { left: curr.cycleW/2, width: 0 }; - $(curr).css('zIndex',2); - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssAfter = { zIndex: 1, display: 'none' }; -}; -// curtainY - squeeze in both edges vertically -$.fn.cycle.transitions.curtainY = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - opts.cssBefore = { top: next.cycleH/2, height: 0, zIndex: 1, display: 'block' }; - opts.animIn = { top: 0, height: this.cycleH }; - opts.animOut = { top: curr.cycleH/2, height: 0 }; - $(curr).css('zIndex',2); - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssAfter = { zIndex: 1, display: 'none' }; -}; - -// cover - curr slide covered by next slide -$.fn.cycle.transitions.cover = function($cont, $slides, opts) { - var d = opts.direction || 'left'; - var w = $cont.css('overflow','hidden').width(); - var h = $cont.height(); - opts.before.push(function(curr, next, opts) { - opts.cssBefore = opts.cssBefore || {}; - opts.cssBefore.zIndex = 2; - opts.cssBefore.display = 'block'; - - if (d == 'right') - opts.cssBefore.left = -w; - else if (d == 'up') - opts.cssBefore.top = h; - else if (d == 'down') - opts.cssBefore.top = -h; - else - opts.cssBefore.left = w; - $(curr).css('zIndex',1); - }); - if (!opts.animIn) opts.animIn = { left: 0, top: 0 }; - if (!opts.animOut) opts.animOut = { left: 0, top: 0 }; - opts.cssAfter = opts.cssAfter || {}; - opts.cssAfter.zIndex = 2; - opts.cssAfter.display = 'none'; -}; - -// uncover - curr slide moves off next slide -$.fn.cycle.transitions.uncover = function($cont, $slides, opts) { - var d = opts.direction || 'left'; - var w = $cont.css('overflow','hidden').width(); - var h = $cont.height(); - opts.before.push(function(curr, next, opts) { - opts.cssBefore.display = 'block'; - if (d == 'right') - opts.animOut.left = w; - else if (d == 'up') - opts.animOut.top = -h; - else if (d == 'down') - opts.animOut.top = h; - else - opts.animOut.left = -w; - $(curr).css('zIndex',2); - $(next).css('zIndex',1); - }); - opts.onAddSlide = function($s) { $s.hide(); }; - if (!opts.animIn) opts.animIn = { left: 0, top: 0 }; - opts.cssBefore = opts.cssBefore || {}; - opts.cssBefore.top = 0; - opts.cssBefore.left = 0; - - opts.cssAfter = opts.cssAfter || {}; - opts.cssAfter.zIndex = 1; - opts.cssAfter.display = 'none'; -}; - -// toss - move top slide and fade away -$.fn.cycle.transitions.toss = function($cont, $slides, opts) { - var w = $cont.css('overflow','visible').width(); - var h = $cont.height(); - opts.before.push(function(curr, next, opts) { - $(curr).css('zIndex',2); - opts.cssBefore.display = 'block'; - // provide default toss settings if animOut not provided - if (!opts.animOut.left && !opts.animOut.top) - opts.animOut = { left: w*2, top: -h/2, opacity: 0 }; - else - opts.animOut.opacity = 0; - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssBefore = { left: 0, top: 0, zIndex: 1, opacity: 1 }; - opts.animIn = { left: 0 }; - opts.cssAfter = { zIndex: 2, display: 'none' }; -}; - -// wipe - clip animation -$.fn.cycle.transitions.wipe = function($cont, $slides, opts) { - var w = $cont.css('overflow','hidden').width(); - var h = $cont.height(); - opts.cssBefore = opts.cssBefore || {}; - var clip; - if (opts.clip) { - if (/l2r/.test(opts.clip)) - clip = 'rect(0px 0px '+h+'px 0px)'; - else if (/r2l/.test(opts.clip)) - clip = 'rect(0px '+w+'px '+h+'px '+w+'px)'; - else if (/t2b/.test(opts.clip)) - clip = 'rect(0px '+w+'px 0px 0px)'; - else if (/b2t/.test(opts.clip)) - clip = 'rect('+h+'px '+w+'px '+h+'px 0px)'; - else if (/zoom/.test(opts.clip)) { - var t = parseInt(h/2); - var l = parseInt(w/2); - clip = 'rect('+t+'px '+l+'px '+t+'px '+l+'px)'; - } - } - - opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)'; - - var d = opts.cssBefore.clip.match(/(\d+)/g); - var t = parseInt(d[0]), r = parseInt(d[1]), b = parseInt(d[2]), l = parseInt(d[3]); - - opts.before.push(function(curr, next, opts) { - if (curr == next) return; - var $curr = $(curr).css('zIndex',2); - var $next = $(next).css({ - zIndex: 3, - display: 'block' - }); - - var step = 1, count = parseInt((opts.speedIn / 13)) - 1; - function f() { - var tt = t ? t - parseInt(step * (t/count)) : 0; - var ll = l ? l - parseInt(step * (l/count)) : 0; - var bb = b < h ? b + parseInt(step * ((h-b)/count || 1)) : h; - var rr = r < w ? r + parseInt(step * ((w-r)/count || 1)) : w; - $next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' }); - (step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none'); - } - f(); - }); - opts.cssAfter = { }; - opts.animIn = { left: 0 }; - opts.animOut = { left: 0 }; -}; - -})(jQuery); -/* - jQuery delayed observer - 0.8 - http://code.google.com/p/jquery-utils/ - - (c) Maxime Haineault - http://haineault.com - - MIT License (http://www.opensource.org/licenses/mit-license.php) - -*/ - -(function($){ - $.extend($.fn, { - delayedObserver: function(callback, delay, options){ - return this.each(function(){ - var el = $(this); - var op = options || {}; - el.data('oldval', el.val()) - .data('delay', delay || 0.5) - .data('condition', op.condition || function() { return ($(this).data('oldval') == $(this).val()); }) - .data('callback', callback) - [(op.event||'keyup')](function(){ - if (el.data('condition').apply(el)) { return; } - else { - if (el.data('timer')) { clearTimeout(el.data('timer')); } - el.data('timer', setTimeout(function(){ - el.data('callback').apply(el); - }, el.data('delay') * 1000)); - el.data('oldval', el.val()); - } - }); - }); - } - }); -})(jQuery); -/** - * Flash (http://jquery.lukelutman.com/plugins/flash) - * A jQuery plugin for embedding Flash movies. - * - * Version 1.0 - * November 9th, 2006 - * - * Copyright (c) 2006 Luke Lutman (http://www.lukelutman.com) - * Dual licensed under the MIT and GPL licenses. - * http://www.opensource.org/licenses/mit-license.php - * http://www.opensource.org/licenses/gpl-license.php - * - * Inspired by: - * SWFObject (http://blog.deconcept.com/swfobject/) - * UFO (http://www.bobbyvandersluis.com/ufo/) - * sIFR (http://www.mikeindustries.com/sifr/) - * - * IMPORTANT: - * The packed version of jQuery breaks ActiveX control - * activation in Internet Explorer. Use JSMin to minifiy - * jQuery (see: http://jquery.lukelutman.com/plugins/flash#activex). - * - **/ -;(function(){ - -var $$; - -/** - * - * @desc Replace matching elements with a flash movie. - * @author Luke Lutman - * @version 1.0.1 - * - * @name flash - * @param Hash htmlOptions Options for the embed/object tag. - * @param Hash pluginOptions Options for detecting/updating the Flash plugin (optional). - * @param Function replace Custom block called for each matched element if flash is installed (optional). - * @param Function update Custom block called for each matched if flash isn't installed (optional). - * @type jQuery - * - * @cat plugins/flash - * - * @example $('#hello').flash({ src: 'hello.swf' }); - * @desc Embed a Flash movie. - * - * @example $('#hello').flash({ src: 'hello.swf' }, { version: 8 }); - * @desc Embed a Flash 8 movie. - * - * @example $('#hello').flash({ src: 'hello.swf' }, { expressInstall: true }); - * @desc Embed a Flash movie using Express Install if flash isn't installed. - * - * @example $('#hello').flash({ src: 'hello.swf' }, { update: false }); - * @desc Embed a Flash movie, don't show an update message if Flash isn't installed. - * -**/ -$$ = jQuery.fn.flash = function(htmlOptions, pluginOptions, replace, update) { - - // Set the default block. - var block = replace || $$.replace; - - // Merge the default and passed plugin options. - pluginOptions = $$.copy($$.pluginOptions, pluginOptions); - - // Detect Flash. - if(!$$.hasFlash(pluginOptions.version)) { - // Use Express Install (if specified and Flash plugin 6,0,65 or higher is installed). - if(pluginOptions.expressInstall && $$.hasFlash(6,0,65)) { - // Add the necessary flashvars (merged later). - var expressInstallOptions = { - flashvars: { - MMredirectURL: location, - MMplayerType: 'PlugIn', - MMdoctitle: jQuery('title').text() - } - }; - // Ask the user to update (if specified). - } else if (pluginOptions.update) { - // Change the block to insert the update message instead of the flash movie. - block = update || $$.update; - // Fail - } else { - // The required version of flash isn't installed. - // Express Install is turned off, or flash 6,0,65 isn't installed. - // Update is turned off. - // Return without doing anything. - return this; - } - } - - // Merge the default, express install and passed html options. - htmlOptions = $$.copy($$.htmlOptions, expressInstallOptions, htmlOptions); - - // Invoke $block (with a copy of the merged html options) for each element. - return this.each(function(){ - block.call(this, $$.copy(htmlOptions)); - }); - -}; -/** - * - * @name flash.copy - * @desc Copy an arbitrary number of objects into a new object. - * @type Object - * - * @example $$.copy({ foo: 1 }, { bar: 2 }); - * @result { foo: 1, bar: 2 }; - * -**/ -$$.copy = function() { - var options = {}, flashvars = {}; - for(var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if(arg == undefined) continue; - jQuery.extend(options, arg); - // don't clobber one flash vars object with another - // merge them instead - if(arg.flashvars == undefined) continue; - jQuery.extend(flashvars, arg.flashvars); - } - options.flashvars = flashvars; - return options; -}; -/* - * @name flash.hasFlash - * @desc Check if a specific version of the Flash plugin is installed - * @type Boolean - * -**/ -$$.hasFlash = function() { - // look for a flag in the query string to bypass flash detection - if(/hasFlash\=true/.test(location)) return true; - if(/hasFlash\=false/.test(location)) return false; - var pv = $$.hasFlash.playerVersion().match(/\d+/g); - var rv = String([arguments[0], arguments[1], arguments[2]]).match(/\d+/g) || String($$.pluginOptions.version).match(/\d+/g); - for(var i = 0; i < 3; i++) { - pv[i] = parseInt(pv[i] || 0); - rv[i] = parseInt(rv[i] || 0); - // player is less than required - if(pv[i] < rv[i]) return false; - // player is greater than required - if(pv[i] > rv[i]) return true; - } - // major version, minor version and revision match exactly - return true; -}; -/** - * - * @name flash.hasFlash.playerVersion - * @desc Get the version of the installed Flash plugin. - * @type String - * -**/ -$$.hasFlash.playerVersion = function() { - // ie - try { - try { - // avoid fp6 minor version lookup issues - // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/ - var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6'); - try { axo.AllowScriptAccess = 'always'; } - catch(e) { return '6,0,0'; } - } catch(e) {} - return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; - // other browsers - } catch(e) { - try { - if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){ - return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]; - } - } catch(e) {} - } - return '0,0,0'; -}; -/** - * - * @name flash.htmlOptions - * @desc The default set of options for the object or embed tag. - * -**/ -$$.htmlOptions = { - height: 240, - flashvars: {}, - pluginspage: 'http://www.adobe.com/go/getflashplayer', - src: '#', - type: 'application/x-shockwave-flash', - width: 320 -}; -/** - * - * @name flash.pluginOptions - * @desc The default set of options for checking/updating the flash Plugin. - * -**/ -$$.pluginOptions = { - expressInstall: false, - update: true, - version: '6.0.65' -}; -/** - * - * @name flash.replace - * @desc The default method for replacing an element with a Flash movie. - * -**/ -$$.replace = function(htmlOptions) { - this.innerHTML = '
'+this.innerHTML+'
'; - jQuery(this) - .addClass('flash-replaced') - .prepend($$.transform(htmlOptions)); -}; -/** - * - * @name flash.update - * @desc The default method for replacing an element with an update message. - * -**/ -$$.update = function(htmlOptions) { - var url = String(location).split('?'); - url.splice(1,0,'?hasFlash=true&'); - url = url.join(''); - var msg = '

This content requires the Flash Player. Download Flash Player. Already have Flash Player? Click here.

'; - this.innerHTML = ''+this.innerHTML+''; - jQuery(this) - .addClass('flash-update') - .prepend(msg); -}; -/** - * - * @desc Convert a hash of html options to a string of attributes, using Function.apply(). - * @example toAttributeString.apply(htmlOptions) - * @result foo="bar" foo="bar" - * -**/ -function toAttributeString() { - var s = ''; - for(var key in this) - if(typeof this[key] != 'function') - s += key+'="'+this[key]+'" '; - return s; -}; -/** - * - * @desc Convert a hash of flashvars to a url-encoded string, using Function.apply(). - * @example toFlashvarsString.apply(flashvarsObject) - * @result foo=bar&foo=bar - * -**/ -function toFlashvarsString() { - var s = ''; - for(var key in this) - if(typeof this[key] != 'function') - s += key+'='+encodeURIComponent(this[key])+'&'; - return s.replace(/&$/, ''); -}; -/** - * - * @name flash.transform - * @desc Transform a set of html options into an embed tag. - * @type String - * - * @example $$.transform(htmlOptions) - * @result - * - * Note: The embed tag is NOT standards-compliant, but it - * works in all current browsers. flash.transform can be - * overwritten with a custom function to generate more - * standards-compliant markup. - * -**/ -$$.transform = function(htmlOptions) { - htmlOptions.toString = toAttributeString; - if(htmlOptions.flashvars) htmlOptions.flashvars.toString = toFlashvarsString; - return ''; -}; - -/** - * - * Flash Player 9 Fix (http://blog.deconcept.com/2006/07/28/swfobject-143-released/) - * -**/ -if (window.attachEvent) { - window.attachEvent("onbeforeunload", function(){ - __flash_unloadHandler = function() {}; - __flash_savedUnloadHandler = function() {}; - }); -} - -})(); -(function($){ - $._i18n = { trans: {}, 'default': 'en', language: 'en' }; - $.i18n = function() { - var getTrans = function(ns, str) { - var trans = false; - // check if string exists in translation - if ($._i18n.trans[$._i18n.language] - && $._i18n.trans[$._i18n.language][ns] - && $._i18n.trans[$._i18n.language][ns][str]) { - trans = $._i18n.trans[$._i18n.language][ns][str]; - } - // or exists in default - else if ($._i18n.trans[$._i18n['default']] - && $._i18n.trans[$._i18n['default']][ns] - && $._i18n.trans[$._i18n['default']][ns][str]) { - trans = $._i18n.trans[$._i18n['default']][ns][str]; - } - // return trans or original string - return trans || str; - }; - // Set language (accepted formats: en or en-US) - if (arguments.length < 2) { - $._i18n.language = arguments[0]; - return $._i18n.language; - } - else { - // get translation - if (typeof(arguments[1]) == 'string') { - var trans = getTrans(arguments[0], arguments[1]); - // has variables for string formating - if (arguments[2] && typeof(arguments[2]) == 'object') { - return $.format(trans, arguments[2]); - } - else { - return trans; - } - } - // set translation - else { - var tmp = arguments[0].split('.'); - var lang = tmp[0]; - var ns = tmp[1] || 'jQuery'; - if (!$._i18n.trans[lang]) { - $._i18n.trans[lang] = {}; - $._i18n.trans[lang][ns] = arguments[1]; - } - else { - $.extend($._i18n.trans[lang][ns], arguments[1]); - } - } - } - }; -})(jQuery); -/* - * Copyright (c) 2007-2008 Josh Bush (digitalbush.com) - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * 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 AND - * NONINFRINGEMENT. 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. - */ - -/* - * Version: 1.1.3 - * Release: 2008-04-16 - */ -(function($) { - - //Helper Function for Caret positioning - $.fn.caret=function(begin,end){ - if(this.length==0) return; - if (typeof begin == 'number') { - end = (typeof end == 'number')?end:begin; - return this.each(function(){ - if(this.setSelectionRange){ - this.focus(); - this.setSelectionRange(begin,end); - }else if (this.createTextRange){ - var range = this.createTextRange(); - range.collapse(true); - range.moveEnd('character', end); - range.moveStart('character', begin); - range.select(); - } - }); - } else { - if (this[0].setSelectionRange){ - begin = this[0].selectionStart; - end = this[0].selectionEnd; - }else if (document.selection && document.selection.createRange){ - var range = document.selection.createRange(); - begin = 0 - range.duplicate().moveStart('character', -100000); - end = begin + range.text.length; - } - return {begin:begin,end:end}; - } - }; - - //Predefined character definitions - var charMap={ - '9':"[0-9]", - 'a':"[A-Za-z]", - '*':"[A-Za-z0-9]" - }; - - //Helper method to inject character definitions - $.mask={ - addPlaceholder : function(c,r){ - charMap[c]=r; - } - }; - - $.fn.unmask=function(){ - return this.trigger("unmask"); - }; - - //Main Method - $.fn.mask = function(mask,settings) { - settings = $.extend({ - placeholder: "_", - completed: null - }, settings); - - //Build Regex for format validation - var re = new RegExp("^"+ - $.map( mask.split(""), function(c,i){ - return charMap[c]||((/[A-Za-z0-9]/.test(c)?"":"\\")+c); - }).join('')+ - "$"); - - return this.each(function(){ - var input=$(this); - var buffer=new Array(mask.length); - var locked=new Array(mask.length); - var valid=false; - var ignore=false; //Variable for ignoring control keys - var firstNonMaskPos=null; - - //Build buffer layout from mask & determine the first non masked character - $.each( mask.split(""), function(i,c){ - locked[i]=(charMap[c]==null); - buffer[i]=locked[i]?c:settings.placeholder; - if(!locked[i] && firstNonMaskPos==null) - firstNonMaskPos=i; - }); - - function focusEvent(){ - checkVal(); - writeBuffer(); - setTimeout(function(){ - $(input[0]).caret(valid?mask.length:firstNonMaskPos); - },0); - }; - - function keydownEvent(e){ - var pos=$(this).caret(); - var k = e.keyCode; - ignore=(k < 16 || (k > 16 && k < 32 ) || (k > 32 && k < 41)); - - //delete selection before proceeding - if((pos.begin-pos.end)!=0 && (!ignore || k==8 || k==46)){ - clearBuffer(pos.begin,pos.end); - } - //backspace and delete get special treatment - if(k==8){//backspace - while(pos.begin-->=0){ - if(!locked[pos.begin]){ - buffer[pos.begin]=settings.placeholder; - if($.browser.opera){ - //Opera won't let you cancel the backspace, so we'll let it backspace over a dummy character. - s=writeBuffer(); - input.val(s.substring(0,pos.begin)+" "+s.substring(pos.begin)); - $(this).caret(pos.begin+1); - }else{ - writeBuffer(); - $(this).caret(Math.max(firstNonMaskPos,pos.begin)); - } - return false; - } - } - }else if(k==46){//delete - clearBuffer(pos.begin,pos.begin+1); - writeBuffer(); - $(this).caret(Math.max(firstNonMaskPos,pos.begin)); - return false; - }else if (k==27){//escape - clearBuffer(0,mask.length); - writeBuffer(); - $(this).caret(firstNonMaskPos); - return false; - } - }; - - function keypressEvent(e){ - if(ignore){ - ignore=false; - //Fixes Mac FF bug on backspace - return (e.keyCode == 8)? false: null; - } - e=e||window.event; - var k=e.charCode||e.keyCode||e.which; - var pos=$(this).caret(); - - if(e.ctrlKey || e.altKey){//Ignore - return true; - }else if ((k>=41 && k<=122) ||k==32 || k>186){//typeable characters - var p=seekNext(pos.begin-1); - if(p - MIT-style license. -*/ - -(function($) { - - // Global variables, accessible to Slimbox only - var win = $(window), options, images, activeImage = -1, activeURL, prevImage, nextImage, compatibleOverlay, middle, centerWidth, centerHeight, ie6 = !window.XMLHttpRequest, - operaFix = window.opera && (document.compatMode == "CSS1Compat") && ($.browser.version >= 9.3), documentElement = document.documentElement, - - // Preload images - preload = {}, preloadPrev = new Image(), preloadNext = new Image(), - - // DOM elements - overlay, center, image, sizer, prevLink, nextLink, bottomContainer, bottom, caption, number; - - /* - Initialization - */ - - $(function() { - // Append the Slimbox HTML code at the bottom of the document - $("body").append( - $([ - overlay = $('
')[0], - center = $('
')[0], - bottomContainer = $('
')[0] - ]).css("display", "none") - ); - - image = $('
').appendTo(center).append( - sizer = $('
').append([ - prevLink = $('').click(previous)[0], - nextLink = $('').click(next)[0] - ])[0] - )[0]; - - bottom = $('
').appendTo(bottomContainer).append([ - $('').add(overlay).click(close)[0], - caption = $('
')[0], - number = $('
')[0], - $('
')[0] - ])[0]; - }); - - - /* - API - */ - - // Open Slimbox with the specified parameters - $.slimbox = function(_images, startImage, _options) { - options = $.extend({ - loop: false, // Allows to navigate between first and last images - overlayOpacity: 0.8, // 1 is opaque, 0 is completely transparent (change the color in the CSS file) - overlayFadeDuration: 400, // Duration of the overlay fade-in and fade-out animations (in milliseconds) - resizeDuration: 400, // Duration of each of the box resize animations (in milliseconds) - resizeEasing: "swing", // "swing" is jQuery's default easing - initialWidth: 250, // Initial width of the box (in pixels) - initialHeight: 250, // Initial height of the box (in pixels) - imageFadeDuration: 400, // Duration of the image fade-in animation (in milliseconds) - captionAnimationDuration: 400, // Duration of the caption animation (in milliseconds) - counterText: "Image {x} of {y}", // Translate or change as you wish, or set it to false to disable counter text for image groups - closeKeys: [27, 88, 67], // Array of keycodes to close Slimbox, default: Esc (27), 'x' (88), 'c' (67) - previousKeys: [37, 80], // Array of keycodes to navigate to the previous image, default: Left arrow (37), 'p' (80) - nextKeys: [39, 78] // Array of keycodes to navigate to the next image, default: Right arrow (39), 'n' (78) - }, _options); - - // The function is called for a single image, with URL and Title as first two arguments - if (typeof _images == "string") { - _images = [[_images, startImage]]; - startImage = 0; - } - - middle = win.scrollTop() + ((operaFix ? documentElement.clientHeight : win.height()) / 2); - centerWidth = options.initialWidth; - centerHeight = options.initialHeight; - $(center).css({top: Math.max(0, middle - (centerHeight / 2)), width: centerWidth, height: centerHeight, marginLeft: -centerWidth/2}).show(); - compatibleOverlay = ie6 || (overlay.currentStyle && (overlay.currentStyle.position != "fixed")); - if (compatibleOverlay) overlay.style.position = "absolute"; - $(overlay).css("opacity", options.overlayOpacity).fadeIn(options.overlayFadeDuration); - position(); - setup(1); - - images = _images; - options.loop = options.loop && (images.length > 1); - return changeImage(startImage); - }; - - /* - options: Optional options object, see jQuery.slimbox() - linkMapper: Optional function taking a link DOM element and an index as arguments and returning an array containing 2 elements: - the image URL and the image caption (may contain HTML) - linksFilter: Optional function taking a link DOM element and an index as arguments and returning true if the element is part of - the image collection that will be shown on click, false if not. "this" refers to the element that was clicked. - This function must always return true when the DOM element argument is "this". - */ - $.fn.slimbox = function(_options, linkMapper, linksFilter) { - linkMapper = linkMapper || function(el) { - return [el.href, el.title]; - }; - - linksFilter = linksFilter || function() { - return true; - }; - - var links = this; - - return links.unbind("click").click(function() { - // Build the list of images that will be displayed - var link = this, startIndex = 0, filteredLinks, i = 0, length; - filteredLinks = $.grep(links, function(el, i) { - return linksFilter.call(link, el, i); - }); - - // We cannot use jQuery.map() because it flattens the returned array - for (length = filteredLinks.length; i < length; ++i) { - if (filteredLinks[i] == link) startIndex = i; - filteredLinks[i] = linkMapper(filteredLinks[i], i); - } - - return $.slimbox(filteredLinks, startIndex, _options); - }); - }; - - - /* - Internal functions - */ - - function position() { - var l = win.scrollLeft(), w = operaFix ? documentElement.clientWidth : win.width(); - $([center, bottomContainer]).css("left", l + (w / 2)); - if (compatibleOverlay) $(overlay).css({left: l, top: win.scrollTop(), width: w, height: win.height()}); - } - - function setup(open) { - $("object").add(ie6 ? "select" : "embed").each(function(index, el) { - if (open) $.data(el, "slimbox", el.style.visibility); - el.style.visibility = open ? "hidden" : $.data(el, "slimbox"); - }); - var fn = open ? "bind" : "unbind"; - win[fn]("scroll resize", position); - $(document)[fn]("keydown", keyDown); - } - - function keyDown(event) { - var code = event.keyCode, fn = $.inArray; - // Prevent default keyboard action (like navigating inside the page) - return (fn(code, options.closeKeys) >= 0) ? close() - : (fn(code, options.nextKeys) >= 0) ? next() - : (fn(code, options.previousKeys) >= 0) ? previous() - : false; - } - - function previous() { - return changeImage(prevImage); - } - - function next() { - return changeImage(nextImage); - } - - function changeImage(imageIndex) { - if (imageIndex >= 0) { - activeImage = imageIndex; - activeURL = images[activeImage][0]; - prevImage = (activeImage || (options.loop ? images.length : 0)) - 1; - nextImage = ((activeImage + 1) % images.length) || (options.loop ? 0 : -1); - - stop(); - center.className = "lbLoading"; - - preload = new Image(); - preload.onload = animateBox; - preload.src = activeURL; - } - - return false; - } - - function animateBox() { - center.className = ""; - $(image).css({backgroundImage: "url(" + activeURL + ")", visibility: "hidden", display: ""}); - $(sizer).width(preload.width); - $([sizer, prevLink, nextLink]).height(preload.height); - - $(caption).html(images[activeImage][1] || ""); - $(number).html((((images.length > 1) && options.counterText) || "").replace(/{x}/, activeImage + 1).replace(/{y}/, images.length)); - - if (prevImage >= 0) preloadPrev.src = images[prevImage][0]; - if (nextImage >= 0) preloadNext.src = images[nextImage][0]; - - centerWidth = image.offsetWidth; - centerHeight = image.offsetHeight; - var top = Math.max(0, middle - (centerHeight / 2)); - if (center.offsetHeight != centerHeight) { - $(center).animate({height: centerHeight, top: top}, options.resizeDuration, options.resizeEasing); - } - if (center.offsetWidth != centerWidth) { - $(center).animate({width: centerWidth, marginLeft: -centerWidth/2}, options.resizeDuration, options.resizeEasing); - } - $(center).queue(function() { - $(bottomContainer).css({width: centerWidth, top: top + centerHeight, marginLeft: -centerWidth/2, visibility: "hidden", display: ""}); - $(image).css({display: "none", visibility: "", opacity: ""}).fadeIn(options.imageFadeDuration, animateCaption); - }); - } - - - function animateCaption() { - if (prevImage >= 0) $(prevLink).show(); - if (nextImage >= 0) $(nextLink).show(); - $(bottom).css("marginTop", -bottom.offsetHeight).animate({marginTop: 0}, options.captionAnimationDuration); - bottomContainer.style.visibility = ""; - } - - function stop() { - preload.onload = null; - preload.src = preloadPrev.src = preloadNext.src = activeURL; - $([center, image, bottom]).stop(true); - $([prevLink, nextLink, image, bottomContainer]).hide(); - } - - function close() { - if (activeImage >= 0) { - stop(); - activeImage = prevImage = nextImage = -1; - $(center).hide(); - $(overlay).stop().fadeOut(options.overlayFadeDuration, setup); - } - - return false; - } - -})(jQuery); -/* - * timeago: a jQuery plugin, version: 0.5.1 (08/20/2008) - * @requires jQuery v1.2 or later - * - * Timeago is a jQuery plugin that makes it easy to support automatically - * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago"). - * - * For usage and examples, visit: - * http://timeago.yarp.com/ - * - * Licensed under the MIT: - * http://www.opensource.org/licenses/mit-license.php - * - * Copyright (c) 2008, Ryan McGeary (ryanonjavascript -[at]- mcgeary [*dot*] org) - */ -(function($) { - $.timeago = function(timestamp) { - if (timestamp instanceof Date) return inWords(timestamp); - else if (typeof timestamp == "string") return inWords($.timeago.parse(timestamp)); - else return inWords($.timeago.parse($(timestamp).attr("title"))); - }; - var $t = $.timeago; - - $.extend($.timeago, { - settings: { - refreshMillis: 60000, - allowFuture: false, - strings: { - ago: "ago", - fromNow: "from now", - seconds: "less than a minute", - minute: "about a minute", - minutes: "%d minutes", - hour: "about an hour", - hours: "about %d hours", - day: "a day", - days: "%d days", - month: "about a month", - months: "%d months", - year: "about a year", - years: "%d years" - } - }, - inWords: function(distanceMillis) { - var $l = this.settings.strings; - var suffix = $l.ago; - if (this.settings.allowFuture) { - if (distanceMillis < 0) suffix = $l.fromNow; - distanceMillis = Math.abs(distanceMillis); - } - - var seconds = distanceMillis / 1000; - var minutes = seconds / 60; - var hours = minutes / 60; - var days = hours / 24; - var years = days / 365; - - var words = seconds < 45 && sprintf($l.seconds, Math.round(seconds)) || - seconds < 90 && $l.minute || - minutes < 45 && sprintf($l.minutes, Math.round(minutes)) || - minutes < 90 && $l.hour || - hours < 24 && sprintf($l.hours, Math.round(hours)) || - hours < 48 && $l.day || - days < 30 && sprintf($l.days, Math.floor(days)) || - days < 60 && $l.month || - days < 365 && sprintf($l.months, Math.floor(days / 30)) || - years < 2 && $l.year || - sprintf($l.years, Math.floor(years)); - - return words + " " + suffix; - }, - parse: function(iso8601) { - var s = $.trim(iso8601); - s = s.replace(/-/,"/").replace(/-/,"/"); - s = s.replace(/T/," ").replace(/Z/," UTC"); - s = s.replace(/([\+-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400 - return new Date(s); - } - }); - - $.fn.timeago = function() { - var self = this; - self.each(refresh); - - var $s = $t.settings; - if ($s.refreshMillis > 0) { - setInterval(function() { self.each(refresh); }, $s.refreshMillis); - } - return self; - }; - - function refresh() { - var date = $t.parse(this.title); - if (!isNaN(date)) { - $(this).text(inWords(date)); - } - return this; - } - - function inWords(date) { - return $t.inWords(distance(date)); - } - - function distance(date) { - return (new Date().getTime() - date.getTime()); - } - - // lame sprintf implementation - function sprintf(string, value) { - return string.replace(/%d/i, value); - } - - // fix for IE6 suckage - if ($.browser.msie && $.browser.version < 7.0) { - document.createElement('abbr'); - } -})(jQuery); - diff --git a/lib/jquery-utils/ui.timepickr.css b/lib/jquery-utils/ui.timepickr.css deleted file mode 100644 index dfc7edfb770..00000000000 --- a/lib/jquery-utils/ui.timepickr.css +++ /dev/null @@ -1,50 +0,0 @@ -.ui-timepickr { - display:none; - position:absolute; - padding:2px 2px 2px 0; -} - -.ui-timepickr-row { - padding:0; - float:right; - clear:both; - overflow:hidden; - margin:2px 0; - display:none; - position:relative; -} - -.ui-timepickr-button { - float:left; - margin:0; - padding:0; - list-style:none; - list-style-type:none; -} - -.ui-timepickr-button span { - font-size:.7em; - padding:4px 6px 4px 6px; - margin-left:2px; - text-align:center; - cursor:pointer; - display:block; - text-align:center; - - - /* system theme (default) */ - border-width:1px; - border-style:solid; - /*border-color:ThreeDLightShadow ThreeDShadow ThreeDShadow ThreeDLightShadow; - color:ButtonText; - background:ButtonFace;*/ -} - -.ui-timepickr-button span.ui-state-hover { - /*color:HighlightText; - background:Highlight;*/ -} - -.ui-state-hover span { - /*background:#c30;*/ -} diff --git a/lib/jquery-utils/ui.timepickr.js b/lib/jquery-utils/ui.timepickr.js deleted file mode 100644 index b9460e91219..00000000000 --- a/lib/jquery-utils/ui.timepickr.js +++ /dev/null @@ -1,387 +0,0 @@ -/* - jQuery ui.timepickr - @VERSION - http://code.google.com/p/jquery-utils/ - - (c) Maxime Haineault - http://haineault.com - - MIT License (http://www.opensource.org/licenses/mit-license.php - - Note: if you want the original experimental plugin checkout the rev 224 - - Dependencies - ------------ - - jquery.utils.js - - jquery.strings.js - - jquery.ui.js - -*/ - -(function($) { - - $.tpl('timepickr.menu', '
'); //todo: (heskew) make the corner an option just like the items - $.tpl('timepickr.row', '
    '); - $.tpl('timepickr.button', '
  1. {label:s}
  2. '); - - $.widget('ui.timepickr', { - options: { - convention: 12, // 24, 12 - trigger: 'focus', - format12: '{h:02.d}:{m:02.d} {z}', - format24: '{h:02.d}:{m:02.d}', - hours: true, - prefix: ['AM', 'PM'], - suffix: ['AM', 'PM'], - prefixVal: false, - suffixVal: true, - rangeHour12: $.range(1, 13), - rangeHour24: [$.range(0, 12), $.range(12, 24)], - rangeMin: $.range(0, 60, 15), - rangeSec: $.range(0, 60, 15), - corners: 'all', - // plugins - core: true, - minutes: true, - seconds: false, - val: false, - updateLive: true, - resetOnBlur: true, - keyboardnav: true, - handle: false, - handleEvent: 'click' - }, - - plugins: {}, - - _create: function() { - this._dom = { - menu: $.tpl('timepickr.menu'), - row: $.tpl('timepickr.menu') - }; - this._trigger('start'); - this._trigger('initialized'); - }, - - _trigger: function(type, e, ui) { - var ui = ui || this; - $.ui.plugin.call(this, type, [e, ui]); - return $.Widget.prototype._trigger.call(this, type, e, ui); - }, - - _createButton: function(i, format, className) { - var o = format && $.format(format, i) || i; - var cn = className && 'ui-timepickr-button ' + className || 'ui-timepickr-button'; - return $.tpl('timepickr.button', { className: cn, label: o }).data('id', i) - .bind('mouseover', function() { - $(this).siblings().find('span') - .removeClass('ui-state-hover').end().end() - .find('span').addClass('ui-state-hover'); - }); - - }, - - _addRow: function(range, format, className, insertAfter) { - var ui = this; - var btn = false; - var row = $.tpl('timepickr.row').bind('mouseover', function() { - $(this).next().slideDown(200); - }); - $.each(range, function(idx, val) { - ui._createButton(val, format || false).appendTo(row); - }); - if (className) { - $(row).addClass(className); - } - if (this.options.corners) { - row.find('span').addClass('ui-corner-' + this.options.corners); - } - if (insertAfter) { - row.insertAfter(insertAfter); - } - else { - ui._dom.menu.append(row); - } - return row; - }, - - _setVal: function(val) { - val = val || this._getVal(); - this.element.data('timepickr.initialValue', val); - this.element.val(this._formatVal(val)); - if (this._dom.menu.is(':hidden')) { - this.element.trigger('change'); - } - }, - - _getVal: function() { - var ols = this._dom.menu.find('ol'); - function get(unit) { - var u = ols.filter('.' + unit).find('.ui-state-hover:first').text(); - return u || ols.filter('.' + unit + 'li:first span').text(); - } - return { - h: get('hours'), - m: get('minutes'), - s: get('seconds'), - a: get('prefix'), - z: get('suffix'), - f: this.options['format' + this.c], - c: this.c - }; - }, - - _formatVal: function(ival) { - var val = ival || this._getVal(); - - if (!val.h) return; - - val.c = this.options.convention; - val.f = val.c === 12 && this.options.format12 || this.options.format24; - return (new Time(val)).getTime(); - }, - - blur: function() { - return this.element.blur(); - }, - - focus: function() { - return this.element.focus(); - }, - show: function() { - this._trigger('show'); - this._dom.menu.slideDown(200);; //todo: (heskew) make show effect an option - }, - hide: function() { - this._trigger('hide'); - this._dom.menu.slideUp(200); - } - - }); - - // These properties are shared accross every instances of timepickr - $.extend($.ui.timepickr, { - version: '@VERSION' - }); - - $.ui.plugin.add('timepickr', 'core', { - start: function(e, ui) { - var menu = ui._dom.menu; - var pos = ui.element.position(); - menu.insertAfter(ui.element).css('left', pos.left - 225); //todo: (heskew) right-align better and have alignment an option - - if (!$.boxModel) { // IE alignement fix - menu.css('margin-top', ui.element.height() + 8); - } - - ui.element - .bind(ui.options.trigger, function() { - ui._dom.menu.find('ol:first').show(); - ui._dom.menu.slideDown(200); - ui._trigger('focus'); - if (ui.options.trigger != 'focus') { - ui.element.focus(); - } - ui._trigger('focus'); - }) - .bind('blur', function() { - ui.hide(); - ui._trigger('blur'); - }); - - menu.find('li').bind('mouseover.timepickr', function() { - ui._trigger('refresh'); - }); - }, - refresh: function(e, ui) { - // Realign each menu layers - ui._dom.menu.find('ol').each(function() { - var p = $(this).prev('ol'); - try { // .. to not fuckup IE - $(this).css('left', p.position().left + p.find('.ui-state-hover').position().left); - } catch (e) { }; - }); - } - }); - - $.ui.plugin.add('timepickr', 'hours', { - start: function(e, ui) { - if (ui.options.convention === 24) { - // prefix is required in 24h mode - ui._dom.prefix = ui._addRow(ui.options.prefix, false, 'prefix'); - - // split-range - if ($.isArray(ui.options.rangeHour24[0])) { - var range = []; - $.merge(range, ui.options.rangeHour24[0]); - $.merge(range, ui.options.rangeHour24[1]); - ui._dom.hours = ui._addRow(range, '{0:0.2d}', 'hours'); - ui._dom.hours.find('li').slice(ui.options.rangeHour24[0].length, -1).hide(); - var lis = ui._dom.hours.find('li'); - - var show = [ - function() { - lis.slice(ui.options.rangeHour24[0].length).hide().end() - .slice(0, ui.options.rangeHour24[0].length).show() - .filter(':visible:first').trigger('mouseover'); - - }, - function() { - lis.slice(0, ui.options.rangeHour24[0].length).hide().end() - .slice(ui.options.rangeHour24[0].length).show() - .filter(':visible:first').trigger('mouseover'); - } - ]; - - ui._dom.prefix.find('li').bind('mouseover.timepickr', function() { - var index = ui._dom.menu.find('.prefix li').index(this); - show[index].call(); - }); - } - else { - ui._dom.hours = ui._addRow(ui.options.rangeHour24, '{0:0.2d}', 'hours'); - ui._dom.hours.find('li').slice(12, -1).hide(); - } - } - else { - ui._dom.hours = ui._addRow(ui.options.rangeHour12, '{0:0.2d}', 'hours'); - // suffix is required in 12h mode - ui._dom.suffix = ui._addRow(ui.options.suffix, false, 'suffix'); - } - } - }); - - $.ui.plugin.add('timepickr', 'minutes', { - start: function(e, ui) { - var p = ui._dom.hours && ui._dom.hours || false; - ui._dom.minutes = ui._addRow(ui.options.rangeMin, '{0:0.2d}', 'minutes', p); - } - }); - - $.ui.plugin.add('timepickr', 'seconds', { - start: function(e, ui) { - var p = ui._dom.minutes && ui._dom.minutes || false; - ui._dom.seconds = ui._addRow(ui.options.rangeSec, '{0:0.2d}', 'seconds', p); - } - }); - - $.ui.plugin.add('timepickr', 'val', { - start: function(e, ui) { - ui._setVal(ui.options.val); - } - }); - - $.ui.plugin.add('timepickr', 'updateLive', { - refresh: function(e, ui) { - ui._setVal(); - } - }); - - $.ui.plugin.add('timepickr', 'resetOnBlur', { - start: function(e, ui) { - ui.element.data('timepickr.initialValue', ui._getVal()); - ui._dom.menu.find('li > span').bind('mousedown.timepickr', function() { - ui.element.data('timepickr.initialValue', ui._getVal()); - }); - }, - blur: function(e, ui) { - ui._setVal(ui.element.data('timepickr.initialValue')); - } - }); - - $.ui.plugin.add('timepickr', 'handle', { - start: function(e, ui) { - $(ui.options.handle).bind(ui.options.handleEvent + '.timepickr', function() { - ui.show(); - }); - } - }); - - $.ui.plugin.add('timepickr', 'keyboardnav', { - start: function(e, ui) { - ui.element - .bind('keydown', function(e) { - if ($.keyIs('enter', e)) { - ui._setVal(); - ui.blur(); - } - else if ($.keyIs('escape', e)) { - ui.blur(); - } - }); - } - }); - - var Time = function() { // arguments: h, m, s, c, z, f || time string - if (!(this instanceof arguments.callee)) { - throw Error("Constructor called as a function"); - } - // arguments as literal object - if (arguments.length == 1 && $.isObject(arguments[0])) { - this.h = arguments[0].h || 0; - this.m = arguments[0].m || 0; - this.s = arguments[0].s || 0; - this.c = arguments[0].c && ($.inArray(arguments[0].c, [12, 24]) >= 0) && arguments[0].c || 24; - this.f = arguments[0].f || ((this.c == 12) && '{h:02.d}:{m:02.d} {z:02.d}' || '{h:02.d}:{m:02.d}'); - this.z = arguments[0].z || 'am'; - } - // arguments as string - else if (arguments.length < 4 && $.isString(arguments[1])) { - this.c = arguments[2] && ($.inArray(arguments[0], [12, 24]) >= 0) && arguments[0] || 24; - this.f = arguments[3] || ((this.c == 12) && '{h:02.d}:{m:02.d} {z:02.d}' || '{h:02.d}:{m:02.d}'); - this.z = arguments[4] || 'am'; - - this.h = arguments[1] || 0; // parse - this.m = arguments[1] || 0; // parse - this.s = arguments[1] || 0; // parse - } - // no arguments (now) - else if (arguments.length === 0) { - // now - } - // standards arguments - else { - this.h = arguments[0] || 0; - this.m = arguments[1] || 0; - this.s = arguments[2] || 0; - this.c = arguments[3] && ($.inArray(arguments[3], [12, 24]) >= 0) && arguments[3] || 24; - this.f = this.f || ((this.c == 12) && '{h:02.d}:{m:02.d} {z:02.d}' || '{h:02.d}:{m:02.d}'); - this.z = 'am'; - } - return this; - }; - - Time.prototype.get = function(p, f, u) { return u && this.h || $.format(f, this.h); }; - Time.prototype.getHours = function(unformated) { return this.get('h', '{0:02.d}', unformated); }; - Time.prototype.getMinutes = function(unformated) { return this.get('m', '{0:02.d}', unformated); }; - Time.prototype.getSeconds = function(unformated) { return this.get('s', '{0:02.d}', unformated); }; - Time.prototype.setFormat = function(format) { return this.f = format; }; - Time.prototype.getObject = function() { return { h: this.h, m: this.m, s: this.s, c: this.c, f: this.f, z: this.z }; }; - Time.prototype.getTime = function() { return $.format(this.f, { h: this.h, m: this.m, z: this.z }); }; - Time.prototype.parse = function(str) { - // 12h formats - if (this.c === 12) { - // Supported formats: (can't find any *official* standards for 12h..) - // - [hh]:[mm]:[ss] [zz] | [hh]:[mm] [zz] | [hh] [zz] - // - [hh]:[mm]:[ss] [z.z.] | [hh]:[mm] [z.z.] | [hh] [z.z.] - this.tokens = str.split(/\s|:/); - this.h = this.tokens[0] || 0; - this.m = this.tokens[1] || 0; - this.s = this.tokens[2] || 0; - this.z = this.tokens[3] || ''; - return this.getObject(); - } - // 24h formats - else { - // Supported formats: - // - ISO 8601: [hh][mm][ss] | [hh][mm] | [hh] - // - ISO 8601 extended: [hh]:[mm]:[ss] | [hh]:[mm] | [hh] - this.tokens = /:/.test(str) && str.split(/:/) || str.match(/[0-9]{2}/g); - this.h = this.tokens[0] || 0; - this.m = this.tokens[1] || 0; - this.s = this.tokens[2] || 0; - this.z = this.tokens[3] || ''; - return this.getObject(); - } - }; - -})(jQuery); diff --git a/lib/jquery.ui/AUTHORS.txt b/lib/jquery.ui/AUTHORS.txt deleted file mode 100644 index 637175b7628..00000000000 --- a/lib/jquery.ui/AUTHORS.txt +++ /dev/null @@ -1,30 +0,0 @@ -jQuery UI Authors (http://ui.jquery.com/about) - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -and logs, available at http://jquery-ui.googlecode.com/svn/ - -Brandon Aaron -Paul Bakaus (paulbakaus.com) -David Bolter -Rich Caloggero -Chi Cheng (cloudream@gmail.com) -Colin Clark (http://colin.atrc.utoronto.ca/) -Michelle D'Souza -Aaron Eisenberger (aaronchi@gmail.com) -Ariel Flesler -Bohdan Ganicky -Scott González -Marc Grabanski (m@marcgrabanski.com) -Klaus Hartl (stilbuero.de) -Scott Jehl -Cody Lindley -Eduardo Lundgren (eduardolundgren@gmail.com) -Todd Parker -John Resig -Patty Toland -Ca-Phun Ung (yelotofu.com) -Keith Wood (kbwood@virginbroadband.com.au) -Maggie Costello Wachs -Richard D. Worth (rdworth.org) -Jörn Zaefferer (bassistance.de) diff --git a/lib/jquery.ui/images/ui-bg_flat_0_aaaaaa_40x100.png b/lib/jquery.ui/images/ui-bg_flat_0_aaaaaa_40x100.png deleted file mode 100644 index 5b5dab2ab7b..00000000000 Binary files a/lib/jquery.ui/images/ui-bg_flat_0_aaaaaa_40x100.png and /dev/null differ diff --git a/lib/jquery.ui/images/ui-bg_flat_75_ffffff_40x100.png b/lib/jquery.ui/images/ui-bg_flat_75_ffffff_40x100.png deleted file mode 100644 index ac8b229af95..00000000000 Binary files a/lib/jquery.ui/images/ui-bg_flat_75_ffffff_40x100.png and /dev/null differ diff --git a/lib/jquery.ui/images/ui-bg_glass_55_fbf9ee_1x400.png b/lib/jquery.ui/images/ui-bg_glass_55_fbf9ee_1x400.png deleted file mode 100644 index b39a6fb27ff..00000000000 Binary files a/lib/jquery.ui/images/ui-bg_glass_55_fbf9ee_1x400.png and /dev/null differ diff --git a/lib/jquery.ui/images/ui-bg_glass_65_ffffff_1x400.png b/lib/jquery.ui/images/ui-bg_glass_65_ffffff_1x400.png deleted file mode 100644 index 42ccba269b6..00000000000 Binary files a/lib/jquery.ui/images/ui-bg_glass_65_ffffff_1x400.png and /dev/null differ diff --git a/lib/jquery.ui/images/ui-bg_glass_75_dadada_1x400.png b/lib/jquery.ui/images/ui-bg_glass_75_dadada_1x400.png deleted file mode 100644 index 5a46b47cb16..00000000000 Binary files a/lib/jquery.ui/images/ui-bg_glass_75_dadada_1x400.png and /dev/null differ diff --git a/lib/jquery.ui/images/ui-bg_glass_75_e6e6e6_1x400.png b/lib/jquery.ui/images/ui-bg_glass_75_e6e6e6_1x400.png deleted file mode 100644 index 38df73a2174..00000000000 Binary files a/lib/jquery.ui/images/ui-bg_glass_75_e6e6e6_1x400.png and /dev/null differ diff --git a/lib/jquery.ui/images/ui-bg_glass_95_fef1ec_1x400.png b/lib/jquery.ui/images/ui-bg_glass_95_fef1ec_1x400.png deleted file mode 100644 index 4443fdc1a15..00000000000 Binary files a/lib/jquery.ui/images/ui-bg_glass_95_fef1ec_1x400.png and /dev/null differ diff --git a/lib/jquery.ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/lib/jquery.ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png deleted file mode 100644 index 7c9fa6c6edc..00000000000 Binary files a/lib/jquery.ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png and /dev/null differ diff --git a/lib/jquery.ui/images/ui-icons_222222_256x240.png b/lib/jquery.ui/images/ui-icons_222222_256x240.png deleted file mode 100644 index ee039dc096a..00000000000 Binary files a/lib/jquery.ui/images/ui-icons_222222_256x240.png and /dev/null differ diff --git a/lib/jquery.ui/images/ui-icons_2e83ff_256x240.png b/lib/jquery.ui/images/ui-icons_2e83ff_256x240.png deleted file mode 100644 index 45e8928e528..00000000000 Binary files a/lib/jquery.ui/images/ui-icons_2e83ff_256x240.png and /dev/null differ diff --git a/lib/jquery.ui/images/ui-icons_454545_256x240.png b/lib/jquery.ui/images/ui-icons_454545_256x240.png deleted file mode 100644 index fe1085b393b..00000000000 Binary files a/lib/jquery.ui/images/ui-icons_454545_256x240.png and /dev/null differ diff --git a/lib/jquery.ui/images/ui-icons_888888_256x240.png b/lib/jquery.ui/images/ui-icons_888888_256x240.png deleted file mode 100644 index 5ba708c3917..00000000000 Binary files a/lib/jquery.ui/images/ui-icons_888888_256x240.png and /dev/null differ diff --git a/lib/jquery.ui/images/ui-icons_cd0a0a_256x240.png b/lib/jquery.ui/images/ui-icons_cd0a0a_256x240.png deleted file mode 100644 index 7930a558099..00000000000 Binary files a/lib/jquery.ui/images/ui-icons_cd0a0a_256x240.png and /dev/null differ diff --git a/lib/jquery.ui/jquery-ui-1.7.2.custom.css b/lib/jquery.ui/jquery-ui-1.7.2.custom.css deleted file mode 100644 index 444486b9b47..00000000000 --- a/lib/jquery.ui/jquery-ui-1.7.2.custom.css +++ /dev/null @@ -1,406 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } -.ui-widget-content a { color: #222222; } -.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } -.ui-widget-header a { color: #222222; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; outline: none; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; outline: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; } -.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; outline: none; } -.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; outline: none; text-decoration: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } -.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; } -.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } -.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; } - -/* Overlays */ -.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; }/* Accordion -----------------------------------*/ -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } -.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/* Dialog -----------------------------------*/ -.ui-dialog { position: relative; padding: .2em; width: 300px; } -.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs -----------------------------------*/ -.ui-tabs { padding: .2em; zoom: 1; } -.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } -.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/lib/jquery.ui/jquery.ui.core.js b/lib/jquery.ui/jquery.ui.core.js deleted file mode 100644 index e6e4fb3cc32..00000000000 --- a/lib/jquery.ui/jquery.ui.core.js +++ /dev/null @@ -1,226 +0,0 @@ -/*! - * jQuery UI 1.8b1 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - */ -;jQuery.ui || (function($) { - -var isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9); - -//Helper functions and ui object -$.ui = { - version: "1.8b1", - - // $.ui.plugin is deprecated. Use the proxy pattern instead. - plugin: { - add: function(module, option, set) { - var proto = $.ui[module].prototype; - for(var i in set) { - proto.plugins[i] = proto.plugins[i] || []; - proto.plugins[i].push([option, set[i]]); - } - }, - call: function(instance, name, args) { - var set = instance.plugins[name]; - if(!set || !instance.element[0].parentNode) { return; } - - for (var i = 0; i < set.length; i++) { - if (instance.options[set[i][0]]) { - set[i][1].apply(instance.element, args); - } - } - } - }, - - contains: function(a, b) { - return document.compareDocumentPosition - ? a.compareDocumentPosition(b) & 16 - : a !== b && a.contains(b); - }, - - hasScroll: function(el, a) { - - //If overflow is hidden, the element might have extra content, but the user wants to hide it - if ($(el).css('overflow') == 'hidden') { return false; } - - var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', - has = false; - - if (el[scroll] > 0) { return true; } - - // TODO: determine which cases actually cause this to happen - // if the element doesn't have the scroll set, see if it's possible to - // set the scroll - el[scroll] = 1; - has = (el[scroll] > 0); - el[scroll] = 0; - return has; - }, - - isOverAxis: function(x, reference, size) { - //Determines when x coordinate is over "b" element axis - return (x > reference) && (x < (reference + size)); - }, - - isOver: function(y, x, top, left, height, width) { - //Determines when x, y coordinates is over "b" element - return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width); - }, - - keyCode: { - BACKSPACE: 8, - CAPS_LOCK: 20, - COMMA: 188, - CONTROL: 17, - DELETE: 46, - DOWN: 40, - END: 35, - ENTER: 13, - ESCAPE: 27, - HOME: 36, - INSERT: 45, - LEFT: 37, - NUMPAD_ADD: 107, - NUMPAD_DECIMAL: 110, - NUMPAD_DIVIDE: 111, - NUMPAD_ENTER: 108, - NUMPAD_MULTIPLY: 106, - NUMPAD_SUBTRACT: 109, - PAGE_DOWN: 34, - PAGE_UP: 33, - PERIOD: 190, - RIGHT: 39, - SHIFT: 16, - SPACE: 32, - TAB: 9, - UP: 38 - } -}; - -// WAI-ARIA normalization -if (isFF2) { - var attr = $.attr, - removeAttr = $.fn.removeAttr, - ariaNS = "http://www.w3.org/2005/07/aaa", - ariaState = /^aria-/, - ariaRole = /^wairole:/; - - $.attr = function(elem, name, value) { - var set = value !== undefined; - - return (name == 'role' - ? (set - ? attr.call(this, elem, name, "wairole:" + value) - : (attr.apply(this, arguments) || "").replace(ariaRole, "")) - : (ariaState.test(name) - ? (set - ? elem.setAttributeNS(ariaNS, - name.replace(ariaState, "aaa:"), value) - : attr.call(this, elem, name.replace(ariaState, "aaa:"))) - : attr.apply(this, arguments))); - }; - - $.fn.removeAttr = function(name) { - return (ariaState.test(name) - ? this.each(function() { - this.removeAttributeNS(ariaNS, name.replace(ariaState, "")); - }) : removeAttr.call(this, name)); - }; -} - -//jQuery plugins -$.fn.extend({ - _focus: $.fn.focus, - focus: function(delay, fn) { - return typeof delay === 'number' - ? this.each(function() { - var elem = this; - setTimeout(function() { - $(elem).focus(); - (fn && fn.call(elem)); - }, delay); - }) - : this._focus.apply(this, arguments); - }, - - enableSelection: function() { - return this - .attr('unselectable', 'off') - .css('MozUserSelect', '') - .unbind('selectstart.ui'); - }, - - disableSelection: function() { - return this - .attr('unselectable', 'on') - .css('MozUserSelect', 'none') - .bind('selectstart.ui', function() { return false; }); - }, - - scrollParent: function() { - var scrollParent; - if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { - scrollParent = this.parents().filter(function() { - return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } else { - scrollParent = this.parents().filter(function() { - return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); - }).eq(0); - } - - return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; - }, - - zIndex: function(zIndex) { - if (zIndex !== undefined) { - return this.css('zIndex', zIndex); - } - - var elem = this[0]; - while (elem && elem.style) { - // IE returns 0 when zIndex is not specified - // other browsers return an empty string - // we ignore the case of nested elements with an explicit value of 0 - //
    - if (elem.style.zIndex !== '' && elem.style.zIndex !== 0) { - return +elem.style.zIndex; - } - elem = elem.parentNode; - } - - return 0; - } -}); - - -//Additional selectors -$.extend($.expr[':'], { - data: function(elem, i, match) { - return !!$.data(elem, match[3]); - }, - - focusable: function(element) { - var nodeName = element.nodeName.toLowerCase(), - tabIndex = $.attr(element, 'tabindex'); - return (/input|select|textarea|button|object/.test(nodeName) - ? !element.disabled - : 'a' == nodeName || 'area' == nodeName - ? element.href || !isNaN(tabIndex) - : !isNaN(tabIndex)) - // the element and all of its ancestors must be visible - // the browser may report that the area is hidden - && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length; - }, - - tabbable: function(element) { - var tabIndex = $.attr(element, 'tabindex'); - return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable'); - } -}); - -})(jQuery); diff --git a/lib/jquery.ui/jquery.ui.datepicker.js b/lib/jquery.ui/jquery.ui.datepicker.js deleted file mode 100644 index 092cdebf3b6..00000000000 --- a/lib/jquery.ui/jquery.ui.datepicker.js +++ /dev/null @@ -1,1721 +0,0 @@ -/* - * jQuery UI Datepicker 1.8b1 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Datepicker - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ - -(function($) { // hide the namespace - -$.extend($.ui, { datepicker: { version: "1.8b1" } }); - -var PROP_NAME = 'datepicker'; -var dpuuid = new Date().getTime(); - -/* Date picker manager. - Use the singleton instance of this class, $.datepicker, to interact with the date picker. - Settings for (groups of) date pickers are maintained in an instance object, - allowing multiple different settings on the same page. */ - -function Datepicker() { - this.debug = false; // Change this to true to start debugging - this._curInst = null; // The current instance in use - this._keyEvent = false; // If the last event was a key event - this._disabledInputs = []; // List of date picker inputs that have been disabled - this._datepickerShowing = false; // True if the popup picker is showing , false if not - this._inDialog = false; // True if showing within a "dialog", false if not - this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division - this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class - this._appendClass = 'ui-datepicker-append'; // The name of the append marker class - this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class - this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class - this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class - this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class - this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class - this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class - this.regional = []; // Available regional settings, indexed by language code - this.regional[''] = { // Default regional settings - closeText: 'Done', // Display text for close link - prevText: 'Prev', // Display text for previous month link - nextText: 'Next', // Display text for next month link - currentText: 'Today', // Display text for current month link - monthNames: ['January','February','March','April','May','June', - 'July','August','September','October','November','December'], // Names of months for drop-down and formatting - monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting - dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting - dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting - dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday - weekHeader: 'Wk', // Column header for week of the year - dateFormat: 'mm/dd/yy', // See format options on parseDate - firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... - isRTL: false, // True if right-to-left language, false if left-to-right - showMonthAfterYear: false, // True if the year select precedes month, false for month then year - yearSuffix: '' // Additional text to append to the year in the month headers - }; - this._defaults = { // Global defaults for all the date picker instances - showOn: 'focus', // 'focus' for popup on focus, - // 'button' for trigger button, or 'both' for either - showAnim: 'show', // Name of jQuery animation for popup - showOptions: {}, // Options for enhanced animations - defaultDate: null, // Used when field is blank: actual date, - // +/-number for offset from today, null for today - appendText: '', // Display text following the input box, e.g. showing the format - buttonText: '...', // Text for trigger button - buttonImage: '', // URL for trigger button image - buttonImageOnly: false, // True if the image appears alone, false if it appears on a button - hideIfNoPrevNext: false, // True to hide next/previous month links - // if not applicable, false to just disable them - navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links - gotoCurrent: false, // True if today link goes back to current selection instead - changeMonth: false, // True if month can be selected directly, false if only prev/next - changeYear: false, // True if year can be selected directly, false if only prev/next - yearRange: 'c-10:c+10', // Range of years to display in drop-down, - // either relative to today's year (-nn:+nn), relative to currently displayed year - // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) - showOtherMonths: false, // True to show dates in other months, false to leave blank - selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable - showWeek: false, // True to show week of the year, false to not show it - calculateWeek: this.iso8601Week, // How to calculate the week of the year, - // takes a Date and returns the number of the week for it - shortYearCutoff: '+10', // Short year values < this are in the current century, - // > this are in the previous century, - // string value starting with '+' for current year + value - minDate: null, // The earliest selectable date, or null for no limit - maxDate: null, // The latest selectable date, or null for no limit - duration: '_default', // Duration of display/closure - beforeShowDay: null, // Function that takes a date and returns an array with - // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '', - // [2] = cell title (optional), e.g. $.datepicker.noWeekends - beforeShow: null, // Function that takes an input field and - // returns a set of custom settings for the date picker - onSelect: null, // Define a callback function when a date is selected - onChangeMonthYear: null, // Define a callback function when the month or year is changed - onClose: null, // Define a callback function when the datepicker is closed - numberOfMonths: 1, // Number of months to show at a time - showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) - stepMonths: 1, // Number of months to step back/forward - stepBigMonths: 12, // Number of months to step back/forward for the big links - altField: '', // Selector for an alternate field to store selected dates into - altFormat: '', // The date format to use for the alternate field - constrainInput: true, // The input is constrained by the current date format - showButtonPanel: false, // True to show button panel, false to not show it - autoSize: false // True to size the input for the date format, false to leave as is - }; - $.extend(this._defaults, this.regional['']); - this.dpDiv = $('
    '); -} - -$.extend(Datepicker.prototype, { - /* Class name added to elements to indicate already configured with a date picker. */ - markerClassName: 'hasDatepicker', - - /* Debug logging (if enabled). */ - log: function () { - if (this.debug) - console.log.apply('', arguments); - }, - - // TODO rename to "widget" when switching to widget factory - _widgetDatepicker: function() { - return this.dpDiv; - }, - - /* Override the default settings for all instances of the date picker. - @param settings object - the new settings to use as defaults (anonymous object) - @return the manager object */ - setDefaults: function(settings) { - extendRemove(this._defaults, settings || {}); - return this; - }, - - /* Attach the date picker to a jQuery selection. - @param target element - the target input field or division or span - @param settings object - the new settings to use for this date picker instance (anonymous) */ - _attachDatepicker: function(target, settings) { - // check for settings on the control itself - in namespace 'date:' - var inlineSettings = null; - for (var attrName in this._defaults) { - var attrValue = target.getAttribute('date:' + attrName); - if (attrValue) { - inlineSettings = inlineSettings || {}; - try { - inlineSettings[attrName] = eval(attrValue); - } catch (err) { - inlineSettings[attrName] = attrValue; - } - } - } - var nodeName = target.nodeName.toLowerCase(); - var inline = (nodeName == 'div' || nodeName == 'span'); - if (!target.id) - target.id = 'dp' + (++this.uuid); - var inst = this._newInst($(target), inline); - inst.settings = $.extend({}, settings || {}, inlineSettings || {}); - if (nodeName == 'input') { - this._connectDatepicker(target, inst); - } else if (inline) { - this._inlineDatepicker(target, inst); - } - }, - - /* Create a new instance object. */ - _newInst: function(target, inline) { - var id = target[0].id.replace(/([^A-Za-z0-9_])/g, '\\\\$1'); // escape jQuery meta chars - return {id: id, input: target, // associated target - selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection - drawMonth: 0, drawYear: 0, // month being drawn - inline: inline, // is datepicker inline or not - dpDiv: (!inline ? this.dpDiv : // presentation div - $('
    '))}; - }, - - /* Attach the date picker to an input field. */ - _connectDatepicker: function(target, inst) { - var input = $(target); - inst.append = $([]); - inst.trigger = $([]); - if (input.hasClass(this.markerClassName)) - return; - this._attachments(input, inst); - input.addClass(this.markerClassName).keydown(this._doKeyDown). - keypress(this._doKeyPress).keyup(this._doKeyUp). - bind("setData.datepicker", function(event, key, value) { - inst.settings[key] = value; - }).bind("getData.datepicker", function(event, key) { - return this._get(inst, key); - }); - this._autoSize(inst); - $.data(target, PROP_NAME, inst); - }, - - /* Make attachments based on settings. */ - _attachments: function(input, inst) { - var appendText = this._get(inst, 'appendText'); - var isRTL = this._get(inst, 'isRTL'); - if (inst.append) - inst.append.remove(); - if (appendText) { - inst.append = $('' + appendText + ''); - input[isRTL ? 'before' : 'after'](inst.append); - } - input.unbind('focus', this._showDatepicker); - if (inst.trigger) - inst.trigger.remove(); - var showOn = this._get(inst, 'showOn'); - if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field - input.focus(this._showDatepicker); - if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked - var buttonText = this._get(inst, 'buttonText'); - var buttonImage = this._get(inst, 'buttonImage'); - inst.trigger = $(this._get(inst, 'buttonImageOnly') ? - $('').addClass(this._triggerClass). - attr({ src: buttonImage, alt: buttonText, title: buttonText }) : - $('').addClass(this._triggerClass). - html(buttonImage == '' ? buttonText : $('').attr( - { src:buttonImage, alt:buttonText, title:buttonText }))); - input[isRTL ? 'before' : 'after'](inst.trigger); - inst.trigger.click(function() { - if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) - $.datepicker._hideDatepicker(); - else - $.datepicker._showDatepicker(input[0]); - return false; - }); - } - }, - - /* Apply the maximum length for the date format. */ - _autoSize: function(inst) { - if (this._get(inst, 'autoSize') && !inst.inline) { - var date = new Date(2009, 12 - 1, 20); // Ensure double digits - var dateFormat = this._get(inst, 'dateFormat'); - if (dateFormat.match(/[DM]/)) { - var findMax = function(names) { - var max = 0; - var maxI = 0; - for (var i = 0; i < names.length; i++) { - if (names[i].length > max) { - max = names[i].length; - maxI = i; - } - } - return maxI; - }; - date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? - 'monthNames' : 'monthNamesShort')))); - date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? - 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay()); - } - inst.input.attr('size', this._formatDate(inst, date).length); - } - }, - - /* Attach an inline date picker to a div. */ - _inlineDatepicker: function(target, inst) { - var divSpan = $(target); - if (divSpan.hasClass(this.markerClassName)) - return; - divSpan.addClass(this.markerClassName).append(inst.dpDiv). - bind("setData.datepicker", function(event, key, value){ - inst.settings[key] = value; - }).bind("getData.datepicker", function(event, key){ - return this._get(inst, key); - }); - $.data(target, PROP_NAME, inst); - this._setDate(inst, this._getDefaultDate(inst), true); - this._updateDatepicker(inst); - this._updateAlternate(inst); - }, - - /* Pop-up the date picker in a "dialog" box. - @param input element - ignored - @param date string or Date - the initial date to display - @param onSelect function - the function to call when a date is selected - @param settings object - update the dialog date picker instance's settings (anonymous object) - @param pos int[2] - coordinates for the dialog's position within the screen or - event - with x/y coordinates or - leave empty for default (screen centre) - @return the manager object */ - _dialogDatepicker: function(input, date, onSelect, settings, pos) { - var inst = this._dialogInst; // internal instance - if (!inst) { - var id = 'dp' + (++this.uuid); - this._dialogInput = $(''); - this._dialogInput.keydown(this._doKeyDown); - $('body').append(this._dialogInput); - inst = this._dialogInst = this._newInst(this._dialogInput, false); - inst.settings = {}; - $.data(this._dialogInput[0], PROP_NAME, inst); - } - extendRemove(inst.settings, settings || {}); - date = (date && date.constructor == Date ? this._formatDate(inst, date) : date); - this._dialogInput.val(date); - - this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); - if (!this._pos) { - var browserWidth = document.documentElement.clientWidth; - var browserHeight = document.documentElement.clientHeight; - var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; - var scrollY = document.documentElement.scrollTop || document.body.scrollTop; - this._pos = // should use actual width/height below - [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; - } - - // move input on screen for focus, but hidden behind dialog - this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px'); - inst.settings.onSelect = onSelect; - this._inDialog = true; - this.dpDiv.addClass(this._dialogClass); - this._showDatepicker(this._dialogInput[0]); - if ($.blockUI) - $.blockUI(this.dpDiv); - $.data(this._dialogInput[0], PROP_NAME, inst); - return this; - }, - - /* Detach a datepicker from its control. - @param target element - the target input field or division or span */ - _destroyDatepicker: function(target) { - var $target = $(target); - var inst = $.data(target, PROP_NAME); - if (!$target.hasClass(this.markerClassName)) { - return; - } - var nodeName = target.nodeName.toLowerCase(); - $.removeData(target, PROP_NAME); - if (nodeName == 'input') { - inst.append.remove(); - inst.trigger.remove(); - $target.removeClass(this.markerClassName). - unbind('focus', this._showDatepicker). - unbind('keydown', this._doKeyDown). - unbind('keypress', this._doKeyPress). - unbind('keyup', this._doKeyUp); - } else if (nodeName == 'div' || nodeName == 'span') - $target.removeClass(this.markerClassName).empty(); - }, - - /* Enable the date picker to a jQuery selection. - @param target element - the target input field or division or span */ - _enableDatepicker: function(target) { - var $target = $(target); - var inst = $.data(target, PROP_NAME); - if (!$target.hasClass(this.markerClassName)) { - return; - } - var nodeName = target.nodeName.toLowerCase(); - if (nodeName == 'input') { - target.disabled = false; - inst.trigger.filter('button'). - each(function() { this.disabled = false; }).end(). - filter('img').css({opacity: '1.0', cursor: ''}); - } - else if (nodeName == 'div' || nodeName == 'span') { - var inline = $target.children('.' + this._inlineClass); - inline.children().removeClass('ui-state-disabled'); - } - this._disabledInputs = $.map(this._disabledInputs, - function(value) { return (value == target ? null : value); }); // delete entry - }, - - /* Disable the date picker to a jQuery selection. - @param target element - the target input field or division or span */ - _disableDatepicker: function(target) { - var $target = $(target); - var inst = $.data(target, PROP_NAME); - if (!$target.hasClass(this.markerClassName)) { - return; - } - var nodeName = target.nodeName.toLowerCase(); - if (nodeName == 'input') { - target.disabled = true; - inst.trigger.filter('button'). - each(function() { this.disabled = true; }).end(). - filter('img').css({opacity: '0.5', cursor: 'default'}); - } - else if (nodeName == 'div' || nodeName == 'span') { - var inline = $target.children('.' + this._inlineClass); - inline.children().addClass('ui-state-disabled'); - } - this._disabledInputs = $.map(this._disabledInputs, - function(value) { return (value == target ? null : value); }); // delete entry - this._disabledInputs[this._disabledInputs.length] = target; - }, - - /* Is the first field in a jQuery collection disabled as a datepicker? - @param target element - the target input field or division or span - @return boolean - true if disabled, false if enabled */ - _isDisabledDatepicker: function(target) { - if (!target) { - return false; - } - for (var i = 0; i < this._disabledInputs.length; i++) { - if (this._disabledInputs[i] == target) - return true; - } - return false; - }, - - /* Retrieve the instance data for the target control. - @param target element - the target input field or division or span - @return object - the associated instance data - @throws error if a jQuery problem getting data */ - _getInst: function(target) { - try { - return $.data(target, PROP_NAME); - } - catch (err) { - throw 'Missing instance data for this datepicker'; - } - }, - - /* Update or retrieve the settings for a date picker attached to an input field or division. - @param target element - the target input field or division or span - @param name object - the new settings to update or - string - the name of the setting to change or retrieve, - when retrieving also 'all' for all instance settings or - 'defaults' for all global defaults - @param value any - the new value for the setting - (omit if above is an object or to retrieve a value) */ - _optionDatepicker: function(target, name, value) { - var inst = this._getInst(target); - if (arguments.length == 2 && typeof name == 'string') { - return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) : - (inst ? (name == 'all' ? $.extend({}, inst.settings) : - this._get(inst, name)) : null)); - } - var settings = name || {}; - if (typeof name == 'string') { - settings = {}; - settings[name] = value; - } - if (inst) { - if (this._curInst == inst) { - this._hideDatepicker(); - } - var date = this._getDateDatepicker(target, true); - extendRemove(inst.settings, settings); - this._attachments($(target), inst); - this._autoSize(inst); - this._setDateDatepicker(target, date); - this._updateDatepicker(inst); - } - }, - - // change method deprecated - _changeDatepicker: function(target, name, value) { - this._optionDatepicker(target, name, value); - }, - - /* Redraw the date picker attached to an input field or division. - @param target element - the target input field or division or span */ - _refreshDatepicker: function(target) { - var inst = this._getInst(target); - if (inst) { - this._updateDatepicker(inst); - } - }, - - /* Set the dates for a jQuery selection. - @param target element - the target input field or division or span - @param date Date - the new date */ - _setDateDatepicker: function(target, date) { - var inst = this._getInst(target); - if (inst) { - this._setDate(inst, date); - this._updateDatepicker(inst); - this._updateAlternate(inst); - } - }, - - /* Get the date(s) for the first entry in a jQuery selection. - @param target element - the target input field or division or span - @param noDefault boolean - true if no default date is to be used - @return Date - the current date */ - _getDateDatepicker: function(target, noDefault) { - var inst = this._getInst(target); - if (inst && !inst.inline) - this._setDateFromField(inst, noDefault); - return (inst ? this._getDate(inst) : null); - }, - - /* Handle keystrokes. */ - _doKeyDown: function(event) { - var inst = $.datepicker._getInst(event.target); - var handled = true; - var isRTL = inst.dpDiv.is('.ui-datepicker-rtl'); - inst._keyEvent = true; - if ($.datepicker._datepickerShowing) - switch (event.keyCode) { - case 9: $.datepicker._hideDatepicker(); - handled = false; - break; // hide on tab out - case 13: var sel = $('td.' + $.datepicker._dayOverClass, inst.dpDiv). - add($('td.' + $.datepicker._currentClass, inst.dpDiv)); - if (sel[0]) - $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); - else - $.datepicker._hideDatepicker(); - return false; // don't submit the form - break; // select the value on enter - case 27: $.datepicker._hideDatepicker(); - break; // hide on escape - case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? - -$.datepicker._get(inst, 'stepBigMonths') : - -$.datepicker._get(inst, 'stepMonths')), 'M'); - break; // previous month/year on page up/+ ctrl - case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? - +$.datepicker._get(inst, 'stepBigMonths') : - +$.datepicker._get(inst, 'stepMonths')), 'M'); - break; // next month/year on page down/+ ctrl - case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); - handled = event.ctrlKey || event.metaKey; - break; // clear on ctrl or command +end - case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); - handled = event.ctrlKey || event.metaKey; - break; // current on ctrl or command +home - case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); - handled = event.ctrlKey || event.metaKey; - // -1 day on ctrl or command +left - if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? - -$.datepicker._get(inst, 'stepBigMonths') : - -$.datepicker._get(inst, 'stepMonths')), 'M'); - // next month/year on alt +left on Mac - break; - case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); - handled = event.ctrlKey || event.metaKey; - break; // -1 week on ctrl or command +up - case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); - handled = event.ctrlKey || event.metaKey; - // +1 day on ctrl or command +right - if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? - +$.datepicker._get(inst, 'stepBigMonths') : - +$.datepicker._get(inst, 'stepMonths')), 'M'); - // next month/year on alt +right - break; - case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); - handled = event.ctrlKey || event.metaKey; - break; // +1 week on ctrl or command +down - default: handled = false; - } - else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home - $.datepicker._showDatepicker(this); - else { - handled = false; - } - if (handled) { - event.preventDefault(); - event.stopPropagation(); - } - }, - - /* Filter entered characters - based on date format. */ - _doKeyPress: function(event) { - var inst = $.datepicker._getInst(event.target); - if ($.datepicker._get(inst, 'constrainInput')) { - var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')); - var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); - return event.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); - } - }, - - /* Synchronise manual entry and field/alternate field. */ - _doKeyUp: function(event) { - var inst = $.datepicker._getInst(event.target); - if (inst.input.val() != inst.lastVal) { - try { - var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), - (inst.input ? inst.input.val() : null), - $.datepicker._getFormatConfig(inst)); - if (date) { // only if valid - $.datepicker._setDateFromField(inst); - $.datepicker._updateAlternate(inst); - $.datepicker._updateDatepicker(inst); - } - } - catch (event) { - $.datepicker.log(event); - } - } - return true; - }, - - /* Pop-up the date picker for a given input field. - @param input element - the input field attached to the date picker or - event - if triggered by focus */ - _showDatepicker: function(input) { - input = input.target || input; - if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger - input = $('input', input.parentNode)[0]; - if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here - return; - var inst = $.datepicker._getInst(input); - if ($.datepicker._curInst && $.datepicker._curInst != inst) { - $.datepicker._curInst.dpDiv.stop(true, true); - } - var beforeShow = $.datepicker._get(inst, 'beforeShow'); - extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {})); - $.datepicker._lastInput = input; - $.datepicker._setDateFromField(inst); - if ($.datepicker._inDialog) // hide cursor - input.value = ''; - if (!$.datepicker._pos) { // position below input - $.datepicker._pos = $.datepicker._findPos(input); - $.datepicker._pos[1] += input.offsetHeight; // add the height - } - var isFixed = false; - $(input).parents().each(function() { - isFixed |= $(this).css('position') == 'fixed'; - return !isFixed; - }); - if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled - $.datepicker._pos[0] -= document.documentElement.scrollLeft; - $.datepicker._pos[1] -= document.documentElement.scrollTop; - } - var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; - $.datepicker._pos = null; - // determine sizing offscreen - inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); - $.datepicker._updateDatepicker(inst); - // fix width for dynamic number of date pickers - // and adjust position before showing - offset = $.datepicker._checkOffset(inst, offset, isFixed); - inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? - 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', - left: offset.left + 'px', top: offset.top + 'px'}); - if (!inst.inline) { - var showAnim = $.datepicker._get(inst, 'showAnim'); - var duration = $.datepicker._get(inst, 'duration'); - var postProcess = function() { - $.datepicker._datepickerShowing = true; - var borders = $.datepicker._getBorders(inst.dpDiv); - inst.dpDiv.find('iframe.ui-datepicker-cover'). // IE6- only - css({left: -borders[0], top: -borders[1], - width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}); - }; - if ($.effects && $.effects[showAnim]) - inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); - else - inst.dpDiv[showAnim || 'show']((showAnim ? duration : ''), postProcess); - if (!showAnim) - postProcess(); - if (inst.input[0].type != 'hidden') - inst.input[0].focus(); - $.datepicker._curInst = inst; - } - }, - - /* Generate the date picker content. */ - _updateDatepicker: function(inst) { - var self = this; - var borders = $.datepicker._getBorders(inst.dpDiv); - inst.dpDiv.empty().append(this._generateHTML(inst)) - .find('iframe.ui-datepicker-cover') // IE6- only - .css({left: -borders[0], top: -borders[1], - width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}) - .end() - .find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a') - .bind('mouseout', function(){ - $(this).removeClass('ui-state-hover'); - if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); - if(this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); - }) - .bind('mouseover', function(){ - if (!self._isDisabledDatepicker( inst.inline ? inst.dpDiv.parent()[0] : inst.input[0])) { - $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); - $(this).addClass('ui-state-hover'); - if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); - if(this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); - } - }) - .end() - .find('.' + this._dayOverClass + ' a') - .trigger('mouseover') - .end(); - var numMonths = this._getNumberOfMonths(inst); - var cols = numMonths[1]; - var width = 17; - if (cols > 1) - inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); - else - inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); - inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + - 'Class']('ui-datepicker-multi'); - inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + - 'Class']('ui-datepicker-rtl'); - if (inst.input && inst.input[0].type != 'hidden' && inst == $.datepicker._curInst) - $(inst.input[0]).focus(); - }, - - /* Retrieve the size of left and top borders for an element. - @param elem (jQuery object) the element of interest - @return (number[2]) the left and top borders */ - _getBorders: function(elem) { - var convert = function(value) { - return {thin: 1, medium: 2, thick: 3}[value] || value; - }; - return [parseFloat(convert(elem.css('border-left-width'))), - parseFloat(convert(elem.css('border-top-width')))]; - }, - - /* Check positioning to remain on screen. */ - _checkOffset: function(inst, offset, isFixed) { - var dpWidth = inst.dpDiv.outerWidth(); - var dpHeight = inst.dpDiv.outerHeight(); - var inputWidth = inst.input ? inst.input.outerWidth() : 0; - var inputHeight = inst.input ? inst.input.outerHeight() : 0; - var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft(); - var viewHeight = document.documentElement.clientHeight + $(document).scrollTop(); - - offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); - offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; - offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; - - // now check if datepicker is showing outside window viewport - move to a better place if so. - offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? - Math.abs(offset.left + dpWidth - viewWidth) : 0); - offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? - Math.abs(offset.top + dpHeight + inputHeight * 2 - viewHeight) : 0); - - return offset; - }, - - /* Find an object's position on the screen. */ - _findPos: function(obj) { - while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) { - obj = obj.nextSibling; - } - var position = $(obj).offset(); - return [position.left, position.top]; - }, - - /* Hide the date picker from view. - @param input element - the input field attached to the date picker */ - _hideDatepicker: function(input) { - var inst = this._curInst; - if (!inst || (input && inst != $.data(input, PROP_NAME))) - return; - if (this._datepickerShowing) { - var showAnim = this._get(inst, 'showAnim'); - var duration = this._get(inst, 'duration'); - var postProcess = function() { - $.datepicker._tidyDialog(inst); - this._curInst = null; - }; - if ($.effects && $.effects[showAnim]) - inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); - else - inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' : - (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : ''), postProcess); - if (!showAnim) - postProcess(); - var onClose = this._get(inst, 'onClose'); - if (onClose) - onClose.apply((inst.input ? inst.input[0] : null), - [(inst.input ? inst.input.val() : ''), inst]); // trigger custom callback - this._datepickerShowing = false; - this._lastInput = null; - if (this._inDialog) { - this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); - if ($.blockUI) { - $.unblockUI(); - $('body').append(this.dpDiv); - } - } - this._inDialog = false; - } - }, - - /* Tidy up after a dialog display. */ - _tidyDialog: function(inst) { - inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar'); - }, - - /* Close date picker if clicked elsewhere. */ - _checkExternalClick: function(event) { - if (!$.datepicker._curInst) - return; - var $target = $(event.target); - if ($target[0].id != $.datepicker._mainDivId && - $target.parents('#' + $.datepicker._mainDivId).length == 0 && - !$target.hasClass($.datepicker.markerClassName) && - !$target.hasClass($.datepicker._triggerClass) && - $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) - $.datepicker._hideDatepicker(); - }, - - /* Adjust one of the date sub-fields. */ - _adjustDate: function(id, offset, period) { - var target = $(id); - var inst = this._getInst(target[0]); - if (this._isDisabledDatepicker(target[0])) { - return; - } - this._adjustInstDate(inst, offset + - (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning - period); - this._updateDatepicker(inst); - }, - - /* Action for current link. */ - _gotoToday: function(id) { - var target = $(id); - var inst = this._getInst(target[0]); - if (this._get(inst, 'gotoCurrent') && inst.currentDay) { - inst.selectedDay = inst.currentDay; - inst.drawMonth = inst.selectedMonth = inst.currentMonth; - inst.drawYear = inst.selectedYear = inst.currentYear; - } - else { - var date = new Date(); - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - } - this._notifyChange(inst); - this._adjustDate(target); - }, - - /* Action for selecting a new month/year. */ - _selectMonthYear: function(id, select, period) { - var target = $(id); - var inst = this._getInst(target[0]); - inst._selectingMonthYear = false; - inst['selected' + (period == 'M' ? 'Month' : 'Year')] = - inst['draw' + (period == 'M' ? 'Month' : 'Year')] = - parseInt(select.options[select.selectedIndex].value,10); - this._notifyChange(inst); - this._adjustDate(target); - }, - - /* Restore input focus after not changing month/year. */ - _clickMonthYear: function(id) { - var target = $(id); - var inst = this._getInst(target[0]); - if (inst.input && inst._selectingMonthYear && !$.browser.msie) - inst.input[0].focus(); - inst._selectingMonthYear = !inst._selectingMonthYear; - }, - - /* Action for selecting a day. */ - _selectDay: function(id, month, year, td) { - var target = $(id); - if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { - return; - } - var inst = this._getInst(target[0]); - inst.selectedDay = inst.currentDay = $('a', td).html(); - inst.selectedMonth = inst.currentMonth = month; - inst.selectedYear = inst.currentYear = year; - this._selectDate(id, this._formatDate(inst, - inst.currentDay, inst.currentMonth, inst.currentYear)); - }, - - /* Erase the input field and hide the date picker. */ - _clearDate: function(id) { - var target = $(id); - var inst = this._getInst(target[0]); - this._selectDate(target, ''); - }, - - /* Update the input field with the selected date. */ - _selectDate: function(id, dateStr) { - var target = $(id); - var inst = this._getInst(target[0]); - dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); - if (inst.input) - inst.input.val(dateStr); - this._updateAlternate(inst); - var onSelect = this._get(inst, 'onSelect'); - if (onSelect) - onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback - else if (inst.input) - inst.input.trigger('change'); // fire the change event - if (inst.inline) - this._updateDatepicker(inst); - else { - this._hideDatepicker(); - this._lastInput = inst.input[0]; - if (typeof(inst.input[0]) != 'object') - inst.input[0].focus(); // restore focus - this._lastInput = null; - } - }, - - /* Update any alternate field to synchronise with the main field. */ - _updateAlternate: function(inst) { - var altField = this._get(inst, 'altField'); - if (altField) { // update alternate field too - var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); - var date = this._getDate(inst); - var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); - $(altField).each(function() { $(this).val(dateStr); }); - } - }, - - /* Set as beforeShowDay function to prevent selection of weekends. - @param date Date - the date to customise - @return [boolean, string] - is this date selectable?, what is its CSS class? */ - noWeekends: function(date) { - var day = date.getDay(); - return [(day > 0 && day < 6), '']; - }, - - /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. - @param date Date - the date to get the week for - @return number - the number of the week within the year that contains this date */ - iso8601Week: function(date) { - var checkDate = new Date(date.getTime()); - // Find Thursday of this week starting on Monday - checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); - var time = checkDate.getTime(); - checkDate.setMonth(0); // Compare with Jan 1 - checkDate.setDate(1); - return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; - }, - - /* Parse a string value into a date object. - See formatDate below for the possible formats. - - @param format string - the expected format of the date - @param value string - the date in the above format - @param settings Object - attributes include: - shortYearCutoff number - the cutoff year for determining the century (optional) - dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) - dayNames string[7] - names of the days from Sunday (optional) - monthNamesShort string[12] - abbreviated names of the months (optional) - monthNames string[12] - names of the months (optional) - @return Date - the extracted date value or null if value is blank */ - parseDate: function (format, value, settings) { - if (format == null || value == null) - throw 'Invalid arguments'; - value = (typeof value == 'object' ? value.toString() : value + ''); - if (value == '') - return null; - var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; - var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; - var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; - var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; - var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; - var year = -1; - var month = -1; - var day = -1; - var doy = -1; - var literal = false; - // Check whether a format character is doubled - var lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); - if (matches) - iFormat++; - return matches; - }; - // Extract a number from the string value - var getNumber = function(match) { - lookAhead(match); - var size = (match == '@' ? 14 : (match == '!' ? 20 : - (match == 'y' ? 4 : (match == 'o' ? 3 : 2)))); - var digits = new RegExp('^\\d{1,' + size + '}'); - var num = value.substring(iValue).match(digits); - if (!num) - throw 'Missing number at position ' + iValue; - iValue += num[0].length; - return parseInt(num[0], 10); - }; - // Extract a name from the string value and convert to an index - var getName = function(match, shortNames, longNames) { - var names = (lookAhead(match) ? longNames : shortNames); - for (var i = 0; i < names.length; i++) { - if (value.substr(iValue, names[i].length) == names[i]) { - iValue += names[i].length; - return i + 1; - } - } - throw 'Unknown name at position ' + iValue; - }; - // Confirm that a literal character matches the string value - var checkLiteral = function() { - if (value.charAt(iValue) != format.charAt(iFormat)) - throw 'Unexpected literal at position ' + iValue; - iValue++; - }; - var iValue = 0; - for (var iFormat = 0; iFormat < format.length; iFormat++) { - if (literal) - if (format.charAt(iFormat) == "'" && !lookAhead("'")) - literal = false; - else - checkLiteral(); - else - switch (format.charAt(iFormat)) { - case 'd': - day = getNumber('d'); - break; - case 'D': - getName('D', dayNamesShort, dayNames); - break; - case 'o': - doy = getNumber('o'); - break; - case 'm': - month = getNumber('m'); - break; - case 'M': - month = getName('M', monthNamesShort, monthNames); - break; - case 'y': - year = getNumber('y'); - break; - case '@': - var date = new Date(getNumber('@')); - year = date.getFullYear(); - month = date.getMonth() + 1; - day = date.getDate(); - break; - case '!': - var date = new Date((getNumber('!') - this._ticksTo1970) / 10000); - year = date.getFullYear(); - month = date.getMonth() + 1; - day = date.getDate(); - break; - case "'": - if (lookAhead("'")) - checkLiteral(); - else - literal = true; - break; - default: - checkLiteral(); - } - } - if (year == -1) - year = new Date().getFullYear(); - else if (year < 100) - year += new Date().getFullYear() - new Date().getFullYear() % 100 + - (year <= shortYearCutoff ? 0 : -100); - if (doy > -1) { - month = 1; - day = doy; - do { - var dim = this._getDaysInMonth(year, month - 1); - if (day <= dim) - break; - month++; - day -= dim; - } while (true); - } - var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); - if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) - throw 'Invalid date'; // E.g. 31/02/* - return date; - }, - - /* Standard date formats. */ - ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601) - COOKIE: 'D, dd M yy', - ISO_8601: 'yy-mm-dd', - RFC_822: 'D, d M y', - RFC_850: 'DD, dd-M-y', - RFC_1036: 'D, d M y', - RFC_1123: 'D, d M yy', - RFC_2822: 'D, d M yy', - RSS: 'D, d M y', // RFC 822 - TICKS: '!', - TIMESTAMP: '@', - W3C: 'yy-mm-dd', // ISO 8601 - - _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + - Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), - - /* Format a date object into a string value. - The format can be combinations of the following: - d - day of month (no leading zero) - dd - day of month (two digit) - o - day of year (no leading zeros) - oo - day of year (three digit) - D - day name short - DD - day name long - m - month of year (no leading zero) - mm - month of year (two digit) - M - month name short - MM - month name long - y - year (two digit) - yy - year (four digit) - @ - Unix timestamp (ms since 01/01/1970) - ! - Windows ticks (100ns since 01/01/0001) - '...' - literal text - '' - single quote - - @param format string - the desired format of the date - @param date Date - the date value to format - @param settings Object - attributes include: - dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) - dayNames string[7] - names of the days from Sunday (optional) - monthNamesShort string[12] - abbreviated names of the months (optional) - monthNames string[12] - names of the months (optional) - @return string - the date in the above format */ - formatDate: function (format, date, settings) { - if (!date) - return ''; - var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; - var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; - var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; - var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; - // Check whether a format character is doubled - var lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); - if (matches) - iFormat++; - return matches; - }; - // Format a number, with leading zero if necessary - var formatNumber = function(match, value, len) { - var num = '' + value; - if (lookAhead(match)) - while (num.length < len) - num = '0' + num; - return num; - }; - // Format a name, short or long as requested - var formatName = function(match, value, shortNames, longNames) { - return (lookAhead(match) ? longNames[value] : shortNames[value]); - }; - var output = ''; - var literal = false; - if (date) - for (var iFormat = 0; iFormat < format.length; iFormat++) { - if (literal) - if (format.charAt(iFormat) == "'" && !lookAhead("'")) - literal = false; - else - output += format.charAt(iFormat); - else - switch (format.charAt(iFormat)) { - case 'd': - output += formatNumber('d', date.getDate(), 2); - break; - case 'D': - output += formatName('D', date.getDay(), dayNamesShort, dayNames); - break; - case 'o': - output += formatNumber('o', - (date.getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000, 3); - break; - case 'm': - output += formatNumber('m', date.getMonth() + 1, 2); - break; - case 'M': - output += formatName('M', date.getMonth(), monthNamesShort, monthNames); - break; - case 'y': - output += (lookAhead('y') ? date.getFullYear() : - (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100); - break; - case '@': - output += date.getTime(); - break; - case '!': - output += date.getTime() * 10000 + this._ticksTo1970; - break; - case "'": - if (lookAhead("'")) - output += "'"; - else - literal = true; - break; - default: - output += format.charAt(iFormat); - } - } - return output; - }, - - /* Extract all possible characters from the date format. */ - _possibleChars: function (format) { - var chars = ''; - var literal = false; - // Check whether a format character is doubled - var lookAhead = function(match) { - var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); - if (matches) - iFormat++; - return matches; - }; - for (var iFormat = 0; iFormat < format.length; iFormat++) - if (literal) - if (format.charAt(iFormat) == "'" && !lookAhead("'")) - literal = false; - else - chars += format.charAt(iFormat); - else - switch (format.charAt(iFormat)) { - case 'd': case 'm': case 'y': case '@': - chars += '0123456789'; - break; - case 'D': case 'M': - return null; // Accept anything - case "'": - if (lookAhead("'")) - chars += "'"; - else - literal = true; - break; - default: - chars += format.charAt(iFormat); - } - return chars; - }, - - /* Get a setting value, defaulting if necessary. */ - _get: function(inst, name) { - return inst.settings[name] !== undefined ? - inst.settings[name] : this._defaults[name]; - }, - - /* Parse existing date and initialise date picker. */ - _setDateFromField: function(inst, noDefault) { - var dateFormat = this._get(inst, 'dateFormat'); - inst.lastVal = inst.input ? inst.input.val() : null; - var dates = inst.lastVal; - var date, defaultDate; - date = defaultDate = this._getDefaultDate(inst); - var settings = this._getFormatConfig(inst); - try { - date = this.parseDate(dateFormat, dates, settings) || defaultDate; - } catch (event) { - this.log(event); - dates = (noDefault ? '' : dates); - } - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - inst.currentDay = (dates ? date.getDate() : 0); - inst.currentMonth = (dates ? date.getMonth() : 0); - inst.currentYear = (dates ? date.getFullYear() : 0); - this._adjustInstDate(inst); - }, - - /* Retrieve the default date shown on opening. */ - _getDefaultDate: function(inst) { - return this._restrictMinMax(inst, - this._determineDate(inst, this._get(inst, 'defaultDate'), new Date())); - }, - - /* A date may be specified as an exact value or a relative one. */ - _determineDate: function(inst, date, defaultDate) { - var offsetNumeric = function(offset) { - var date = new Date(); - date.setDate(date.getDate() + offset); - return date; - }; - var offsetString = function(offset) { - try { - return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), - offset, $.datepicker._getFormatConfig(inst)); - } - catch (e) { - // Ignore - } - var date = (offset.toLowerCase().match(/^c/) ? - $.datepicker._getDate(inst) : null) || new Date(); - var year = date.getFullYear(); - var month = date.getMonth(); - var day = date.getDate(); - var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; - var matches = pattern.exec(offset); - while (matches) { - switch (matches[2] || 'd') { - case 'd' : case 'D' : - day += parseInt(matches[1],10); break; - case 'w' : case 'W' : - day += parseInt(matches[1],10) * 7; break; - case 'm' : case 'M' : - month += parseInt(matches[1],10); - day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); - break; - case 'y': case 'Y' : - year += parseInt(matches[1],10); - day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); - break; - } - matches = pattern.exec(offset); - } - return new Date(year, month, day); - }; - date = (date == null ? defaultDate : (typeof date == 'string' ? offsetString(date) : - (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date))); - date = (date && date.toString() == 'Invalid Date' ? defaultDate : date); - if (date) { - date.setHours(0); - date.setMinutes(0); - date.setSeconds(0); - date.setMilliseconds(0); - } - return this._daylightSavingAdjust(date); - }, - - /* Handle switch to/from daylight saving. - Hours may be non-zero on daylight saving cut-over: - > 12 when midnight changeover, but then cannot generate - midnight datetime, so jump to 1AM, otherwise reset. - @param date (Date) the date to check - @return (Date) the corrected date */ - _daylightSavingAdjust: function(date) { - if (!date) return null; - date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); - return date; - }, - - /* Set the date(s) directly. */ - _setDate: function(inst, date, noChange) { - var clear = !(date); - var origMonth = inst.selectedMonth; - var origYear = inst.selectedYear; - date = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); - inst.selectedDay = inst.currentDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear(); - if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange) - this._notifyChange(inst); - this._adjustInstDate(inst); - if (inst.input) { - inst.input.val(clear ? '' : this._formatDate(inst)); - } - }, - - /* Retrieve the date(s) directly. */ - _getDate: function(inst) { - var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : - this._daylightSavingAdjust(new Date( - inst.currentYear, inst.currentMonth, inst.currentDay))); - return startDate; - }, - - /* Generate the HTML for the current state of the date picker. */ - _generateHTML: function(inst) { - var today = new Date(); - today = this._daylightSavingAdjust( - new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time - var isRTL = this._get(inst, 'isRTL'); - var showButtonPanel = this._get(inst, 'showButtonPanel'); - var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'); - var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat'); - var numMonths = this._getNumberOfMonths(inst); - var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); - var stepMonths = this._get(inst, 'stepMonths'); - var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); - var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : - new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); - var minDate = this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - var drawMonth = inst.drawMonth - showCurrentAtPos; - var drawYear = inst.drawYear; - if (drawMonth < 0) { - drawMonth += 12; - drawYear--; - } - if (maxDate) { - var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), - maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); - maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); - while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { - drawMonth--; - if (drawMonth < 0) { - drawMonth = 11; - drawYear--; - } - } - } - inst.drawMonth = drawMonth; - inst.drawYear = drawYear; - var prevText = this._get(inst, 'prevText'); - prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, - this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), - this._getFormatConfig(inst))); - var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? - '
    ' + prevText + '' : - (hideIfNoPrevNext ? '' : '' + prevText + '')); - var nextText = this._get(inst, 'nextText'); - nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, - this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), - this._getFormatConfig(inst))); - var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? - '' + nextText + '' : - (hideIfNoPrevNext ? '' : '' + nextText + '')); - var currentText = this._get(inst, 'currentText'); - var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); - currentText = (!navigationAsDateFormat ? currentText : - this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); - var controls = (!inst.inline ? '' : ''); - var buttonPanel = (showButtonPanel) ? '
    ' + (isRTL ? controls : '') + - (this._isInRange(inst, gotoDate) ? '' : '') + (isRTL ? '' : controls) + '
    ' : ''; - var firstDay = parseInt(this._get(inst, 'firstDay'),10); - firstDay = (isNaN(firstDay) ? 0 : firstDay); - var showWeek = this._get(inst, 'showWeek'); - var dayNames = this._get(inst, 'dayNames'); - var dayNamesShort = this._get(inst, 'dayNamesShort'); - var dayNamesMin = this._get(inst, 'dayNamesMin'); - var monthNames = this._get(inst, 'monthNames'); - var monthNamesShort = this._get(inst, 'monthNamesShort'); - var beforeShowDay = this._get(inst, 'beforeShowDay'); - var showOtherMonths = this._get(inst, 'showOtherMonths'); - var selectOtherMonths = this._get(inst, 'selectOtherMonths'); - var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week; - var defaultDate = this._getDefaultDate(inst); - var html = ''; - for (var row = 0; row < numMonths[0]; row++) { - var group = ''; - for (var col = 0; col < numMonths[1]; col++) { - var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); - var cornerClass = ' ui-corner-all'; - var calender = ''; - if (isMultiMonth) { - calender += '
    '; - } - calender += '
    ' + - (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + - (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + - this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, - row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers - '
    ' + - ''; - var thead = (showWeek ? '' : ''); - for (var dow = 0; dow < 7; dow++) { // days of the week - var day = (dow + firstDay) % 7; - thead += '= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + - '' + dayNamesMin[day] + ''; - } - calender += thead + ''; - var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); - if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) - inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); - var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; - var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate - var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); - for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows - calender += ''; - var tbody = (!showWeek ? '' : ''); - for (var dow = 0; dow < 7; dow++) { // create date picker days - var daySettings = (beforeShowDay ? - beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); - var otherMonth = (printDate.getMonth() != drawMonth); - var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || - (minDate && printDate < minDate) || (maxDate && printDate > maxDate); - tbody += ''; // display selectable date - printDate.setDate(printDate.getDate() + 1); - printDate = this._daylightSavingAdjust(printDate); - } - calender += tbody + ''; - } - drawMonth++; - if (drawMonth > 11) { - drawMonth = 0; - drawYear++; - } - calender += '
    ' + this._get(inst, 'weekHeader') + '
    ' + - this._get(inst, 'calculateWeek')(printDate) + '' + // actions - (otherMonth && !showOtherMonths ? ' ' : // display for other months - (unselectable ? '' + printDate.getDate() + '' : '' + printDate.getDate() + '')) + '
    ' + (isMultiMonth ? '
    ' + - ((numMonths[0] > 0 && col == numMonths[1]-1) ? '
    ' : '') : ''); - group += calender; - } - html += group; - } - html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ? - '' : ''); - inst._keyEvent = false; - return html; - }, - - /* Generate the month and year header. */ - _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, - secondary, monthNames, monthNamesShort) { - var changeMonth = this._get(inst, 'changeMonth'); - var changeYear = this._get(inst, 'changeYear'); - var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); - var html = '
    '; - var monthHtml = ''; - // month selection - if (secondary || !changeMonth) - monthHtml += '' + monthNames[drawMonth] + ' '; - else { - var inMinYear = (minDate && minDate.getFullYear() == drawYear); - var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); - monthHtml += ''; - } - if (!showMonthAfterYear) - html += monthHtml + ((secondary || changeMonth || changeYear) && (!(changeMonth && changeYear)) ? ' ' : ''); - // year selection - if (secondary || !changeYear) - html += '' + drawYear + ''; - else { - // determine range of years to display - var years = this._get(inst, 'yearRange').split(':'); - var thisYear = new Date().getFullYear(); - var determineYear = function(value) { - var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : - (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : - parseInt(value, 10))); - return (isNaN(year) ? thisYear : year); - }; - var year = determineYear(years[0]); - var endYear = Math.max(year, determineYear(years[1] || '')); - year = (minDate ? Math.max(year, minDate.getFullYear()) : year); - endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); - html += ''; - } - html += this._get(inst, 'yearSuffix'); - if (showMonthAfterYear) - html += ((secondary || changeMonth || changeYear) && (!(changeMonth && changeYear)) ? ' ' : '') + monthHtml; - html += '
    '; // Close datepicker_header - return html; - }, - - /* Adjust one of the date sub-fields. */ - _adjustInstDate: function(inst, offset, period) { - var year = inst.drawYear + (period == 'Y' ? offset : 0); - var month = inst.drawMonth + (period == 'M' ? offset : 0); - var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + - (period == 'D' ? offset : 0); - var date = this._restrictMinMax(inst, - this._daylightSavingAdjust(new Date(year, month, day))); - inst.selectedDay = date.getDate(); - inst.drawMonth = inst.selectedMonth = date.getMonth(); - inst.drawYear = inst.selectedYear = date.getFullYear(); - if (period == 'M' || period == 'Y') - this._notifyChange(inst); - }, - - /* Ensure a date is within any min/max bounds. */ - _restrictMinMax: function(inst, date) { - var minDate = this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - date = (minDate && date < minDate ? minDate : date); - date = (maxDate && date > maxDate ? maxDate : date); - return date; - }, - - /* Notify change of month/year. */ - _notifyChange: function(inst) { - var onChange = this._get(inst, 'onChangeMonthYear'); - if (onChange) - onChange.apply((inst.input ? inst.input[0] : null), - [inst.selectedYear, inst.selectedMonth + 1, inst]); - }, - - /* Determine the number of months to show. */ - _getNumberOfMonths: function(inst) { - var numMonths = this._get(inst, 'numberOfMonths'); - return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); - }, - - /* Determine the current maximum date - ensure no time components are set. */ - _getMinMaxDate: function(inst, minMax) { - return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); - }, - - /* Find the number of days in a given month. */ - _getDaysInMonth: function(year, month) { - return 32 - new Date(year, month, 32).getDate(); - }, - - /* Find the day of the week of the first of a month. */ - _getFirstDayOfMonth: function(year, month) { - return new Date(year, month, 1).getDay(); - }, - - /* Determines if we should allow a "next/prev" month display change. */ - _canAdjustMonth: function(inst, offset, curYear, curMonth) { - var numMonths = this._getNumberOfMonths(inst); - var date = this._daylightSavingAdjust(new Date(curYear, - curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); - if (offset < 0) - date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); - return this._isInRange(inst, date); - }, - - /* Is the given date in the accepted range? */ - _isInRange: function(inst, date) { - var minDate = this._getMinMaxDate(inst, 'min'); - var maxDate = this._getMinMaxDate(inst, 'max'); - return ((!minDate || date.getTime() >= minDate.getTime()) && - (!maxDate || date.getTime() <= maxDate.getTime())); - }, - - /* Provide the configuration settings for formatting/parsing. */ - _getFormatConfig: function(inst) { - var shortYearCutoff = this._get(inst, 'shortYearCutoff'); - shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : - new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); - return {shortYearCutoff: shortYearCutoff, - dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), - monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; - }, - - /* Format the given date for display. */ - _formatDate: function(inst, day, month, year) { - if (!day) { - inst.currentDay = inst.selectedDay; - inst.currentMonth = inst.selectedMonth; - inst.currentYear = inst.selectedYear; - } - var date = (day ? (typeof day == 'object' ? day : - this._daylightSavingAdjust(new Date(year, month, day))) : - this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); - return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); - } -}); - -/* jQuery extend now ignores nulls! */ -function extendRemove(target, props) { - $.extend(target, props); - for (var name in props) - if (props[name] == null || props[name] == undefined) - target[name] = props[name]; - return target; -}; - -/* Determine whether an object is an array. */ -function isArray(a) { - return (a && (($.browser.safari && typeof a == 'object' && a.length) || - (a.constructor && a.constructor.toString().match(/\Array\(\)/)))); -}; - -/* Invoke the datepicker functionality. - @param options string - a command, optionally followed by additional parameters or - Object - settings for attaching new datepicker functionality - @return jQuery object */ -$.fn.datepicker = function(options){ - - /* Initialise the date picker. */ - if (!$.datepicker.initialized) { - $(document).mousedown($.datepicker._checkExternalClick). - find('body').append($.datepicker.dpDiv); - $.datepicker.initialized = true; - } - - var otherArgs = Array.prototype.slice.call(arguments, 1); - if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) - return $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this[0]].concat(otherArgs)); - if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') - return $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this[0]].concat(otherArgs)); - return this.each(function() { - typeof options == 'string' ? - $.datepicker['_' + options + 'Datepicker']. - apply($.datepicker, [this].concat(otherArgs)) : - $.datepicker._attachDatepicker(this, options); - }); -}; - -$.datepicker = new Datepicker(); // singleton instance -$.datepicker.initialized = false; -$.datepicker.uuid = new Date().getTime(); -$.datepicker.version = "1.8b1"; - -// Workaround for #4055 -// Add another global to avoid noConflict issues with inline event handlers -window['DP_jQuery_' + dpuuid] = $; - -})(jQuery); diff --git a/lib/jquery.ui/jquery.ui.widget.js b/lib/jquery.ui/jquery.ui.widget.js deleted file mode 100644 index 9b616bcf730..00000000000 --- a/lib/jquery.ui/jquery.ui.widget.js +++ /dev/null @@ -1,232 +0,0 @@ -/*! - * jQuery UI Widget 1.8b1 - * - * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Widget - */ -(function( $ ) { - -var _remove = $.fn.remove; - -$.fn.remove = function( selector, keepData ) { - if ( !keepData ) { - $( "*", this ).add( this ).each(function() { - $( this ).triggerHandler( "remove" ); - }); - } - return _remove.apply( this, arguments ); -}; - -$.widget = function( name, base, prototype ) { - var namespace = name.split( "." )[ 0 ], - fullName; - name = name.split( "." )[ 1 ]; - fullName = namespace + "-" + name; - - if ( !prototype ) { - prototype = base; - base = $.Widget; - } - - // create selector for plugin - $.expr[ ":" ][ fullName ] = function( elem ) { - return !!$.data( elem, name ); - }; - - $[ namespace ] = $[ namespace ] || {}; - $[ namespace ][ name ] = function( options, element ) { - // allow instantiation without initializing for simple inheritance - if ( arguments.length ) { - this._createWidget( options, element ); - } - }; - - var basePrototype = new base(); - // we need to make the options hash a property directly on the new instance - // otherwise we'll modify the options hash on the prototype that we're - // inheriting from -// $.each( basePrototype, function( key, val ) { -// if ( $.isPlainObject(val) ) { -// basePrototype[ key ] = $.extend( {}, val ); -// } -// }); - basePrototype.options = $.extend( {}, basePrototype.options ); - $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { - namespace: namespace, - widgetName: name, - widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, - widgetBaseClass: fullName - }, prototype ); - - $.widget.bridge( name, $[ namespace ][ name ] ); -}; - -$.widget.bridge = function( name, object ) { - $.fn[ name ] = function( options ) { - var isMethodCall = typeof options === "string", - args = Array.prototype.slice.call( arguments, 1 ), - returnValue = this; - - // allow multiple hashes to be passed on init - options = !isMethodCall && args.length ? - $.extend.apply( null, [ true, options ].concat(args) ) : - options; - - // prevent calls to internal methods - if ( isMethodCall && options.substring( 0, 1 ) === "_" ) { - return returnValue; - } - - if ( isMethodCall ) { - this.each(function() { - var instance = $.data( this, name ), - methodValue = instance && $.isFunction( instance[options] ) ? - instance[ options ].apply( instance, args ) : - instance; - if ( methodValue !== instance && methodValue !== undefined ) { - returnValue = methodValue; - return false; - } - }); - } else { - this.each(function() { - var instance = $.data( this, name ); - if ( instance ) { - if ( options ) { - instance.option( options ); - } - instance._init(); - } else { - $.data( this, name, new object( options, this ) ); - } - }); - } - - return returnValue; - }; -}; - -$.Widget = function( options, element ) { - // allow instantiation without initializing for simple inheritance - if ( arguments.length ) { - this._createWidget( options, element ); - } -}; - -$.Widget.prototype = { - widgetName: "widget", - widgetEventPrefix: "", - options: { - disabled: false - }, - _createWidget: function( options, element ) { - // $.widget.bridge stores the plugin instance, but we do it anyway - // so that it's stored even before the _create function runs - this.element = $( element ).data( this.widgetName, this ); - this.options = $.extend( true, {}, - this.options, - $.metadata && $.metadata.get( element )[ this.widgetName ], - options ); - - var self = this; - this.element.bind( "remove." + this.widgetName, function() { - self.destroy(); - }); - - this._create(); - this._init(); - }, - _create: function() {}, - _init: function() {}, - - destroy: function() { - this.element - .unbind( "." + this.widgetName ) - .removeData( this.widgetName ); - this.widget() - .unbind( "." + this.widgetName ) - .removeAttr( "aria-disabled" ) - .removeClass( - this.widgetBaseClass + "-disabled " + - this.namespace + "-state-disabled" ); - }, - - widget: function() { - return this.element; - }, - - option: function( key, value ) { - var options = key, - self = this; - - if ( arguments.length === 0 ) { - // don't return a reference to the internal hash - return $.extend( {}, self.options ); - } - - if (typeof key === "string" ) { - if ( value === undefined ) { - return this.options[ key ]; - } - options = {}; - options[ key ] = value; - } - - $.each( options, function( key, value ) { - self._setOption( key, value ); - }); - - return self; - }, - _setOption: function( key, value ) { - this.options[ key ] = value; - - if ( key === "disabled" ) { - this.widget() - [ value ? "addClass" : "removeClass"]( - this.widgetBaseClass + "-disabled" + " " + - this.namespace + "-state-disabled" ) - .attr( "aria-disabled", value ); - } - - return this; - }, - - enable: function() { - return this._setOption( "disabled", false ); - }, - disable: function() { - return this._setOption( "disabled", true ); - }, - - _trigger: function( type, event, data ) { - var callback = this.options[ type ]; - - event = $.Event( event ); - event.type = ( type === this.widgetEventPrefix ? - type : - this.widgetEventPrefix + type ).toLowerCase(); - data = data || {}; - - // copy original event properties over to the new event - // this would happen if we could call $.event.fix instead of $.Event - // but we don't have a way to force an event to be fixed multiple times - if ( event.originalEvent ) { - for ( var i = $.event.props.length, prop; i; ) { - prop = $.event.props[ --i ]; - event[ prop ] = event.originalEvent[ prop ]; - } - } - - this.element.trigger( event, data ); - - return !( $.isFunction(callback) && - callback.call( this.element[0], event, data ) === false || - event.isDefaultPrevented() ); - } -}; - -})( jQuery ); diff --git a/lib/jquery.ui/ui.datepicker.css b/lib/jquery.ui/ui.datepicker.css deleted file mode 100644 index a1116e69c74..00000000000 --- a/lib/jquery.ui/ui.datepicker.css +++ /dev/null @@ -1,61 +0,0 @@ -/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -} \ No newline at end of file diff --git a/lib/jquery/jquery-1.4.1.js b/lib/jquery/jquery-1.4.1.js deleted file mode 100644 index 109701084e4..00000000000 --- a/lib/jquery/jquery-1.4.1.js +++ /dev/null @@ -1,6078 +0,0 @@ -/*! - * jQuery JavaScript Library v1.4.1 - * http://jquery.com/ - * - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2010, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Mon Jan 25 19:43:33 2010 -0500 - */ -(function( window, undefined ) { - -// Define a local copy of jQuery -var jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context ); - }, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - - // A central reference to the root jQuery(document) - rootjQuery, - - // A simple way to check for HTML strings or ID strings - // (both of which we optimize for) - quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/, - - // Is it a simple selector - isSimple = /^.[^:#\[\.,]*$/, - - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, - - // Used for trimming whitespace - rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, - - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // For matching the engine and version of the browser - browserMatch, - - // Has the ready events already been bound? - readyBound = false, - - // The functions to execute on DOM ready - readyList = [], - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwnProperty = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - indexOf = Array.prototype.indexOf; - -jQuery.fn = jQuery.prototype = { - init: function( selector, context ) { - var match, elem, ret, doc; - - // Handle $(""), $(null), or $(undefined) - if ( !selector ) { - return this; - } - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? - match = quickExpr.exec( selector ); - - // Verify a match, and that no context was specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - doc = (context ? context.ownerDocument || context : document); - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec( selector ); - - if ( ret ) { - if ( jQuery.isPlainObject( context ) ) { - selector = [ document.createElement( ret[1] ) ]; - jQuery.fn.attr.call( selector, context, true ); - - } else { - selector = [ doc.createElement( ret[1] ) ]; - } - - } else { - ret = buildFragment( [ match[1] ], [ doc ] ); - selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; - } - - // HANDLE: $("#id") - } else { - elem = document.getElementById( match[2] ); - - if ( elem ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $("TAG") - } else if ( !context && /^\w+$/.test( selector ) ) { - this.selector = selector; - this.context = document; - selector = document.getElementsByTagName( selector ); - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return (context || rootjQuery).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return jQuery( context ).find( selector ); - } - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if (selector.selector !== undefined) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.isArray( selector ) ? - this.setArray( selector ) : - jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.4.1", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - toArray: function() { - return slice.call( this, 0 ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - // Build a new jQuery matched element set - var ret = jQuery( elems || null ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) { - ret.selector = this.selector + (this.selector ? " " : "") + selector; - } else if ( name ) { - ret.selector = this.selector + "." + name + "(" + selector + ")"; - } - - // Return the newly-formed element set - return ret; - }, - - // Force the current matched set of elements to become - // the specified array of elements (destroying the stack in the process) - // You should use pushStack() in order to do this, but maintain the stack - setArray: function( elems ) { - // Resetting the length to 0, then using the native Array push - // is a super-fast way to populate an object with array-like properties - this.length = 0; - push.apply( this, elems ); - - return this; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Attach the listeners - jQuery.bindReady(); - - // If the DOM is already ready - if ( jQuery.isReady ) { - // Execute the function immediately - fn.call( document, jQuery ); - - // Otherwise, remember the function for later - } else if ( readyList ) { - // Add the function to the wait list - readyList.push( fn ); - } - - return this; - }, - - eq: function( i ) { - return i === -1 ? - this.slice( i ) : - this.slice( i, +i + 1 ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ), - "slice", slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || jQuery(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - // copy reference to target object - var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging object literal values or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) { - var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src - : jQuery.isArray(copy) ? [] : {}; - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - window.$ = _$; - - if ( deep ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // Handle when the DOM is ready - ready: function() { - // Make sure that the DOM is not already loaded - if ( !jQuery.isReady ) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 13 ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If there are functions bound, to execute - if ( readyList ) { - // Execute all of them - var fn, i = 0; - while ( (fn = readyList[ i++ ]) ) { - fn.call( document, jQuery ); - } - - // Reset the list of functions - readyList = null; - } - - // Trigger any bound ready events - if ( jQuery.fn.triggerHandler ) { - jQuery( document ).triggerHandler( "ready" ); - } - } - }, - - bindReady: function() { - if ( readyBound ) { - return; - } - - readyBound = true; - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if ( document.readyState === "complete" ) { - return jQuery.ready(); - } - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent("onreadystatechange", DOMContentLoaded); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch(e) {} - - if ( document.documentElement.doScroll && toplevel ) { - doScrollCheck(); - } - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return toString.call(obj) === "[object Function]"; - }, - - isArray: function( obj ) { - return toString.call(obj) === "[object Array]"; - }, - - isPlainObject: function( obj ) { - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) { - return false; - } - - // Not own constructor property must be Object - if ( obj.constructor - && !hasOwnProperty.call(obj, "constructor") - && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || hasOwnProperty.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - for ( var name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw msg; - }, - - parseJSON: function( data ) { - if ( typeof data !== "string" || !data ) { - return null; - } - - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@") - .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]") - .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) { - - // Try to use the native JSON parser first - return window.JSON && window.JSON.parse ? - window.JSON.parse( data ) : - (new Function("return " + data))(); - - } else { - jQuery.error( "Invalid JSON: " + data ); - } - }, - - noop: function() {}, - - // Evalulates a script in a global context - globalEval: function( data ) { - if ( data && rnotwhite.test(data) ) { - // Inspired by code by Andrea Giammarchi - // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html - var head = document.getElementsByTagName("head")[0] || document.documentElement, - script = document.createElement("script"); - - script.type = "text/javascript"; - - if ( jQuery.support.scriptEval ) { - script.appendChild( document.createTextNode( data ) ); - } else { - script.text = data; - } - - // Use insertBefore instead of appendChild to circumvent an IE6 bug. - // This arises when a base node is used (#2709). - head.insertBefore( script, head.firstChild ); - head.removeChild( script ); - } - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction(object); - - if ( args ) { - if ( isObj ) { - for ( name in object ) { - if ( callback.apply( object[ name ], args ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.apply( object[ i++ ], args ) === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isObj ) { - for ( name in object ) { - if ( callback.call( object[ name ], name, object[ name ] ) === false ) { - break; - } - } - } else { - for ( var value = object[0]; - i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} - } - } - - return object; - }, - - trim: function( text ) { - return (text || "").replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( array, results ) { - var ret = results || []; - - if ( array != null ) { - // The window, strings (and functions) also have 'length' - // The extra typeof function check is to prevent crashes - // in Safari 2 (See: #3039) - if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) { - push.call( ret, array ); - } else { - jQuery.merge( ret, array ); - } - } - - return ret; - }, - - inArray: function( elem, array ) { - if ( array.indexOf ) { - return array.indexOf( elem ); - } - - for ( var i = 0, length = array.length; i < length; i++ ) { - if ( array[ i ] === elem ) { - return i; - } - } - - return -1; - }, - - merge: function( first, second ) { - var i = first.length, j = 0; - - if ( typeof second.length === "number" ) { - for ( var l = second.length; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var ret = []; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) { - if ( !inv !== !callback( elems[ i ], i ) ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var ret = [], value; - - // Go through the array, translating each of the items to their - // new value (or values). - for ( var i = 0, length = elems.length; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - return ret.concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - proxy: function( fn, proxy, thisObject ) { - if ( arguments.length === 2 ) { - if ( typeof proxy === "string" ) { - thisObject = fn; - fn = thisObject[ proxy ]; - proxy = undefined; - - } else if ( proxy && !jQuery.isFunction( proxy ) ) { - thisObject = proxy; - proxy = undefined; - } - } - - if ( !proxy && fn ) { - proxy = function() { - return fn.apply( thisObject || this, arguments ); - }; - } - - // Set the guid of unique handler to the same of original handler, so it can be removed - if ( fn ) { - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; - } - - // So proxy can be declared as an argument - return proxy; - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function( ua ) { - ua = ua.toLowerCase(); - - var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) || - /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) || - /(msie) ([\w.]+)/.exec( ua ) || - !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) || - []; - - return { browser: match[1] || "", version: match[2] || "0" }; - }, - - browser: {} -}); - -browserMatch = jQuery.uaMatch( userAgent ); -if ( browserMatch.browser ) { - jQuery.browser[ browserMatch.browser ] = true; - jQuery.browser.version = browserMatch.version; -} - -// Deprecated, use jQuery.browser.webkit instead -if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; -} - -if ( indexOf ) { - jQuery.inArray = function( elem, array ) { - return indexOf.call( array, elem ); - }; -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); - -// Cleanup functions for the document ready method -if ( document.addEventListener ) { - DOMContentLoaded = function() { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - }; - -} else if ( document.attachEvent ) { - DOMContentLoaded = function() { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }; -} - -// The DOM ready check for Internet Explorer -function doScrollCheck() { - if ( jQuery.isReady ) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch( error ) { - setTimeout( doScrollCheck, 1 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); -} - -function evalScript( i, elem ) { - if ( elem.src ) { - jQuery.ajax({ - url: elem.src, - async: false, - dataType: "script" - }); - } else { - jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); - } - - if ( elem.parentNode ) { - elem.parentNode.removeChild( elem ); - } -} - -// Mutifunctional method to get and set values to a collection -// The value/s can be optionally by executed if its a function -function access( elems, key, value, exec, fn, pass ) { - var length = elems.length; - - // Setting many attributes - if ( typeof key === "object" ) { - for ( var k in key ) { - access( elems, k, key[k], exec, fn, value ); - } - return elems; - } - - // Setting one attribute - if ( value !== undefined ) { - // Optionally, function values get executed if exec is true - exec = !pass && exec && jQuery.isFunction(value); - - for ( var i = 0; i < length; i++ ) { - fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); - } - - return elems; - } - - // Getting an attribute - return length ? fn( elems[0], key ) : null; -} - -function now() { - return (new Date).getTime(); -} -(function() { - - jQuery.support = {}; - - var root = document.documentElement, - script = document.createElement("script"), - div = document.createElement("div"), - id = "script" + now(); - - div.style.display = "none"; - div.innerHTML = "
    a"; - - var all = div.getElementsByTagName("*"), - a = div.getElementsByTagName("a")[0]; - - // Can't get basic test support - if ( !all || !all.length || !a ) { - return; - } - - jQuery.support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: div.firstChild.nodeType === 3, - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName("tbody").length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName("link").length, - - // Get the style information from getAttribute - // (IE uses .cssText insted) - style: /red/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: a.getAttribute("href") === "/a", - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.55$/.test( a.style.opacity ), - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Make sure that if no value is specified for a checkbox - // that it defaults to "on". - // (WebKit defaults to "" instead) - checkOn: div.getElementsByTagName("input")[0].value === "on", - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected, - - // Will be defined later - checkClone: false, - scriptEval: false, - noCloneEvent: true, - boxModel: null - }; - - script.type = "text/javascript"; - try { - script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); - } catch(e) {} - - root.insertBefore( script, root.firstChild ); - - // Make sure that the execution of code works by injecting a script - // tag with appendChild/createTextNode - // (IE doesn't support this, fails, and uses .text instead) - if ( window[ id ] ) { - jQuery.support.scriptEval = true; - delete window[ id ]; - } - - root.removeChild( script ); - - if ( div.attachEvent && div.fireEvent ) { - div.attachEvent("onclick", function click() { - // Cloning a node shouldn't copy over any - // bound event handlers (IE does this) - jQuery.support.noCloneEvent = false; - div.detachEvent("onclick", click); - }); - div.cloneNode(true).fireEvent("onclick"); - } - - div = document.createElement("div"); - div.innerHTML = ""; - - var fragment = document.createDocumentFragment(); - fragment.appendChild( div.firstChild ); - - // WebKit doesn't clone checked state correctly in fragments - jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; - - // Figure out if the W3C box model works as expected - // document.body must exist before we can do this - jQuery(function() { - var div = document.createElement("div"); - div.style.width = div.style.paddingLeft = "1px"; - - document.body.appendChild( div ); - jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; - document.body.removeChild( div ).style.display = 'none'; - div = null; - }); - - // Technique from Juriy Zaytsev - // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ - var eventSupported = function( eventName ) { - var el = document.createElement("div"); - eventName = "on" + eventName; - - var isSupported = (eventName in el); - if ( !isSupported ) { - el.setAttribute(eventName, "return;"); - isSupported = typeof el[eventName] === "function"; - } - el = null; - - return isSupported; - }; - - jQuery.support.submitBubbles = eventSupported("submit"); - jQuery.support.changeBubbles = eventSupported("change"); - - // release memory in IE - root = script = div = all = a = null; -})(); - -jQuery.props = { - "for": "htmlFor", - "class": "className", - readonly: "readOnly", - maxlength: "maxLength", - cellspacing: "cellSpacing", - rowspan: "rowSpan", - colspan: "colSpan", - tabindex: "tabIndex", - usemap: "useMap", - frameborder: "frameBorder" -}; -var expando = "jQuery" + now(), uuid = 0, windowData = {}; -var emptyObject = {}; - -jQuery.extend({ - cache: {}, - - expando:expando, - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - "object": true, - "applet": true - }, - - data: function( elem, name, data ) { - if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { - return; - } - - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ], cache = jQuery.cache, thisCache; - - // Handle the case where there's no name immediately - if ( !name && !id ) { - return null; - } - - // Compute a unique ID for the element - if ( !id ) { - id = ++uuid; - } - - // Avoid generating a new cache unless none exists and we - // want to manipulate it. - if ( typeof name === "object" ) { - elem[ expando ] = id; - thisCache = cache[ id ] = jQuery.extend(true, {}, name); - } else if ( cache[ id ] ) { - thisCache = cache[ id ]; - } else if ( typeof data === "undefined" ) { - thisCache = emptyObject; - } else { - thisCache = cache[ id ] = {}; - } - - // Prevent overriding the named cache with undefined values - if ( data !== undefined ) { - elem[ expando ] = id; - thisCache[ name ] = data; - } - - return typeof name === "string" ? thisCache[ name ] : thisCache; - }, - - removeData: function( elem, name ) { - if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { - return; - } - - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ]; - - // If we want to remove a specific section of the element's data - if ( name ) { - if ( thisCache ) { - // Remove the section of cache data - delete thisCache[ name ]; - - // If we've removed all the data, remove the element's cache - if ( jQuery.isEmptyObject(thisCache) ) { - jQuery.removeData( elem ); - } - } - - // Otherwise, we want to remove all of the element's data - } else { - // Clean up the element expando - try { - delete elem[ expando ]; - } catch( e ) { - // IE has trouble directly removing the expando - // but it's ok with using removeAttribute - if ( elem.removeAttribute ) { - elem.removeAttribute( expando ); - } - } - - // Completely remove the data cache - delete cache[ id ]; - } - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - if ( typeof key === "undefined" && this.length ) { - return jQuery.data( this[0] ); - - } else if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - var parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - if ( data === undefined && this.length ) { - data = jQuery.data( this[0], key ); - } - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - } else { - return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() { - jQuery.data( this, key, value ); - }); - } - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); -jQuery.extend({ - queue: function( elem, type, data ) { - if ( !elem ) { - return; - } - - type = (type || "fx") + "queue"; - var q = jQuery.data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( !data ) { - return q || []; - } - - if ( !q || jQuery.isArray(data) ) { - q = jQuery.data( elem, type, jQuery.makeArray(data) ); - - } else { - q.push( data ); - } - - return q; - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), fn = queue.shift(); - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - } - - if ( fn ) { - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift("inprogress"); - } - - fn.call(elem, function() { - jQuery.dequeue(elem, type); - }); - } - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - } - - if ( data === undefined ) { - return jQuery.queue( this[0], type ); - } - return this.each(function( i, elem ) { - var queue = jQuery.queue( this, type, data ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; - type = type || "fx"; - - return this.queue( type, function() { - var elem = this; - setTimeout(function() { - jQuery.dequeue( elem, type ); - }, time ); - }); - }, - - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - } -}); -var rclass = /[\n\t]/g, - rspace = /\s+/, - rreturn = /\r/g, - rspecialurl = /href|src|style/, - rtype = /(button|input)/i, - rfocusable = /(button|input|object|select|textarea)/i, - rclickable = /^(a|area)$/i, - rradiocheck = /radio|checkbox/; - -jQuery.fn.extend({ - attr: function( name, value ) { - return access( this, name, value, true, jQuery.attr ); - }, - - removeAttr: function( name, fn ) { - return this.each(function(){ - jQuery.attr( this, name, "" ); - if ( this.nodeType === 1 ) { - this.removeAttribute( name ); - } - }); - }, - - addClass: function( value ) { - if ( jQuery.isFunction(value) ) { - return this.each(function(i) { - var self = jQuery(this); - self.addClass( value.call(this, i, self.attr("class")) ); - }); - } - - if ( value && typeof value === "string" ) { - var classNames = (value || "").split( rspace ); - - for ( var i = 0, l = this.length; i < l; i++ ) { - var elem = this[i]; - - if ( elem.nodeType === 1 ) { - if ( !elem.className ) { - elem.className = value; - - } else { - var className = " " + elem.className + " "; - for ( var c = 0, cl = classNames.length; c < cl; c++ ) { - if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { - elem.className += " " + classNames[c]; - } - } - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - if ( jQuery.isFunction(value) ) { - return this.each(function(i) { - var self = jQuery(this); - self.removeClass( value.call(this, i, self.attr("class")) ); - }); - } - - if ( (value && typeof value === "string") || value === undefined ) { - var classNames = (value || "").split(rspace); - - for ( var i = 0, l = this.length; i < l; i++ ) { - var elem = this[i]; - - if ( elem.nodeType === 1 && elem.className ) { - if ( value ) { - var className = (" " + elem.className + " ").replace(rclass, " "); - for ( var c = 0, cl = classNames.length; c < cl; c++ ) { - className = className.replace(" " + classNames[c] + " ", " "); - } - elem.className = className.substring(1, className.length - 1); - - } else { - elem.className = ""; - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function(i) { - var self = jQuery(this); - self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, i = 0, self = jQuery(this), - state = stateVal, - classNames = value.split( rspace ); - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list - state = isBool ? state : !self.hasClass( className ); - self[ state ? "addClass" : "removeClass" ]( className ); - } - - } else if ( type === "undefined" || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery.data( this, "__className__", this.className ); - } - - // toggle whole className - this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " "; - for ( var i = 0, l = this.length; i < l; i++ ) { - if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - if ( value === undefined ) { - var elem = this[0]; - - if ( elem ) { - if ( jQuery.nodeName( elem, "option" ) ) { - return (elem.attributes.value || {}).specified ? elem.value : elem.text; - } - - // We need to handle select boxes special - if ( jQuery.nodeName( elem, "select" ) ) { - var index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type === "select-one"; - - // Nothing was selected - if ( index < 0 ) { - return null; - } - - // Loop through all the selected options - for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { - var option = options[ i ]; - - if ( option.selected ) { - // Get the specifc value for the option - value = jQuery(option).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - } - - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { - return elem.getAttribute("value") === null ? "on" : elem.value; - } - - - // Everything else, we just grab the value - return (elem.value || "").replace(rreturn, ""); - - } - - return undefined; - } - - var isFunction = jQuery.isFunction(value); - - return this.each(function(i) { - var self = jQuery(this), val = value; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call(this, i, self.val()); - } - - // Typecast each time if the value is a Function and the appended - // value is therefore different each time. - if ( typeof val === "number" ) { - val += ""; - } - - if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { - this.checked = jQuery.inArray( self.val(), val ) >= 0; - - } else if ( jQuery.nodeName( this, "select" ) ) { - var values = jQuery.makeArray(val); - - jQuery( "option", this ).each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - this.selectedIndex = -1; - } - - } else { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, - - attr: function( elem, name, value, pass ) { - // don't set attributes on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { - return undefined; - } - - if ( pass && name in jQuery.attrFn ) { - return jQuery(elem)[name](value); - } - - var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), - // Whether we are setting (or getting) - set = value !== undefined; - - // Try to normalize/fix the name - name = notxml && jQuery.props[ name ] || name; - - // Only do all the following if this is a node (faster for style) - if ( elem.nodeType === 1 ) { - // These attributes require special treatment - var special = rspecialurl.test( name ); - - // Safari mis-reports the default selected property of an option - // Accessing the parent's selectedIndex property fixes it - if ( name === "selected" && !jQuery.support.optSelected ) { - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - - // If applicable, access the attribute via the DOM 0 way - if ( name in elem && notxml && !special ) { - if ( set ) { - // We can't allow the type property to be changed (since it causes problems in IE) - if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { - jQuery.error( "type property can't be changed" ); - } - - elem[ name ] = value; - } - - // browsers index elements by id/name on forms, give priority to attributes. - if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { - return elem.getAttributeNode( name ).nodeValue; - } - - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - if ( name === "tabIndex" ) { - var attributeNode = elem.getAttributeNode( "tabIndex" ); - - return attributeNode && attributeNode.specified ? - attributeNode.value : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - - return elem[ name ]; - } - - if ( !jQuery.support.style && notxml && name === "style" ) { - if ( set ) { - elem.style.cssText = "" + value; - } - - return elem.style.cssText; - } - - if ( set ) { - // convert the value to a string (all browsers do this but IE) see #1070 - elem.setAttribute( name, "" + value ); - } - - var attr = !jQuery.support.hrefNormalized && notxml && special ? - // Some attributes require a special call on IE - elem.getAttribute( name, 2 ) : - elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return attr === null ? undefined : attr; - } - - // elem is actually elem.style ... set the style - // Using attr for specific style information is now deprecated. Use style insead. - return jQuery.style( elem, name, value ); - } -}); -var fcleanup = function( nm ) { - return nm.replace(/[^\w\s\.\|`]/g, function( ch ) { - return "\\" + ch; - }); -}; - -/* - * A number of helper functions used for managing events. - * Many of the ideas behind this code originated from - * Dean Edwards' addEvent library. - */ -jQuery.event = { - - // Bind an event to an element - // Original by Dean Edwards - add: function( elem, types, handler, data ) { - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // For whatever reason, IE has trouble passing the window object - // around, causing it to be cloned in the process - if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) { - elem = window; - } - - // Make sure that the function being executed has a unique ID - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // if data is passed, bind to handler - if ( data !== undefined ) { - // Create temporary function pointer to original handler - var fn = handler; - - // Create unique handler function, wrapped around original handler - handler = jQuery.proxy( fn ); - - // Store data in unique handler - handler.data = data; - } - - // Init the element's event structure - var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ), - handle = jQuery.data( elem, "handle" ), eventHandle; - - if ( !handle ) { - eventHandle = function() { - // Handle the second event of a trigger and when - // an event is called after a page has unloaded - return typeof jQuery !== "undefined" && !jQuery.event.triggered ? - jQuery.event.handle.apply( eventHandle.elem, arguments ) : - undefined; - }; - - handle = jQuery.data( elem, "handle", eventHandle ); - } - - // If no handle is found then we must be trying to bind to one of the - // banned noData elements - if ( !handle ) { - return; - } - - // Add elem as a property of the handle function - // This is to prevent a memory leak with non-native - // event in IE. - handle.elem = elem; - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = types.split( /\s+/ ); - - var type, i = 0; - - while ( (type = types[ i++ ]) ) { - // Namespaced event handlers - var namespaces = type.split("."); - type = namespaces.shift(); - - if ( i > 1 ) { - handler = jQuery.proxy( handler ); - - if ( data !== undefined ) { - handler.data = data; - } - } - - handler.type = namespaces.slice(0).sort().join("."); - - // Get the current list of functions bound to this event - var handlers = events[ type ], - special = this.special[ type ] || {}; - - // Init the event handler queue - if ( !handlers ) { - handlers = events[ type ] = {}; - - // Check for a special event handler - // Only use addEventListener/attachEvent if the special - // events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, handle, false ); - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, handle ); - } - } - } - - if ( special.add ) { - var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers ); - if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) { - modifiedHandler.guid = modifiedHandler.guid || handler.guid; - modifiedHandler.data = modifiedHandler.data || handler.data; - modifiedHandler.type = modifiedHandler.type || handler.type; - handler = modifiedHandler; - } - } - - // Add the function to the element's handler list - handlers[ handler.guid ] = handler; - - // Keep track of which events have been used, for global triggering - this.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - global: {}, - - // Detach an event or set of events from an element - remove: function( elem, types, handler ) { - // don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - var events = jQuery.data( elem, "events" ), ret, type, fn; - - if ( events ) { - // Unbind all events for the element - if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) { - for ( type in events ) { - this.remove( elem, type + (types || "") ); - } - } else { - // types is actually an event object here - if ( types.type ) { - handler = types.handler; - types = types.type; - } - - // Handle multiple events separated by a space - // jQuery(...).unbind("mouseover mouseout", fn); - types = types.split(/\s+/); - var i = 0; - while ( (type = types[ i++ ]) ) { - // Namespaced event handlers - var namespaces = type.split("."); - type = namespaces.shift(); - var all = !namespaces.length, - cleaned = jQuery.map( namespaces.slice(0).sort(), fcleanup ), - namespace = new RegExp("(^|\\.)" + cleaned.join("\\.(?:.*\\.)?") + "(\\.|$)"), - special = this.special[ type ] || {}; - - if ( events[ type ] ) { - // remove the given handler for the given type - if ( handler ) { - fn = events[ type ][ handler.guid ]; - delete events[ type ][ handler.guid ]; - - // remove all handlers for the given type - } else { - for ( var handle in events[ type ] ) { - // Handle the removal of namespaced events - if ( all || namespace.test( events[ type ][ handle ].type ) ) { - delete events[ type ][ handle ]; - } - } - } - - if ( special.remove ) { - special.remove.call( elem, namespaces, fn); - } - - // remove generic event handler if no more handlers exist - for ( ret in events[ type ] ) { - break; - } - if ( !ret ) { - if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, jQuery.data( elem, "handle" ), false ); - } else if ( elem.detachEvent ) { - elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) ); - } - } - ret = null; - delete events[ type ]; - } - } - } - } - - // Remove the expando if it's no longer used - for ( ret in events ) { - break; - } - if ( !ret ) { - var handle = jQuery.data( elem, "handle" ); - if ( handle ) { - handle.elem = null; - } - jQuery.removeData( elem, "events" ); - jQuery.removeData( elem, "handle" ); - } - } - }, - - // bubbling is internal - trigger: function( event, data, elem /*, bubbling */ ) { - // Event object or event type - var type = event.type || event, - bubbling = arguments[3]; - - if ( !bubbling ) { - event = typeof event === "object" ? - // jQuery.Event object - event[expando] ? event : - // Object literal - jQuery.extend( jQuery.Event(type), event ) : - // Just the event type (string) - jQuery.Event(type); - - if ( type.indexOf("!") >= 0 ) { - event.type = type = type.slice(0, -1); - event.exclusive = true; - } - - // Handle a global trigger - if ( !elem ) { - // Don't bubble custom events when global (to avoid too much overhead) - event.stopPropagation(); - - // Only trigger if we've ever bound an event for it - if ( this.global[ type ] ) { - jQuery.each( jQuery.cache, function() { - if ( this.events && this.events[type] ) { - jQuery.event.trigger( event, data, this.handle.elem ); - } - }); - } - } - - // Handle triggering a single element - - // don't do events on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { - return undefined; - } - - // Clean up in case it is reused - event.result = undefined; - event.target = elem; - - // Clone the incoming data, if any - data = jQuery.makeArray( data ); - data.unshift( event ); - } - - event.currentTarget = elem; - - // Trigger the event, it is assumed that "handle" is a function - var handle = jQuery.data( elem, "handle" ); - if ( handle ) { - handle.apply( elem, data ); - } - - var parent = elem.parentNode || elem.ownerDocument; - - // Trigger an inline bound script - try { - if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { - if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { - event.result = false; - } - } - - // prevent IE from throwing an error for some elements with some event types, see #3533 - } catch (e) {} - - if ( !event.isPropagationStopped() && parent ) { - jQuery.event.trigger( event, data, parent, true ); - - } else if ( !event.isDefaultPrevented() ) { - var target = event.target, old, - isClick = jQuery.nodeName(target, "a") && type === "click"; - - if ( !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { - try { - if ( target[ type ] ) { - // Make sure that we don't accidentally re-trigger the onFOO events - old = target[ "on" + type ]; - - if ( old ) { - target[ "on" + type ] = null; - } - - this.triggered = true; - target[ type ](); - } - - // prevent IE from throwing an error for some elements with some event types, see #3533 - } catch (e) {} - - if ( old ) { - target[ "on" + type ] = old; - } - - this.triggered = false; - } - } - }, - - handle: function( event ) { - // returned undefined or false - var all, handlers; - - event = arguments[0] = jQuery.event.fix( event || window.event ); - event.currentTarget = this; - - // Namespaced event handlers - var namespaces = event.type.split("."); - event.type = namespaces.shift(); - - // Cache this now, all = true means, any handler - all = !namespaces.length && !event.exclusive; - - var namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)"); - - handlers = ( jQuery.data(this, "events") || {} )[ event.type ]; - - for ( var j in handlers ) { - var handler = handlers[ j ]; - - // Filter the functions by class - if ( all || namespace.test(handler.type) ) { - // Pass in a reference to the handler function itself - // So that we can later remove it - event.handler = handler; - event.data = handler.data; - - var ret = handler.apply( this, arguments ); - - if ( ret !== undefined ) { - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - - if ( event.isImmediatePropagationStopped() ) { - break; - } - - } - } - - return event.result; - }, - - props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), - - fix: function( event ) { - if ( event[ expando ] ) { - return event; - } - - // store a copy of the original event object - // and "clone" to set read-only properties - var originalEvent = event; - event = jQuery.Event( originalEvent ); - - for ( var i = this.props.length, prop; i; ) { - prop = this.props[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary - if ( !event.target ) { - event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either - } - - // check if target is a textnode (safari) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && event.fromElement ) { - event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; - } - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && event.clientX != null ) { - var doc = document.documentElement, body = document.body; - event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); - event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); - } - - // Add which for key events - if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) { - event.which = event.charCode || event.keyCode; - } - - // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) - if ( !event.metaKey && event.ctrlKey ) { - event.metaKey = event.ctrlKey; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && event.button !== undefined ) { - event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); - } - - return event; - }, - - // Deprecated, use jQuery.guid instead - guid: 1E8, - - // Deprecated, use jQuery.proxy instead - proxy: jQuery.proxy, - - special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady, - teardown: jQuery.noop - }, - - live: { - add: function( proxy, data, namespaces, live ) { - jQuery.extend( proxy, data || {} ); - - proxy.guid += data.selector + data.live; - data.liveProxy = proxy; - - jQuery.event.add( this, data.live, liveHandler, data ); - - }, - - remove: function( namespaces ) { - if ( namespaces.length ) { - var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)"); - - jQuery.each( (jQuery.data(this, "events").live || {}), function() { - if ( name.test(this.type) ) { - remove++; - } - }); - - if ( remove < 1 ) { - jQuery.event.remove( this, namespaces[0], liveHandler ); - } - } - }, - special: {} - }, - beforeunload: { - setup: function( data, namespaces, fn ) { - // We only want to do this special case on windows - if ( this.setInterval ) { - this.onbeforeunload = fn; - } - - return false; - }, - teardown: function( namespaces, fn ) { - if ( this.onbeforeunload === fn ) { - this.onbeforeunload = null; - } - } - } - } -}; - -jQuery.Event = function( src ) { - // Allow instantiation without the 'new' keyword - if ( !this.preventDefault ) { - return new jQuery.Event( src ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - // Event type - } else { - this.type = src; - } - - // timeStamp is buggy for some events on Firefox(#3843) - // So we won't rely on the native value - this.timeStamp = now(); - - // Mark it as fixed - this[ expando ] = true; -}; - -function returnFalse() { - return false; -} -function returnTrue() { - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - - // if preventDefault exists run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - } - // otherwise set the returnValue property of the original event to false (IE) - e.returnValue = false; - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - // if stopPropagation exists run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -// Checks if an event happened on an element within another element -// Used in jQuery.event.special.mouseenter and mouseleave handlers -var withinElement = function( event ) { - // Check if mouse(over|out) are still within the same parent element - var parent = event.relatedTarget; - - // Traverse up the tree - while ( parent && parent !== this ) { - // Firefox sometimes assigns relatedTarget a XUL element - // which we cannot access the parentNode property of - try { - parent = parent.parentNode; - - // assuming we've left the element since we most likely mousedover a xul element - } catch(e) { - break; - } - } - - if ( parent !== this ) { - // set the correct event type - event.type = event.data; - - // handle event if we actually just moused on to a non sub-element - jQuery.event.handle.apply( this, arguments ); - } - -}, - -// In case of event delegation, we only need to rename the event.type, -// liveHandler will take care of the rest. -delegate = function( event ) { - event.type = event.data; - jQuery.event.handle.apply( this, arguments ); -}; - -// Create mouseenter and mouseleave events -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - setup: function( data ) { - jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); - }, - teardown: function( data ) { - jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); - } - }; -}); - -// submit delegation -if ( !jQuery.support.submitBubbles ) { - -jQuery.event.special.submit = { - setup: function( data, namespaces, fn ) { - if ( this.nodeName.toLowerCase() !== "form" ) { - jQuery.event.add(this, "click.specialSubmit." + fn.guid, function( e ) { - var elem = e.target, type = elem.type; - - if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { - return trigger( "submit", this, arguments ); - } - }); - - jQuery.event.add(this, "keypress.specialSubmit." + fn.guid, function( e ) { - var elem = e.target, type = elem.type; - - if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { - return trigger( "submit", this, arguments ); - } - }); - - } else { - return false; - } - }, - - remove: function( namespaces, fn ) { - jQuery.event.remove( this, "click.specialSubmit" + (fn ? "."+fn.guid : "") ); - jQuery.event.remove( this, "keypress.specialSubmit" + (fn ? "."+fn.guid : "") ); - } -}; - -} - -// change delegation, happens here so we have bind. -if ( !jQuery.support.changeBubbles ) { - -var formElems = /textarea|input|select/i; - -function getVal( elem ) { - var type = elem.type, val = elem.value; - - if ( type === "radio" || type === "checkbox" ) { - val = elem.checked; - - } else if ( type === "select-multiple" ) { - val = elem.selectedIndex > -1 ? - jQuery.map( elem.options, function( elem ) { - return elem.selected; - }).join("-") : - ""; - - } else if ( elem.nodeName.toLowerCase() === "select" ) { - val = elem.selectedIndex; - } - - return val; -} - -function testChange( e ) { - var elem = e.target, data, val; - - if ( !formElems.test( elem.nodeName ) || elem.readOnly ) { - return; - } - - data = jQuery.data( elem, "_change_data" ); - val = getVal(elem); - - // the current data will be also retrieved by beforeactivate - if ( e.type !== "focusout" || elem.type !== "radio" ) { - jQuery.data( elem, "_change_data", val ); - } - - if ( data === undefined || val === data ) { - return; - } - - if ( data != null || val ) { - e.type = "change"; - return jQuery.event.trigger( e, arguments[1], elem ); - } -} - -jQuery.event.special.change = { - filters: { - focusout: testChange, - - click: function( e ) { - var elem = e.target, type = elem.type; - - if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { - return testChange.call( this, e ); - } - }, - - // Change has to be called before submit - // Keydown will be called before keypress, which is used in submit-event delegation - keydown: function( e ) { - var elem = e.target, type = elem.type; - - if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || - (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || - type === "select-multiple" ) { - return testChange.call( this, e ); - } - }, - - // Beforeactivate happens also before the previous element is blurred - // with this event you can't trigger a change event, but you can store - // information/focus[in] is not needed anymore - beforeactivate: function( e ) { - var elem = e.target; - - if ( elem.nodeName.toLowerCase() === "input" && elem.type === "radio" ) { - jQuery.data( elem, "_change_data", getVal(elem) ); - } - } - }, - setup: function( data, namespaces, fn ) { - for ( var type in changeFilters ) { - jQuery.event.add( this, type + ".specialChange." + fn.guid, changeFilters[type] ); - } - - return formElems.test( this.nodeName ); - }, - remove: function( namespaces, fn ) { - for ( var type in changeFilters ) { - jQuery.event.remove( this, type + ".specialChange" + (fn ? "."+fn.guid : ""), changeFilters[type] ); - } - - return formElems.test( this.nodeName ); - } -}; - -var changeFilters = jQuery.event.special.change.filters; - -} - -function trigger( type, elem, args ) { - args[0].type = type; - return jQuery.event.handle.apply( elem, args ); -} - -// Create "bubbling" focus and blur events -if ( document.addEventListener ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - jQuery.event.special[ fix ] = { - setup: function() { - this.addEventListener( orig, handler, true ); - }, - teardown: function() { - this.removeEventListener( orig, handler, true ); - } - }; - - function handler( e ) { - e = jQuery.event.fix( e ); - e.type = fix; - return jQuery.event.handle.call( this, e ); - } - }); -} - -jQuery.each(["bind", "one"], function( i, name ) { - jQuery.fn[ name ] = function( type, data, fn ) { - // Handle object literals - if ( typeof type === "object" ) { - for ( var key in type ) { - this[ name ](key, data, type[key], fn); - } - return this; - } - - if ( jQuery.isFunction( data ) ) { - fn = data; - data = undefined; - } - - var handler = name === "one" ? jQuery.proxy( fn, function( event ) { - jQuery( this ).unbind( event, handler ); - return fn.apply( this, arguments ); - }) : fn; - - return type === "unload" && name !== "one" ? - this.one( type, data, fn ) : - this.each(function() { - jQuery.event.add( this, type, handler, data ); - }); - }; -}); - -jQuery.fn.extend({ - unbind: function( type, fn ) { - // Handle object literals - if ( typeof type === "object" && !type.preventDefault ) { - for ( var key in type ) { - this.unbind(key, type[key]); - } - return this; - } - - return this.each(function() { - jQuery.event.remove( this, type, fn ); - }); - }, - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - - triggerHandler: function( type, data ) { - if ( this[0] ) { - var event = jQuery.Event( type ); - event.preventDefault(); - event.stopPropagation(); - jQuery.event.trigger( event, data, this[0] ); - return event.result; - } - }, - - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, i = 1; - - // link all the functions, so any of them can unbind this click handler - while ( i < args.length ) { - jQuery.proxy( fn, args[ i++ ] ); - } - - return this.click( jQuery.proxy( fn, function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - })); - }, - - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -}); - -jQuery.each(["live", "die"], function( i, name ) { - jQuery.fn[ name ] = function( types, data, fn ) { - var type, i = 0; - - if ( jQuery.isFunction( data ) ) { - fn = data; - data = undefined; - } - - types = (types || "").split( /\s+/ ); - - while ( (type = types[ i++ ]) != null ) { - type = type === "focus" ? "focusin" : // focus --> focusin - type === "blur" ? "focusout" : // blur --> focusout - type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support - type; - - if ( name === "live" ) { - // bind live handler - jQuery( this.context ).bind( liveConvert( type, this.selector ), { - data: data, selector: this.selector, live: type - }, fn ); - - } else { - // unbind live handler - jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null ); - } - } - - return this; - } -}); - -function liveHandler( event ) { - var stop, elems = [], selectors = [], args = arguments, - related, match, fn, elem, j, i, l, data, - live = jQuery.extend({}, jQuery.data( this, "events" ).live); - - // Make sure we avoid non-left-click bubbling in Firefox (#3861) - if ( event.button && event.type === "click" ) { - return; - } - - for ( j in live ) { - fn = live[j]; - if ( fn.live === event.type || - fn.altLive && jQuery.inArray(event.type, fn.altLive) > -1 ) { - - data = fn.data; - if ( !(data.beforeFilter && data.beforeFilter[event.type] && - !data.beforeFilter[event.type](event)) ) { - selectors.push( fn.selector ); - } - } else { - delete live[j]; - } - } - - match = jQuery( event.target ).closest( selectors, event.currentTarget ); - - for ( i = 0, l = match.length; i < l; i++ ) { - for ( j in live ) { - fn = live[j]; - elem = match[i].elem; - related = null; - - if ( match[i].selector === fn.selector ) { - // Those two events require additional checking - if ( fn.live === "mouseenter" || fn.live === "mouseleave" ) { - related = jQuery( event.relatedTarget ).closest( fn.selector )[0]; - } - - if ( !related || related !== elem ) { - elems.push({ elem: elem, fn: fn }); - } - } - } - } - - for ( i = 0, l = elems.length; i < l; i++ ) { - match = elems[i]; - event.currentTarget = match.elem; - event.data = match.fn.data; - if ( match.fn.apply( match.elem, args ) === false ) { - stop = false; - break; - } - } - - return stop; -} - -function liveConvert( type, selector ) { - return "live." + (type ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&"); -} - -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup error").split(" "), function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( fn ) { - return fn ? this.bind( name, fn ) : this.trigger( name ); - }; - - if ( jQuery.attrFn ) { - jQuery.attrFn[ name ] = true; - } -}); - -// Prevent memory leaks in IE -// Window isn't included so as not to unbind existing unload events -// More info: -// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ -if ( window.attachEvent && !window.addEventListener ) { - window.attachEvent("onunload", function() { - for ( var id in jQuery.cache ) { - if ( jQuery.cache[ id ].handle ) { - // Try/Catch is to handle iframes being unloaded, see #4280 - try { - jQuery.event.remove( jQuery.cache[ id ].handle.elem ); - } catch(e) {} - } - } - }); -} -/*! - * Sizzle CSS Selector Engine - v1.0 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function(){ - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function(selector, context, results, seed) { - results = results || []; - var origContext = context = context || document; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context), - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context ); - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set ); - } - } - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - var ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; - } - - if ( context ) { - var ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray(set); - } else { - prune = false; - } - - while ( parts.length ) { - var cur = parts.pop(), pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - } else if ( context && context.nodeType === 1 ) { - for ( var i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - } else { - for ( var i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function(results){ - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort(sortOrder); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[i-1] ) { - results.splice(i--, 1); - } - } - } - } - - return results; -}; - -Sizzle.matches = function(expr, set){ - return Sizzle(expr, null, null, set); -}; - -Sizzle.find = function(expr, context, isXML){ - var set, match; - - if ( !expr ) { - return []; - } - - for ( var i = 0, l = Expr.order.length; i < l; i++ ) { - var type = Expr.order[i], match; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - var left = match[1]; - match.splice(1,1); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace(/\\/g, ""); - set = Expr.find[ type ]( match, context, isXML ); - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = context.getElementsByTagName("*"); - } - - return {set: set, expr: expr}; -}; - -Sizzle.filter = function(expr, set, inplace, not){ - var old = expr, result = [], curLoop = set, match, anyFound, - isXMLFilter = set && set[0] && isXML(set[0]); - - while ( expr && set.length ) { - for ( var type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - var filter = Expr.filter[ type ], found, item, left = match[1]; - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( var i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - var pass = not ^ !!found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - } else { - curLoop[i] = false; - } - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw "Syntax error, unrecognized expression: " + msg; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - match: { - ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - leftMatch: {}, - attrMap: { - "class": "className", - "for": "htmlFor" - }, - attrHandle: { - href: function(elem){ - return elem.getAttribute("href"); - } - }, - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !/\W/.test(part), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - ">": function(checkSet, part){ - var isPartStr = typeof part === "string"; - - if ( isPartStr && !/\W/.test(part) ) { - part = part.toLowerCase(); - - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - } else { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - "": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck; - - if ( typeof part === "string" && !/\W/.test(part) ) { - var nodeCheck = part = part.toLowerCase(); - checkFn = dirNodeCheck; - } - - checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); - }, - "~": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck; - - if ( typeof part === "string" && !/\W/.test(part) ) { - var nodeCheck = part = part.toLowerCase(); - checkFn = dirNodeCheck; - } - - checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); - } - }, - find: { - ID: function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? [m] : []; - } - }, - NAME: function(match, context){ - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], results = context.getElementsByName(match[1]); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - TAG: function(match, context){ - return context.getElementsByTagName(match[1]); - } - }, - preFilter: { - CLASS: function(match, curLoop, inplace, result, not, isXML){ - match = " " + match[1].replace(/\\/g, "") + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - ID: function(match){ - return match[1].replace(/\\/g, ""); - }, - TAG: function(match, curLoop){ - return match[1].toLowerCase(); - }, - CHILD: function(match){ - if ( match[1] === "nth" ) { - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - ATTR: function(match, curLoop, inplace, result, not, isXML){ - var name = match[1].replace(/\\/g, ""); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - PSEUDO: function(match, curLoop, inplace, result, not){ - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - if ( !inplace ) { - result.push.apply( result, ret ); - } - return false; - } - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - POS: function(match){ - match.unshift( true ); - return match; - } - }, - filters: { - enabled: function(elem){ - return elem.disabled === false && elem.type !== "hidden"; - }, - disabled: function(elem){ - return elem.disabled === true; - }, - checked: function(elem){ - return elem.checked === true; - }, - selected: function(elem){ - // Accessing this property makes selected-by-default - // options in Safari work properly - elem.parentNode.selectedIndex; - return elem.selected === true; - }, - parent: function(elem){ - return !!elem.firstChild; - }, - empty: function(elem){ - return !elem.firstChild; - }, - has: function(elem, i, match){ - return !!Sizzle( match[3], elem ).length; - }, - header: function(elem){ - return /h\d/i.test( elem.nodeName ); - }, - text: function(elem){ - return "text" === elem.type; - }, - radio: function(elem){ - return "radio" === elem.type; - }, - checkbox: function(elem){ - return "checkbox" === elem.type; - }, - file: function(elem){ - return "file" === elem.type; - }, - password: function(elem){ - return "password" === elem.type; - }, - submit: function(elem){ - return "submit" === elem.type; - }, - image: function(elem){ - return "image" === elem.type; - }, - reset: function(elem){ - return "reset" === elem.type; - }, - button: function(elem){ - return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; - }, - input: function(elem){ - return /input|select|textarea|button/i.test(elem.nodeName); - } - }, - setFilters: { - first: function(elem, i){ - return i === 0; - }, - last: function(elem, i, match, array){ - return i === array.length - 1; - }, - even: function(elem, i){ - return i % 2 === 0; - }, - odd: function(elem, i){ - return i % 2 === 1; - }, - lt: function(elem, i, match){ - return i < match[3] - 0; - }, - gt: function(elem, i, match){ - return i > match[3] - 0; - }, - nth: function(elem, i, match){ - return match[3] - 0 === i; - }, - eq: function(elem, i, match){ - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function(elem, match, i, array){ - var name = match[1], filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; - } else if ( name === "not" ) { - var not = match[3]; - - for ( var i = 0, l = not.length; i < l; i++ ) { - if ( not[i] === elem ) { - return false; - } - } - - return true; - } else { - Sizzle.error( "Syntax error, unrecognized expression: " + name ); - } - }, - CHILD: function(elem, match){ - var type = match[1], node = elem; - switch (type) { - case 'only': - case 'first': - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - if ( type === "first" ) { - return true; - } - node = elem; - case 'last': - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - return true; - case 'nth': - var first = match[2], last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - var doneName = match[0], - parent = elem.parentNode; - - if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { - var count = 0; - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - parent.sizcache = doneName; - } - - var diff = elem.nodeIndex - last; - if ( first === 0 ) { - return diff === 0; - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - ID: function(elem, match){ - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - TAG: function(elem, match){ - return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; - }, - CLASS: function(elem, match){ - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - ATTR: function(elem, match){ - var name = match[1], - result = Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - POS: function(elem, match, i, array){ - var name = match[2], filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){ - return "\\" + (num - 0 + 1); - })); -} - -var makeArray = function(array, results) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 ); - -// Provide a fallback method if it does not work -} catch(e){ - makeArray = function(array, results) { - var ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - } else { - if ( typeof array.length === "number" ) { - for ( var i = 0, l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - } else { - for ( var i = 0; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - if ( a == b ) { - hasDuplicate = true; - } - return a.compareDocumentPosition ? -1 : 1; - } - - var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( "sourceIndex" in document.documentElement ) { - sortOrder = function( a, b ) { - if ( !a.sourceIndex || !b.sourceIndex ) { - if ( a == b ) { - hasDuplicate = true; - } - return a.sourceIndex ? -1 : 1; - } - - var ret = a.sourceIndex - b.sourceIndex; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( document.createRange ) { - sortOrder = function( a, b ) { - if ( !a.ownerDocument || !b.ownerDocument ) { - if ( a == b ) { - hasDuplicate = true; - } - return a.ownerDocument ? -1 : 1; - } - - var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); - aRange.setStart(a, 0); - aRange.setEnd(a, 0); - bRange.setStart(b, 0); - bRange.setEnd(b, 0); - var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} - -// Utility function for retreiving the text value of an array of DOM nodes -function getText( elems ) { - var ret = "", elem; - - for ( var i = 0; elems[i]; i++ ) { - elem = elems[i]; - - // Get the text from text nodes and CDATA nodes - if ( elem.nodeType === 3 || elem.nodeType === 4 ) { - ret += elem.nodeValue; - - // Traverse everything else, except comment nodes - } else if ( elem.nodeType !== 8 ) { - ret += getText( elem.childNodes ); - } - } - - return ret; -} - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date).getTime(); - form.innerHTML = ""; - - // Inject it into the root element, check its status, and remove it quickly - var root = document.documentElement; - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; - } - }; - - Expr.filter.ID = function(elem, match){ - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); - root = form = null; // release memory in IE -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function(match, context){ - var results = context.getElementsByTagName(match[1]); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = ""; - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - Expr.attrHandle.href = function(elem){ - return elem.getAttribute("href", 2); - }; - } - - div = null; // release memory in IE -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, div = document.createElement("div"); - div.innerHTML = "

    "; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function(query, context, extra, seed){ - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && context.nodeType === 9 && !isXML(context) ) { - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(e){} - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - div = null; // release memory in IE - })(); -} - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "
    "; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function(match, context, isXML) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; - - div = null; // release memory in IE -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - elem = elem[dir]; - var match = false; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem.sizcache = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - elem = elem[dir]; - var match = false; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem.sizcache = doneName; - elem.sizset = i; - } - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -var contains = document.compareDocumentPosition ? function(a, b){ - return a.compareDocumentPosition(b) & 16; -} : function(a, b){ - return a !== b && (a.contains ? a.contains(b) : true); -}; - -var isXML = function(elem){ - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function(selector, context){ - var tmpSet = [], later = "", match, - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; -jQuery.unique = Sizzle.uniqueSort; -jQuery.getText = getText; -jQuery.isXMLDoc = isXML; -jQuery.contains = contains; - -return; - -window.Sizzle = Sizzle; - -})(); -var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, - slice = Array.prototype.slice; - -// Implement the identical functionality for filter and not -var winnow = function( elements, qualifier, keep ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem, i ) { - return (elem === qualifier) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem, i ) { - return (jQuery.inArray( elem, qualifier ) >= 0) === keep; - }); -}; - -jQuery.fn.extend({ - find: function( selector ) { - var ret = this.pushStack( "", "find", selector ), length = 0; - - for ( var i = 0, l = this.length; i < l; i++ ) { - length = ret.length; - jQuery.find( selector, this[i], ret ); - - if ( i > 0 ) { - // Make sure that the results are unique - for ( var n = length; n < ret.length; n++ ) { - for ( var r = 0; r < length; r++ ) { - if ( ret[r] === ret[n] ) { - ret.splice(n--, 1); - break; - } - } - } - } - } - - return ret; - }, - - has: function( target ) { - var targets = jQuery( target ); - return this.filter(function() { - for ( var i = 0, l = targets.length; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector, false), "not", selector); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector, true), "filter", selector ); - }, - - is: function( selector ) { - return !!selector && jQuery.filter( selector, this ).length > 0; - }, - - closest: function( selectors, context ) { - if ( jQuery.isArray( selectors ) ) { - var ret = [], cur = this[0], match, matches = {}, selector; - - if ( cur && selectors.length ) { - for ( var i = 0, l = selectors.length; i < l; i++ ) { - selector = selectors[i]; - - if ( !matches[selector] ) { - matches[selector] = jQuery.expr.match.POS.test( selector ) ? - jQuery( selector, context || this.context ) : - selector; - } - } - - while ( cur && cur.ownerDocument && cur !== context ) { - for ( selector in matches ) { - match = matches[selector]; - - if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { - ret.push({ selector: selector, elem: cur }); - delete matches[selector]; - } - } - cur = cur.parentNode; - } - } - - return ret; - } - - var pos = jQuery.expr.match.POS.test( selectors ) ? - jQuery( selectors, context || this.context ) : null; - - return this.map(function( i, cur ) { - while ( cur && cur.ownerDocument && cur !== context ) { - if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) { - return cur; - } - cur = cur.parentNode; - } - return null; - }); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - if ( !elem || typeof elem === "string" ) { - return jQuery.inArray( this[0], - // If it receives a string, the selector is used - // If it receives nothing, the siblings are used - elem ? jQuery( elem ) : this.parent().children() ); - } - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context || this.context ) : - jQuery.makeArray( selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? - all : - jQuery.unique( all ) ); - }, - - andSelf: function() { - return this.add( this.prevObject ); - } -}); - -// A painfully simple check to see if an element is disconnected -// from a document (should be improved, where feasible). -function isDisconnected( node ) { - return !node || !node.parentNode || node.parentNode.nodeType === 11; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return jQuery.nth( elem, 2, "nextSibling" ); - }, - prev: function( elem ) { - return jQuery.nth( elem, 2, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( elem.parentNode.firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray( elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, name, slice.call(arguments).join(",") ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - var matched = [], cur = elem[dir]; - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - nth: function( cur, result, dir, elem ) { - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) { - if ( cur.nodeType === 1 && ++num === result ) { - break; - } - } - - return cur; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); -var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, - rleadingWhitespace = /^\s+/, - rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g, - rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i, - rtagName = /<([\w:]+)/, - rtbody = /"; - }, - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
    ", "
    " ], - thead: [ 1, "", "
    " ], - tr: [ 2, "", "
    " ], - td: [ 3, "", "
    " ], - col: [ 2, "", "
    " ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }; - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and - \ No newline at end of file + +@{ + var publicKey = (string)Model.PublicKey; +} +@if (HasText(publicKey)) { + + +
    +
    + +
    +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.AntiSpam/Web.config b/src/Orchard.Web/Modules/Orchard.AntiSpam/Web.config index 57b026f6ea5..a3cb5df907e 100644 --- a/src/Orchard.Web/Modules/Orchard.AntiSpam/Web.config +++ b/src/Orchard.Web/Modules/Orchard.AntiSpam/Web.config @@ -1,36 +1,37 @@ - + - - -
    -
    +
    +
    - + - - - - - - - - + + + + + + + + - + - - - - - + + + + + + + + @@ -38,16 +39,20 @@ - - + + - - + + - - + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.AntiSpam/packages.config b/src/Orchard.Web/Modules/Orchard.AntiSpam/packages.config new file mode 100644 index 00000000000..1ea27eef99b --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.AntiSpam/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Content/Web.config b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Content/Web.config index 11135c33761..93eab9a7372 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Content/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Content/Web.config @@ -1,16 +1,12 @@ - + - - - - - - - - - - + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Handlers/ArchiveLaterPartHandler.cs b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Handlers/ArchiveLaterPartHandler.cs index c2836ff7937..b77d6b96264 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Handlers/ArchiveLaterPartHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Handlers/ArchiveLaterPartHandler.cs @@ -14,7 +14,7 @@ public ArchiveLaterPartHandler(IArchiveLaterService archiveLaterService) { } protected void LazyLoadHandlers(ArchiveLaterPart part) { - part.ScheduledArchiveUtc.Loader((value) => _archiveLaterService.GetScheduledArchiveUtc(part)); + part.ScheduledArchiveUtc.Loader(() => _archiveLaterService.GetScheduledArchiveUtc(part)); } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Handlers/UnpublishingTaskHandler.cs b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Handlers/UnpublishingTaskHandler.cs index f6d5915545e..936f568bf1a 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Handlers/UnpublishingTaskHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Handlers/UnpublishingTaskHandler.cs @@ -1,10 +1,8 @@ -using JetBrains.Annotations; -using Orchard.ContentManagement; +using Orchard.ContentManagement; using Orchard.Logging; using Orchard.Tasks.Scheduling; namespace Orchard.ArchiveLater.Handlers { - [UsedImplicitly] public class UnpublishingTaskHandler : IScheduledTaskHandler { private readonly IContentManager _contentManager; diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Module.txt b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Module.txt index fd71c040457..e91fbab8c68 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Module.txt +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Module.txt @@ -3,7 +3,7 @@ Path: ArchiveLater AntiForgery: enabled Author: The Orchard Team Website: http://orchardproject.net -Version: 1.9.2 +Version: 1.10 OrchardVersion: 1.9 Description: The ArchiveLater module introduces scheduled archiving functionality. FeatureDescription: Scheduled archiving. diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Orchard.ArchiveLater.csproj b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Orchard.ArchiveLater.csproj index bef6f2fd587..fd07e175b1d 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Orchard.ArchiveLater.csproj +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Orchard.ArchiveLater.csproj @@ -13,7 +13,7 @@ Properties Orchard.ArchiveLater Orchard.ArchiveLater - v4.5.1 + v4.5.2 false @@ -26,6 +26,7 @@ + true @@ -49,17 +50,41 @@ + + ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + True + - - False - ..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll - + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll + True + + + ..\..\..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll + True + + + ..\..\..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll + True + @@ -82,10 +107,12 @@ {9916839C-39FC-4CEB-A5AF-89CA7E87119F} Orchard.Core + false {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} Orchard.Framework + false @@ -105,6 +132,9 @@ + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Properties/AssemblyInfo.cs b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Properties/AssemblyInfo.cs index 155d5924e30..2d6d6067bba 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Properties/AssemblyInfo.cs +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.9.2")] -[assembly: AssemblyFileVersion("1.9.2")] +[assembly: AssemblyVersion("1.10")] +[assembly: AssemblyFileVersion("1.10")] diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Web.config b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Web.config index 57b026f6ea5..a3cb5df907e 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Web.config @@ -1,36 +1,37 @@ - + - - -
    -
    +
    +
    - + - - - - - - - - + + + + + + + + - + - - - - - + + + + + + + + @@ -38,16 +39,20 @@ - - + + - - + + - - + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/packages.config b/src/Orchard.Web/Modules/Orchard.ArchiveLater/packages.config new file mode 100644 index 00000000000..6729ced4977 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/ImportExport/AuditTrailExportHandler.cs b/src/Orchard.Web/Modules/Orchard.AuditTrail/ImportExport/AuditTrailExportHandler.cs deleted file mode 100644 index cf9483ddeeb..00000000000 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/ImportExport/AuditTrailExportHandler.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Linq; -using System.Xml.Linq; -using Orchard.AuditTrail.Models; -using Orchard.Data; -using Orchard.Environment.Extensions; -using Orchard.ImportExport.Services; - -namespace Orchard.AuditTrail.ImportExport { - [OrchardFeature("Orchard.AuditTrail.ImportExport")] - public class AuditTrailExportEventHandler : IExportEventHandler { - private readonly IRepository _auditTrailEventRepository; - - public AuditTrailExportEventHandler(IRepository auditTrailEventRepository) { - _auditTrailEventRepository = auditTrailEventRepository; - } - - public void Exporting(ExportContext context) { - } - - public void Exported(ExportContext context) { - - if (!context.ExportOptions.CustomSteps.Contains("AuditTrail")) { - return; - } - - var records = _auditTrailEventRepository.Table.ToList(); - - if (!records.Any()) { - return; - } - - var root = new XElement("AuditTrail"); - context.Document.Element("Orchard").Add(root); - - foreach (var record in records) { - root.Add(new XElement("Event", - CreateAttribute("Name", record.EventName), - CreateAttribute("FullName", record.FullEventName), - CreateAttribute("Category", record.Category), - CreateAttribute("User", record.UserName), - CreateAttribute("CreatedUtc", record.CreatedUtc), - CreateAttribute("EventFilterKey", record.EventFilterKey), - CreateAttribute("EventFilterData", record.EventFilterData), - CreateElement("Comment", record.Comment), - ParseEventData(record.EventData))); - } - } - - private static XElement CreateElement(string name, string value) { - return !String.IsNullOrWhiteSpace(value) ? new XElement(name, value) : null; - } - - private static XAttribute CreateAttribute(string name, string value) { - return !String.IsNullOrWhiteSpace(value) ? new XAttribute(name, value) : null; - } - - private static XAttribute CreateAttribute(string name, object value) { - return new XAttribute(name, value); - } - - private static XElement ParseEventData(string eventData) { - if(String.IsNullOrWhiteSpace(eventData)) - return new XElement("EventData"); - - return XElement.Parse(eventData); - } - } -} - diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/ImportExport/AuditTrailExportStep.cs b/src/Orchard.Web/Modules/Orchard.AuditTrail/ImportExport/AuditTrailExportStep.cs deleted file mode 100644 index 786f8452916..00000000000 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/ImportExport/AuditTrailExportStep.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic; -using Orchard.Environment.Extensions; -using Orchard.ImportExport.Services; - -namespace Orchard.AuditTrail.ImportExport { - [OrchardFeature("Orchard.AuditTrail.ImportExport")] - public class AuditTrailExportStep : ICustomExportStep { - public void Register(IList steps) { - steps.Add("AuditTrail"); - } - } -} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/ImportExport/AuditTrailImportHandler.cs b/src/Orchard.Web/Modules/Orchard.AuditTrail/ImportExport/AuditTrailImportHandler.cs deleted file mode 100644 index 8c2bca005ad..00000000000 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/ImportExport/AuditTrailImportHandler.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using Orchard.AuditTrail.Models; -using Orchard.ContentManagement; -using Orchard.Data; -using Orchard.Environment.Extensions; -using Orchard.Logging; -using Orchard.Recipes.Models; -using Orchard.Recipes.Services; -using Orchard.Security; - -namespace Orchard.AuditTrail.ImportExport { - [OrchardFeature("Orchard.AuditTrail.ImportExport")] - public class AuditTrailImportHandler : Component, IRecipeHandler { - private readonly IRepository _auditTrailEventRepository; - private readonly IAuthorizer _authorizer; - private readonly IWorkContextAccessor _wca; - - public AuditTrailImportHandler(IRepository auditTrailEventRepository, IAuthorizer authorizer, IWorkContextAccessor wca) { - _auditTrailEventRepository = auditTrailEventRepository; - _authorizer = authorizer; - _wca = wca; - } - - public void ExecuteRecipeStep(RecipeContext recipeContext) { - if (!String.Equals(recipeContext.RecipeStep.Name, "AuditTrail", StringComparison.OrdinalIgnoreCase)) { - return; - } - - if (!_authorizer.Authorize(Permissions.ImportAuditTrail)) { - Logger.Warning("Blocked {0} from importing an audit trail because this user does not have the ImportauditTrail permission.", _wca.GetContext().CurrentUser.UserName); - recipeContext.Executed = false; - return; - } - - foreach (var eventElement in recipeContext.RecipeStep.Step.Elements()) { - var record = new AuditTrailEventRecord { - EventName = eventElement.Attr("Name"), - FullEventName = eventElement.Attr("FullName"), - Category = eventElement.Attr("Category"), - UserName = eventElement.Attr("User"), - CreatedUtc = eventElement.Attr("CreatedUtc"), - EventFilterKey = eventElement.Attr("EventFilterKey"), - EventFilterData = eventElement.Attr("EventFilterData"), - Comment = eventElement.El("Comment"), - EventData = eventElement.Element("EventData").ToString(), - }; - - _auditTrailEventRepository.Create(record); - } - - recipeContext.Executed = true; - } - } -} diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Models/AuditTrailSettingsPart.cs b/src/Orchard.Web/Modules/Orchard.AuditTrail/Models/AuditTrailSettingsPart.cs index 7554f81c1c3..b7824b81d82 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Models/AuditTrailSettingsPart.cs +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Models/AuditTrailSettingsPart.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Orchard.ContentManagement; -using Orchard.Core.Common.Utilities; +using Orchard.ContentManagement.Utilities; namespace Orchard.AuditTrail.Models { public class AuditTrailSettingsPart : ContentPart { diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Module.txt b/src/Orchard.Web/Modules/Orchard.AuditTrail/Module.txt index e6836ba954a..c783e426590 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Module.txt +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Module.txt @@ -2,7 +2,7 @@ AntiForgery: enabled Author: The Orchard Team Website: http://orchardproject.net -Version: 1.9.2 +Version: 1.10 OrchardVersion: 1.9 Description: Provides a log for recording and viewing back-end changes. Features: @@ -14,7 +14,7 @@ Features: Name: Audit Trail Import Export Description: Provides import/export functionality for the Audit Trail feature. Category: Security - Dependencies: Orchard.AuditTrail, Orchard.ImportExport + Dependencies: Orchard.AuditTrail Orchard.AuditTrail.Trimming: Name: Audit Trail Trimming Description: Provides a background task that regularly deletes old audit trail records. diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj b/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj index 8e91168a2cb..ef72e6f09a0 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj @@ -12,7 +12,7 @@ Properties Orchard.AuditTrail Orchard.AuditTrail - v4.5.1 + v4.5.2 false @@ -48,14 +48,22 @@ false + + ..\..\..\packages\Iesi.Collections.4.0.1.4000\lib\net40\Iesi.Collections.dll + True + - - False - ..\..\..\..\lib\newtonsoft.json\Newtonsoft.Json.dll + + ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + True + + + ..\..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + True - False - ..\..\..\..\lib\nhibernate\NHibernate.dll + ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + True @@ -67,19 +75,42 @@ - - False - ..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll - + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll + True + + + ..\..\..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll + True + + + ..\..\..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll + True + - - False - ..\..\..\..\lib\xmldiffpatch\xmldiffpatch.dll + + ..\..\..\packages\XMLDiffPatch.1.0.8.28\lib\net\XmlDiffPatch.dll + True + + + ..\..\..\packages\XMLDiffPatch.1.0.8.28\lib\net\XmlDiffPatch.View.dll True @@ -99,7 +130,9 @@ - + + Designer + @@ -161,10 +194,12 @@ {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} Orchard.Framework + false {9916839C-39FC-4CEB-A5AF-89CA7E87119F} Orchard.Core + false {0e7646e8-fe8f-43c1-8799-d97860925ec4} @@ -192,6 +227,8 @@ + + @@ -210,9 +247,6 @@ - - - @@ -327,6 +361,9 @@ + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Recipes/Builders/AuditTrailStep.cs b/src/Orchard.Web/Modules/Orchard.AuditTrail/Recipes/Builders/AuditTrailStep.cs new file mode 100644 index 00000000000..70b5e204de3 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Recipes/Builders/AuditTrailStep.cs @@ -0,0 +1,75 @@ +using System; +using System.Linq; +using System.Xml.Linq; +using Orchard.AuditTrail.Models; +using Orchard.Data; +using Orchard.Environment.Extensions; +using Orchard.Localization; +using Orchard.Recipes.Services; + +namespace Orchard.AuditTrail.Recipes.Builders { + [OrchardFeature("Orchard.AuditTrail.ImportExport")] + public class AuditTrailStep : RecipeBuilderStep { + private readonly IRepository _auditTrailEventRepository; + + public AuditTrailStep(IRepository auditTrailEventRepository) { + _auditTrailEventRepository = auditTrailEventRepository; + } + + public override string Name { + get { return "AuditTrail"; } + } + + public override LocalizedString DisplayName { + get { return T("AuditTrail"); } + } + + public override LocalizedString Description { + get { return T("Exports audit trail events."); } + } + + public override void Build(BuildContext context) { + var records = _auditTrailEventRepository.Table.ToList(); + + if (!records.Any()) { + return; + } + + var root = new XElement("AuditTrail"); + context.RecipeDocument.Element("Orchard").Add(root); + + foreach (var record in records) { + root.Add(new XElement("Event", + CreateAttribute("Name", record.EventName), + CreateAttribute("FullName", record.FullEventName), + CreateAttribute("Category", record.Category), + CreateAttribute("User", record.UserName), + CreateAttribute("CreatedUtc", record.CreatedUtc), + CreateAttribute("EventFilterKey", record.EventFilterKey), + CreateAttribute("EventFilterData", record.EventFilterData), + CreateElement("Comment", record.Comment), + ParseEventData(record.EventData))); + } + } + + private static XElement CreateElement(string name, string value) { + return !String.IsNullOrWhiteSpace(value) ? new XElement(name, value) : null; + } + + private static XAttribute CreateAttribute(string name, string value) { + return !String.IsNullOrWhiteSpace(value) ? new XAttribute(name, value) : null; + } + + private static XAttribute CreateAttribute(string name, object value) { + return new XAttribute(name, value); + } + + private static XElement ParseEventData(string eventData) { + if (String.IsNullOrWhiteSpace(eventData)) + return new XElement("EventData"); + + return XElement.Parse(eventData); + } + } +} + diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Recipes/Executors/AuditTrailStep.cs b/src/Orchard.Web/Modules/Orchard.AuditTrail/Recipes/Executors/AuditTrailStep.cs new file mode 100644 index 00000000000..c6dc1bd4327 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Recipes/Executors/AuditTrailStep.cs @@ -0,0 +1,67 @@ +using System; +using System.Linq; +using Orchard.AuditTrail.Models; +using Orchard.ContentManagement; +using Orchard.Data; +using Orchard.Environment.Extensions; +using Orchard.Logging; +using Orchard.Recipes.Models; +using Orchard.Recipes.Services; +using Orchard.Security; + +namespace Orchard.AuditTrail.Recipes.Executors { + [OrchardFeature("Orchard.AuditTrail.ImportExport")] + public class AuditTrailStep : RecipeExecutionStep { + private readonly IRepository _auditTrailEventRepository; + private readonly IAuthorizer _authorizer; + private readonly IWorkContextAccessor _wca; + + public AuditTrailStep( + IRepository auditTrailEventRepository, + IAuthorizer authorizer, + IWorkContextAccessor wca, + RecipeExecutionLogger logger) : base(logger) { + + _auditTrailEventRepository = auditTrailEventRepository; + _authorizer = authorizer; + _wca = wca; + } + + public override string Name { + get { return "AuditTrail"; } + } + + public override void Execute(RecipeExecutionContext context) { + if (!_authorizer.Authorize(Permissions.ImportAuditTrail)) { + Logger.Warning("Blocked {0} from importing an audit trail because this user does not have the ImportauditTrail permission.", _wca.GetContext().CurrentUser.UserName); + return; + } + + var elements = context.RecipeStep.Step.Elements().ToArray(); + for (var i = 0; i < elements.Length; i ++) { + var eventElement = elements[i]; + Logger.Information("Importing audit trail event {0}/{1}.", i + 1, elements.Length); + + try { + var record = new AuditTrailEventRecord { + EventName = eventElement.Attr("Name"), + FullEventName = eventElement.Attr("FullName"), + Category = eventElement.Attr("Category"), + UserName = eventElement.Attr("User"), + CreatedUtc = eventElement.Attr("CreatedUtc"), + EventFilterKey = eventElement.Attr("EventFilterKey"), + EventFilterData = eventElement.Attr("EventFilterData"), + Comment = eventElement.El("Comment"), + EventData = eventElement.Element("EventData").ToString(), + }; + + _auditTrailEventRepository.Create(record); + } + catch (Exception ex) { + Logger.Error(ex, "Error while importing audit trail event {0}/{1}.", i + 1, elements.Length); + throw; + } + } + } + } +} diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Scripts/Web.config b/src/Orchard.Web/Modules/Orchard.AuditTrail/Scripts/Web.config index 8171989953c..176fe49cd7a 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Scripts/Web.config +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Scripts/Web.config @@ -1,16 +1,12 @@ - + - - - - - - - - - - + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/AuditTrailTrimmingBackgroundTask.cs b/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/AuditTrailTrimmingBackgroundTask.cs index 83da1ae6935..8c142ec6a4d 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/AuditTrailTrimmingBackgroundTask.cs +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/AuditTrailTrimmingBackgroundTask.cs @@ -1,34 +1,32 @@ using System; using System.Linq; -using System.Threading; using Orchard.AuditTrail.Models; using Orchard.ContentManagement; using Orchard.Environment.Extensions; using Orchard.Logging; using Orchard.Services; using Orchard.Settings; -using Orchard.TaskLease.Services; using Orchard.Tasks; +using Orchard.Tasks.Locking.Services; namespace Orchard.AuditTrail.Services { [OrchardFeature("Orchard.AuditTrail.Trimming")] public class AuditTrailTrimmingBackgroundTask : Component, IBackgroundTask { - private static readonly object _sweepLock = new object(); private readonly ISiteService _siteService; private readonly IClock _clock; - private readonly ITaskLeaseService _taskLeaseService; private readonly IAuditTrailManager _auditTrailManager; + private readonly IDistributedLockService _distributedLockService; public AuditTrailTrimmingBackgroundTask( ISiteService siteService, IClock clock, - ITaskLeaseService taskLeaseService, - IAuditTrailManager auditTrailManager) { + IAuditTrailManager auditTrailManager, + IDistributedLockService distributedLockService) { _siteService = siteService; _clock = clock; - _taskLeaseService = taskLeaseService; _auditTrailManager = auditTrailManager; + _distributedLockService = distributedLockService; } public AuditTrailTrimmingSettingsPart Settings { @@ -36,12 +34,13 @@ public AuditTrailTrimmingSettingsPart Settings { } public void Sweep() { - if (Monitor.TryEnter(_sweepLock)) { - try { - Logger.Debug("Beginning sweep."); + Logger.Debug("Beginning sweep."); - // Only allow this task to run on one farm node at a time. - if (_taskLeaseService.Acquire(GetType().FullName, _clock.UtcNow.AddHours(1)) != null) { + try { + // Only allow this task to run on one farm node at a time. + IDistributedLock @lock; + if (_distributedLockService.TryAcquireLock(GetType().FullName, TimeSpan.FromHours(1), out @lock)) { + using (@lock) { // We don't need to check the audit trail for events to remove every minute. Let's stick with twice a day. if (!GetIsTimeToTrim()) @@ -51,15 +50,16 @@ public void Sweep() { var deletedRecords = _auditTrailManager.Trim(TimeSpan.FromDays(Settings.RetentionPeriod)); Logger.Debug("Audit trail trimming completed. {0} records were deleted.", deletedRecords.Count()); Settings.LastRunUtc = _clock.UtcNow; - } - } - catch (Exception ex) { - Logger.Error(ex, "Error during sweep."); - } - finally { - Monitor.Exit(_sweepLock); - Logger.Debug("Ending sweep."); + } } + else + Logger.Debug("Distributed lock could not be acquired; going back to sleep."); + } + catch (Exception ex) { + Logger.Error(ex, "Error during sweep."); + } + finally { + Logger.Debug("Ending sweep."); } } diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/DiffGramAnalyzer.cs b/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/DiffGramAnalyzer.cs index 42c51c62ee5..d9e4ad70876 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/DiffGramAnalyzer.cs +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/DiffGramAnalyzer.cs @@ -66,7 +66,6 @@ public IEnumerable Analyze(XElement original, XElement diffGram) { var originalContent = currentElement.Value; var currentContent = reader.ReadElementContentAsString(); - stack.Pop(); readNext = false; yield return new DiffNode { diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.AuditTrail/Styles/Web.config index 8171989953c..176fe49cd7a 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Styles/Web.config +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Styles/Web.config @@ -1,16 +1,12 @@ - + - - - - - - - - - - + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Web.config b/src/Orchard.Web/Modules/Orchard.AuditTrail/Web.config index 2ee9337d875..bfeea149d0f 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Web.config +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Web.config @@ -1,37 +1,38 @@ - + - - -
    -
    +
    +
    - + - - - - - - - - + + + + + + + + - + - - - - - - + + + + + + + + + @@ -39,16 +40,20 @@ - - + + - - + + - - + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config b/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config new file mode 100644 index 00000000000..c54fc737ce9 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Drivers/AutoroutePartDriver.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Drivers/AutoroutePartDriver.cs index 2bc48485ea2..268d81a57b3 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Drivers/AutoroutePartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Drivers/AutoroutePartDriver.cs @@ -4,134 +4,178 @@ using Orchard.Alias; using Orchard.Autoroute.Models; using Orchard.Autoroute.Services; +using Orchard.Autoroute.Settings; +using Orchard.Autoroute.ViewModels; using Orchard.ContentManagement; +using Orchard.ContentManagement.Aspects; using Orchard.ContentManagement.Drivers; -using Orchard.Autoroute.ViewModels; -using Orchard.Autoroute.Settings; +using Orchard.ContentManagement.Handlers; using Orchard.Localization; +using Orchard.Localization.Services; +using Orchard.Mvc; using Orchard.Security; using Orchard.UI.Notify; using Orchard.Utility.Extensions; namespace Orchard.Autoroute.Drivers { public class AutoroutePartDriver : ContentPartDriver { - private readonly IAliasService _aliasService; - private readonly IContentManager _contentManager; private readonly IAutorouteService _autorouteService; - private readonly IAuthorizer _authorizer; private readonly INotifier _notifier; + private readonly IHomeAliasService _homeAliasService; + private readonly IAliasService _aliasService; + private readonly ICultureManager _cultureManager; + private readonly IHttpContextAccessor _httpContextAccessor; + private readonly IContentManager _contentManager; public AutoroutePartDriver( - IAliasService aliasService, - IContentManager contentManager, IAutorouteService autorouteService, + INotifier notifier, + IHomeAliasService homeAliasService, + IAliasService aliasService, IAuthorizer authorizer, - INotifier notifier) { + ICultureManager cultureManager, + IContentManager contentManager, + IHttpContextAccessor httpContextAccessor) { + _aliasService = aliasService; _contentManager = contentManager; _autorouteService = autorouteService; - _authorizer = authorizer; _notifier = notifier; + _homeAliasService = homeAliasService; + _cultureManager = cultureManager; + _httpContextAccessor = httpContextAccessor; T = NullLocalizer.Instance; } public Localizer T { get; set; } - protected override string Prefix { get { return "Autoroute"; }} - protected override DriverResult Editor(AutoroutePart part, dynamic shapeHelper) { return Editor(part, null, shapeHelper); } protected override DriverResult Editor(AutoroutePart part, IUpdateModel updater, dynamic shapeHelper) { - var settings = part.TypePartDefinition.Settings.GetModel(); + var itemCulture = _cultureManager.GetSiteCulture(); + + // If we are editing an existing content item, check to see if we are an ILocalizableAspect so we can use its culture for alias generation. + if (part.Record.Id != 0) { + var localizableAspect = part.As(); + + if (localizableAspect != null) { + itemCulture = localizableAspect.Culture; + } + } + + if (settings.UseCulturePattern) { + // Hack: if the LocalizedPart is attached to the content item, it will submit the following form value, + // which we use to determine what culture to use for alias generation. + var context = _httpContextAccessor.Current(); + if (!String.IsNullOrEmpty(context.Request.Form["Localization.SelectedCulture"])) { + itemCulture = context.Request.Form["Localization.SelectedCulture"].ToString(); + } + } + + // We update the settings assuming that when + // pattern culture = null or "" it means culture = default website culture + // for patterns that we migrated. + foreach (var pattern in settings.Patterns.Where(x => String.IsNullOrWhiteSpace(x.Culture))) { + pattern.Culture = _cultureManager.GetSiteCulture(); ; + } + + // We do the same for default patterns. + foreach (var pattern in settings.DefaultPatterns.Where(x => String.IsNullOrWhiteSpace(x.Culture))) { + pattern.Culture = _cultureManager.GetSiteCulture(); + } - // if the content type has no pattern for autoroute, then use a default one - if(!settings.Patterns.Any()) { - settings.AllowCustomPattern = true; - settings.AutomaticAdjustmentOnEdit = false; - settings.DefaultPatternIndex = 0; - settings.Patterns = new List {new RoutePattern {Name = "Title", Description = "my-title", Pattern = "{Content.Slug}"}}; - - _notifier.Warning(T("No route patterns are currently defined for this Content Type. If you don't set one in the settings, a default one will be used.")); + // If the content type has no pattern for autoroute, then use a default one. + if (!settings.Patterns.Any(x => String.Equals(x.Culture, itemCulture, StringComparison.OrdinalIgnoreCase))) { + settings.Patterns = new List { new RoutePattern { Name = "Title", Description = "my-title", Pattern = "{Content.Slug}", Culture = itemCulture } }; + } + + // If the content type has no defaultPattern for autoroute, then use a default one. + if (!settings.DefaultPatterns.Any(x => String.Equals(x.Culture, itemCulture, StringComparison.OrdinalIgnoreCase))) { + // If we are in the default culture, check the old setting. + if (String.Equals(itemCulture, _cultureManager.GetSiteCulture(), StringComparison.OrdinalIgnoreCase)) { + if (!String.IsNullOrWhiteSpace(settings.DefaultPatternIndex)) { + var patternIndex = settings.DefaultPatternIndex; + settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = patternIndex, Culture = itemCulture }); + } else { + settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = "0", Culture = itemCulture }); + } + } else { + settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = "0", Culture = itemCulture }); + } } var viewModel = new AutoroutePartEditViewModel { CurrentUrl = part.DisplayAlias, - Settings = settings + Settings = settings, + CurrentCulture = itemCulture }; - // retrieve home page - var homepage = _aliasService.Get(string.Empty); - var displayRouteValues = _contentManager.GetItemMetadata(part).DisplayRouteValues; + // Retrieve home page. + var homePageId = _homeAliasService.GetHomePageId(VersionOptions.Latest); + var isHomePage = part.Id == homePageId; - viewModel.IsHomePage = homepage.Match(displayRouteValues); - viewModel.PromoteToHomePage = viewModel.IsHomePage || part.DisplayAlias == "/"; + viewModel.IsHomePage = isHomePage; + viewModel.PromoteToHomePage = part.PromoteToHomePage; if (settings.PerItemConfiguration) { - // if enabled, the list of all available patterns is displayed, and the user can - // select which one to use - + // If enabled, the list of all available patterns is displayed, and the user can select which one to use. // todo: later } var previous = part.DisplayAlias; if (updater != null && updater.TryUpdateModel(viewModel, Prefix, null, null)) { - // remove any leading slash in the permalink + // Remove any leading slash in the permalink. if (viewModel.CurrentUrl != null) { viewModel.CurrentUrl = viewModel.CurrentUrl.TrimStart('/'); } part.DisplayAlias = viewModel.CurrentUrl; - // reset the alias if we need to force regeneration, and the user didn't provide a custom one + // Reset the alias if we need to force regeneration, and the user didn't provide a custom one. if(settings.AutomaticAdjustmentOnEdit && previous == part.DisplayAlias) { - part.DisplayAlias = string.Empty; + part.DisplayAlias = String.Empty; } if (!_autorouteService.IsPathValid(part.DisplayAlias)) { updater.AddModelError("CurrentUrl", T("Please do not use any of the following characters in your permalink: \":\", \"?\", \"#\", \"[\", \"]\", \"@\", \"!\", \"$\", \"&\", \"'\", \"(\", \")\", \"*\", \"+\", \",\", \";\", \"=\", \", \"<\", \">\", \"\\\", \"|\", \"%\", \".\". No spaces are allowed (please use dashes or underscores instead).")); } - - // if CurrentUrl is set, the handler won't try to create an alias for it - // but instead keep the value - - // if home page is requested, use "/" to have the handler create a homepage alias - if(viewModel.PromoteToHomePage) { - part.DisplayAlias = "/"; + + if (part.DisplayAlias != null && part.DisplayAlias.Length > 1850){ + updater.AddModelError("CurrentUrl", T("Your permalink is too long. The permalink can only be up to 1,850 characters.")); } + + // Mark the content item to be the homepage. Once this content isp ublished, the home alias will be updated to point to this content item. + part.PromoteToHomePage = viewModel.PromoteToHomePage; } return ContentShape("Parts_Autoroute_Edit", () => shapeHelper.EditorTemplate(TemplateName: "Parts.Autoroute.Edit", Model: viewModel, Prefix: Prefix)); } - protected override void Importing(AutoroutePart part, ContentManagement.Handlers.ImportContentContext context) { + protected override void Importing(AutoroutePart part, ImportContentContext context) { // Don't do anything if the tag is not specified. if (context.Data.Element(part.PartDefinition.Name) == null) { return; } - context.ImportAttribute(part.PartDefinition.Name, "Alias", displayAlias => - part.DisplayAlias = displayAlias - ); - - context.ImportAttribute(part.PartDefinition.Name, "CustomPattern", customPattern => - part.CustomPattern = customPattern - ); - - context.ImportAttribute(part.PartDefinition.Name, "UseCustomPattern", useCustomPattern => - part.UseCustomPattern = bool.Parse(useCustomPattern) - ); + context.ImportAttribute(part.PartDefinition.Name, "Alias", s => part.DisplayAlias = s); + context.ImportAttribute(part.PartDefinition.Name, "CustomPattern", s => part.CustomPattern = s); + context.ImportAttribute(part.PartDefinition.Name, "UseCustomPattern", s => part.UseCustomPattern = XmlHelper.Parse(s)); + context.ImportAttribute(part.PartDefinition.Name, "UseCulturePattern", s => part.UseCulturePattern = XmlHelper.Parse(s)); + context.ImportAttribute(part.PartDefinition.Name, "PromoteToHomePage", s => part.PromoteToHomePage = XmlHelper.Parse(s)); } - protected override void Exporting(AutoroutePart part, ContentManagement.Handlers.ExportContentContext context) { - context.Element(part.PartDefinition.Name).SetAttributeValue("Alias", String.IsNullOrEmpty(part.Record.DisplayAlias) ? "/" : part.Record.DisplayAlias); + protected override void Exporting(AutoroutePart part, ExportContentContext context) { + context.Element(part.PartDefinition.Name).SetAttributeValue("Alias", part.Record.DisplayAlias); context.Element(part.PartDefinition.Name).SetAttributeValue("CustomPattern", part.Record.CustomPattern); context.Element(part.PartDefinition.Name).SetAttributeValue("UseCustomPattern", part.Record.UseCustomPattern); + context.Element(part.PartDefinition.Name).SetAttributeValue("UseCulturePattern", part.Record.UseCulturePattern); + context.Element(part.PartDefinition.Name).SetAttributeValue("PromoteToHomePage", part.UseCustomPattern); } } } diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Handlers/AutoroutePartHandler.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Handlers/AutoroutePartHandler.cs index d6509c9f7b5..1038e93abd8 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Handlers/AutoroutePartHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Handlers/AutoroutePartHandler.cs @@ -1,10 +1,9 @@ using System; -using System.Linq; +using Orchard.Autoroute.Models; +using Orchard.Autoroute.Services; using Orchard.ContentManagement; using Orchard.ContentManagement.Handlers; -using Orchard.Autoroute.Models; using Orchard.Data; -using Orchard.Autoroute.Services; using Orchard.Localization; using Orchard.UI.Notify; @@ -13,17 +12,20 @@ public class AutoroutePartHandler : ContentHandler { private readonly Lazy _autorouteService; private readonly IOrchardServices _orchardServices; + private readonly IHomeAliasService _homeAliasService; public Localizer T { get; set; } public AutoroutePartHandler( IRepository autoroutePartRepository, Lazy autorouteService, - IOrchardServices orchardServices) { + IOrchardServices orchardServices, + IHomeAliasService homeAliasService) { Filters.Add(StorageFilter.For(autoroutePartRepository)); _autorouteService = autorouteService; _orchardServices = orchardServices; + _homeAliasService = homeAliasService; OnUpdated((ctx, part) => CreateAlias(part)); @@ -34,13 +36,11 @@ public AutoroutePartHandler( } }); - // OnVersioned((ctx, part1, part2) => CreateAlias(part1)); - OnPublished((ctx, part) => PublishAlias(part)); // Remove alias if destroyed, removed or unpublished + OnRemoving((ctx, part) => RemoveAlias(part)); OnDestroyed((ctx, part) => RemoveAlias(part)); - OnRemoved((ctx, part) => RemoveAlias(part)); OnUnpublished((ctx, part) => RemoveAlias(part)); // Register alias as identity @@ -57,51 +57,55 @@ private void CreateAlias(AutoroutePart part) { private void PublishAlias(AutoroutePart part) { ProcessAlias(part); - // should it become the home page ? - if (part.DisplayAlias == "/") { - part.DisplayAlias = String.Empty; - - // regenerate the alias for the previous home page - var currentHomePages = _orchardServices.ContentManager.Query().Where(x => x.DisplayAlias == "").List(); - foreach (var current in currentHomePages.Where(x => x.Id != part.Id)) { - if (current != null) { - current.CustomPattern = String.Empty; // force the regeneration - current.DisplayAlias = _autorouteService.Value.GenerateAlias(current); - - // we changed the alias of the previous homepage, so publish this change if the content item was published. - if(current.IsPublished()) - _orchardServices.ContentManager.Publish(current.ContentItem); + // Should it become the home page? + if (part.PromoteToHomePage) { + // Get the current homepage an unmark it as the homepage. + var currentHomePage = _homeAliasService.GetHomePage(VersionOptions.Latest); + if(currentHomePage != null && currentHomePage.Id != part.Id) { + var autoroutePart = currentHomePage.As(); + + if (autoroutePart != null) { + autoroutePart.PromoteToHomePage = false; + if(autoroutePart.IsPublished()) + _orchardServices.ContentManager.Publish(autoroutePart.ContentItem); } - _autorouteService.Value.PublishAlias(current); } - } + // Update the home alias to point to this item being published. + _homeAliasService.PublishHomeAlias(part); + } + _autorouteService.Value.PublishAlias(part); } private void ProcessAlias(AutoroutePart part) { - // generate an alias if one as not already been entered + // Generate an alias if one as not already been entered. if (String.IsNullOrWhiteSpace(part.DisplayAlias)) { part.DisplayAlias = _autorouteService.Value.GenerateAlias(part); } - // if the generated alias is empty, compute a new one + // If the generated alias is empty, compute a new one. if (String.IsNullOrWhiteSpace(part.DisplayAlias)) { _autorouteService.Value.ProcessPath(part); _orchardServices.Notifier.Warning(T("The permalink could not be generated, a new slug has been defined: \"{0}\"", part.Path)); return; } - // check for permalink conflict, unless we are trying to set the home page - if (part.DisplayAlias != "/") { - var previous = part.Path; - if (!_autorouteService.Value.ProcessPath(part)) - _orchardServices.Notifier.Warning(T("Permalinks in conflict. \"{0}\" is already set for a previously created {2} so now it has the slug \"{1}\"", - previous, part.Path, part.ContentItem.ContentType)); - } + // Check for permalink conflict, unless we are trying to set the home page. + var previous = part.Path; + if (!_autorouteService.Value.ProcessPath(part)) + _orchardServices.Notifier.Warning( + T("Permalinks in conflict. \"{0}\" is already set for a previously created {2} so now it has the slug \"{1}\"", + previous, part.Path, part.ContentItem.ContentType)); } void RemoveAlias(AutoroutePart part) { + var homePageId = _homeAliasService.GetHomePageId(VersionOptions.Latest); + + // Is this the current home page? + if (part.ContentItem.Id == homePageId) { + _orchardServices.Notifier.Warning(T("You removed the content item that served as the site's home page. \nMost possibly this means that instead of the home page a \"404 Not Found\" page will be displayed. \n\nTo prevent this you can e.g. publish a content item that has the \"Set as home page\" checkbox ticked.")); + } _autorouteService.Value.RemoveAliases(part); } } diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Migrations.cs index 3282e5563a4..545e7d35d6d 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Migrations.cs @@ -1,17 +1,18 @@ -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData; using Orchard.Core.Contents.Extensions; using Orchard.Data.Migration; -namespace Orchard.Autoroute { - public class Migrations : DataMigrationImpl { +namespace Orchard.Autoroute +{ + public class Migrations : DataMigrationImpl { public int Create() { SchemaBuilder.CreateTable("AutoroutePartRecord", table => table .ContentPartVersionRecord() .Column("CustomPattern", c => c.WithLength(2048)) - .Column("UseCustomPattern", c=> c.WithDefault(false)) + .Column("UseCustomPattern", c => c.WithDefault(false)) + .Column("UseCulturePattern", c => c.WithDefault(false)) .Column("DisplayAlias", c => c.WithLength(2048))); ContentDefinitionManager.AlterPartDefinition("AutoroutePart", part => part @@ -22,7 +23,7 @@ public int Create() { .CreateIndex("IDX_AutoroutePartRecord_DisplayAlias", "DisplayAlias") ); - return 3; + return 4; } public int UpdateFrom1() { @@ -39,5 +40,14 @@ public int UpdateFrom2() { return 3; } + + public int UpdateFrom3() { + + SchemaBuilder.AlterTable("AutoroutePartRecord", table => table + .AddColumn("UseCulturePattern", c => c.WithDefault(false)) + ); + + return 4; + } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Models/AutoroutePart.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Models/AutoroutePart.cs index c3e4b583bfa..98fcc957e33 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Models/AutoroutePart.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Models/AutoroutePart.cs @@ -12,11 +12,20 @@ public bool UseCustomPattern { get { return Retrieve(x => x.UseCustomPattern); } set { Store(x => x.UseCustomPattern, value); } } + public bool UseCulturePattern { + get { return Retrieve(x => x.UseCulturePattern); } + set { Store(x => x.UseCulturePattern, value); } + } public string DisplayAlias { get { return Retrieve(x => x.DisplayAlias); } set { Store(x => x.DisplayAlias, value); } } + public bool PromoteToHomePage { + get { return this.Retrieve(x => x.PromoteToHomePage); } + set { this.Store(x => x.PromoteToHomePage, value); } + } + public string Path { get { return DisplayAlias; } } diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Models/AutoroutePartRecord.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Models/AutoroutePartRecord.cs index 0ee3fdabf78..68a2aaf00f6 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Models/AutoroutePartRecord.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Models/AutoroutePartRecord.cs @@ -5,6 +5,8 @@ namespace Orchard.Autoroute.Models { public class AutoroutePartRecord : ContentPartVersionRecord { public virtual bool UseCustomPattern { get; set; } + + public virtual bool UseCulturePattern { get; set; } [StringLength(2048)] public virtual string CustomPattern { get; set; } diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Module.txt b/src/Orchard.Web/Modules/Orchard.Autoroute/Module.txt index 385dd1e3c1e..9a8bceb8d0b 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Module.txt +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Module.txt @@ -2,12 +2,12 @@ Name: Autoroute AntiForgery: enabled Author: The Orchard Team Website: http://orchardproject.net -Version: 1.9.2 +Version: 1.10 OrchardVersion: 1.9 Description: Description for the module Features: Orchard.Autoroute: - Name: Autoroute + Name: Autoroute Description: Enables the Autoroute part for tokenized routing - Dependencies: Orchard.Alias, Orchard.Tokens - Category: Content + Dependencies: Orchard.Alias, Orchard.Tokens + Category: Content diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Orchard.Autoroute.csproj b/src/Orchard.Web/Modules/Orchard.Autoroute/Orchard.Autoroute.csproj index 43c95b5d2d3..5daad31c8fa 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Orchard.Autoroute.csproj +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Orchard.Autoroute.csproj @@ -12,7 +12,7 @@ Properties Orchard.Autoroute Orchard.Autoroute - v4.5.1 + v4.5.2 false @@ -50,6 +50,10 @@ + + ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + True + @@ -60,18 +64,39 @@ - - False - ..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll - + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll + True + + + ..\..\..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll + True + + + ..\..\..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll + True + + @@ -84,15 +109,21 @@ {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} Orchard.Framework + false {9916839C-39FC-4CEB-A5AF-89CA7E87119F} Orchard.Core + false {475B6C45-B27C-438B-8966-908B9D6D1077} Orchard.Alias + + {0e7646e8-fe8f-43c1-8799-d97860925ec4} + Orchard.ContentTypes + {6F759635-13D7-4E94-BCC9-80445D63F117} Orchard.Tokens @@ -100,12 +131,18 @@ + + + + + + @@ -121,9 +158,6 @@ - - - Designer @@ -133,6 +167,9 @@ + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Properties/AssemblyInfo.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Properties/AssemblyInfo.cs index d9fe3622272..f7dd7c436c7 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Properties/AssemblyInfo.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.9.2")] -[assembly: AssemblyFileVersion("1.9.2")] +[assembly: AssemblyVersion("1.10")] +[assembly: AssemblyFileVersion("1.10")] diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Providers/ContentDefinition/ContentDefinitionEventHandler.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Providers/ContentDefinition/ContentDefinitionEventHandler.cs new file mode 100644 index 00000000000..97d61324f5d --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Providers/ContentDefinition/ContentDefinitionEventHandler.cs @@ -0,0 +1,106 @@ +using Orchard.Autoroute.Models; +using Orchard.Autoroute.Services; +using Orchard.Autoroute.Settings; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentTypes.Events; +using Orchard.Localization.Services; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Orchard.Autoroute.Providers.ContentDefinition { + public class ContentDefinitionEventHandler : IContentDefinitionEventHandler { + private readonly ICultureManager _cultureManager; + private readonly IContentDefinitionManager _contentDefinitionManager; + private readonly IOrchardServices _orchardServices; + private readonly Lazy _autorouteService; + private readonly IContentManager _contentManager; + + public ContentDefinitionEventHandler( + IContentManager contentManager, + Lazy autorouteService, + IOrchardServices orchardServices, + IContentDefinitionManager contentDefinitionManager, + ICultureManager cultureManager) { + _cultureManager = cultureManager; + _contentDefinitionManager = contentDefinitionManager; + _orchardServices = orchardServices; + _autorouteService = autorouteService; + _contentManager = contentManager; + } + + public void ContentTypeCreated(ContentTypeCreatedContext context) { + } + + public void ContentTypeRemoved(ContentTypeRemovedContext context) { + } + + public void ContentTypeImporting(ContentTypeImportingContext context) { + } + + public void ContentTypeImported(ContentTypeImportedContext context) { + } + + public void ContentPartCreated(ContentPartCreatedContext context) { + } + + public void ContentPartRemoved(ContentPartRemovedContext context) { + } + + public void ContentPartAttached(ContentPartAttachedContext context) { + if (context.ContentPartName == "AutoroutePart") { + //Create pattern and default pattern for each culture installed + + //get cultures + var SiteCultures = _cultureManager.ListCultures().ToList(); + + //Create Patterns and DefaultPatterns + var settings = new AutorouteSettings { + Patterns = new List() + }; + + List newPatterns = new List(); + List newDefaultPatterns = new List(); + foreach (string culture in SiteCultures) { + newPatterns.Add(new RoutePattern { + Name = "Title", + Description = "my-title", + Pattern = "{Content.Slug}", + Culture = culture + }); + newDefaultPatterns.Add(new DefaultPattern { + Culture = culture, + PatternIndex = "0" + }); + } + + settings.Patterns = newPatterns; + settings.DefaultPatterns = newDefaultPatterns; + + //Update Settings + _contentDefinitionManager.AlterTypeDefinition(context.ContentTypeName, builder => builder.WithPart("AutoroutePart", settings.Build)); + + //TODO Generate URL's for existing content items + //We should provide a global setting to enable/disable this feature + + } + } + + public void ContentPartDetached(ContentPartDetachedContext context) { + } + + public void ContentPartImporting(ContentPartImportingContext context) { + } + + public void ContentPartImported(ContentPartImportedContext context) { + } + + public void ContentFieldAttached(ContentFieldAttachedContext context) { + } + + public void ContentFieldDetached(ContentFieldDetachedContext context) { + } + + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Providers/SlugTokens.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Providers/SlugTokens.cs index 7d077e8b76a..74896d58dd3 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Providers/SlugTokens.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Providers/SlugTokens.cs @@ -10,10 +10,12 @@ namespace Orchard.Autoroute.Providers { public class SlugTokens : ITokenProvider { private readonly ISlugService _slugService; + private readonly IHomeAliasService _homeAliasService; - public SlugTokens(ISlugService slugService) { + public SlugTokens(ISlugService slugService, IHomeAliasService homeAliasService) { T = NullLocalizer.Instance; _slugService = slugService; + _homeAliasService = homeAliasService; } public Localizer T { get; set; } @@ -40,11 +42,12 @@ public void Evaluate(EvaluateContext context) { // {Content.Slug} .Token("Slug", (content => content == null ? String.Empty : _slugService.Slugify(content))) .Token("Path", (content => { - var autoroute = content.As(); - if (autoroute == null) { + var autoroutePart = content.As(); + if (autoroutePart == null) { return String.Empty; } - return autoroute.DisplayAlias; + var isHomePage = _homeAliasService.IsHomePage(autoroutePart); + return isHomePage ? String.Empty : autoroutePart.DisplayAlias; })) // {Content.ParentPath} .Token("ParentPath", (content => { @@ -52,13 +55,15 @@ public void Evaluate(EvaluateContext context) { if (common == null || common.Container == null) { return String.Empty; } - var ar = common.Container.As(); - if (ar == null) { + var containerAutoroutePart = common.Container.As(); + if (containerAutoroutePart == null) { return String.Empty; } - if (String.IsNullOrEmpty(ar.DisplayAlias)) + if (String.IsNullOrEmpty(containerAutoroutePart.DisplayAlias)) return String.Empty; - return ar.DisplayAlias + "/"; + + var isHomePage = _homeAliasService.IsHomePage(containerAutoroutePart); + return isHomePage ? "/" : containerAutoroutePart.DisplayAlias + "/"; })); context.For("TypeDefinition") diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Recipes/Builders/HomeAliasStep.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Recipes/Builders/HomeAliasStep.cs new file mode 100644 index 00000000000..c974d3a5563 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Recipes/Builders/HomeAliasStep.cs @@ -0,0 +1,59 @@ +using System; +using System.Linq; +using System.Web.Routing; +using System.Xml.Linq; +using Orchard.Autoroute.Services; +using Orchard.ContentManagement; +using Orchard.Localization; +using Orchard.Recipes.Services; + +namespace Orchard.Autoroute.Recipes.Builders { + public class HomeAliasStep : RecipeBuilderStep { + private readonly IHomeAliasService _homeAliasService; + private readonly IContentManager _contentManager; + + public HomeAliasStep(IHomeAliasService homeAliasService, IContentManager contentManager) { + _homeAliasService = homeAliasService; + _contentManager = contentManager; + } + + public override string Name { + get { return "HomeAlias"; } + } + + public override LocalizedString DisplayName { + get { return T("Home Alias"); } + } + + public override LocalizedString Description { + get { return T("Exports home alias."); } + } + + public override void Build(BuildContext context) { + var homeAliasRoute = _homeAliasService.GetHomeRoute() ?? new RouteValueDictionary(); + var root = new XElement("HomeAlias"); + var homePage = _homeAliasService.GetHomePage(VersionOptions.Latest); + + // If the home alias points to a content item, store its identifier in addition to the routevalues, + // so we can publish the home page alias during import where the ID primary key value of the home page might have changed, + // so we can't rely on the route values in that case. + if (homePage != null) { + var homePageIdentifier = _contentManager.GetItemMetadata(homePage).Identity.ToString(); + root.Attr("Id", homePageIdentifier); + } + else { + // The alias does not point to a content item, so export the route values instead. + root.Add(homeAliasRoute.Select(x => new XElement(Capitalize(x.Key), x.Value)).ToArray()); + } + + context.RecipeDocument.Element("Orchard").Add(root); + } + + private string Capitalize(string value) { + if (String.IsNullOrEmpty(value)) + return value; + + return Char.ToUpper(value[0]) + value.Substring(1); + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Recipes/Executors/HomeAliasStep.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Recipes/Executors/HomeAliasStep.cs new file mode 100644 index 00000000000..a05c396037a --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Recipes/Executors/HomeAliasStep.cs @@ -0,0 +1,35 @@ +using System; +using System.Linq; +using System.Web.Routing; +using Orchard.Autoroute.Services; +using Orchard.ContentManagement; +using Orchard.Recipes.Models; +using Orchard.Recipes.Services; + +namespace Orchard.Autoroute.Recipes.Executors { + public class HomeAliasStep : RecipeExecutionStep { + private readonly IContentManager _contentManager; + private readonly IHomeAliasService _homeAliasService; + + public HomeAliasStep(RecipeExecutionLogger logger, IContentManager contentManager, IHomeAliasService homeAliasService) : base(logger) { + _contentManager = contentManager; + _homeAliasService = homeAliasService; + } + + public override string Name { get { return "HomeAlias"; } } + + public override void Execute(RecipeExecutionContext context) { + var root = context.RecipeStep.Step; + var homePageIdentifier = root.Attr("Id"); + var homePageIdentity = !String.IsNullOrWhiteSpace(homePageIdentifier) ? new ContentIdentity(homePageIdentifier) : default(ContentIdentity); + var homePage = homePageIdentity != null ? _contentManager.ResolveIdentity(homePageIdentity) : default(ContentItem); + + if (homePage != null) + _homeAliasService.PublishHomeAlias(homePage); + else { + var routeValueDictionary = root.Elements().ToDictionary(x => x.Name.LocalName.ToLower(), x => (object) x.Value); + _homeAliasService.PublishHomeAlias(new RouteValueDictionary(routeValueDictionary)); + } + } + } +} diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/ResourceManifest.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/ResourceManifest.cs index 28e988927c8..d313df9e545 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/ResourceManifest.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/ResourceManifest.cs @@ -5,6 +5,7 @@ public class ResourceManifest : IResourceManifestProvider { public void BuildManifests(ResourceManifestBuilder builder) { var manifest = builder.Add(); manifest.DefineStyle("AutorouteSettings").SetUrl("orchard-autoroute-settings.css"); + manifest.DefineScript("AutorouteBrowser").SetUrl("autoroute-browser.js").SetDependencies("jQuery"); } } } diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Scripts/Web.config b/src/Orchard.Web/Modules/Orchard.Autoroute/Scripts/Web.config index 3a5872f14a3..176fe49cd7a 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Scripts/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Scripts/Web.config @@ -1,12 +1,12 @@ - + - - - - - - + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Scripts/autoroute-browser.js b/src/Orchard.Web/Modules/Orchard.Autoroute/Scripts/autoroute-browser.js new file mode 100644 index 00000000000..1e44d836614 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Scripts/autoroute-browser.js @@ -0,0 +1,42 @@ +(function ($) { + var AutorouteCultureBrowser = function (culture) { + var self = this; + this.culture = culture; + + this.initialize = function () { + self.culture.find(".autoroute-cultures").on("click", "a.culture", function (e) { + var categoryLink = $(this); + var href = categoryLink.attr("href"); + + self.culture.find(".autoroute-cultures li").removeClass("selected"); + categoryLink.closest("li").addClass("selected"); + self.culture.find(".items").hide(); + self.culture.find(href).show(); + e.preventDefault(); + }); + + self.culture.find(".autoroute-cultures a").first().click(); + } + }; + + $(".use-culture-pattern[type=checkbox]").click(function () { + if ($(this).attr("checked") == "checked") { + $(".autoroute-cultures li:not(:first)").hide(); + $(".autoroute-cultures li").removeClass("selected"); + $(".autoroute-cultures li:first").addClass("selected"); + $("#content .items").hide(); + $("#content .items.default").show(); + $(this).removeAttr('checked'); + } else { + $(".autoroute-cultures li:not(:first)").show(); + $("#content .items.default").show(); + $(this).attr('checked', 'checked'); + } + }); + + $(function () { + var browser = new AutorouteCultureBrowser($("#main")); + browser.initialize(); + + }); +})(jQuery); \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/AliasResolverSelector.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/AliasResolverSelector.cs index 6bf3c1048a9..b49cd16c296 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/AliasResolverSelector.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/AliasResolverSelector.cs @@ -29,7 +29,7 @@ private IEnumerable ResolveIdentity(ContentIdentity identity) { } return _contentManager - .Query() + .Query(VersionOptions.Latest) .Where(p => p.DisplayAlias == identifier) .List(); } diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/AutorouteService.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/AutorouteService.cs index 332c6be8752..e015e7c9140 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/AutorouteService.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/AutorouteService.cs @@ -3,13 +3,16 @@ using System.Linq; using System.Text.RegularExpressions; using Orchard.Alias; -using Orchard.Alias.Implementation.Storage; using Orchard.Autoroute.Models; using Orchard.Autoroute.Settings; using Orchard.ContentManagement; using Orchard.ContentManagement.MetaData; using Orchard.ContentManagement.MetaData.Models; using Orchard.Tokens; +using Orchard.Localization.Services; +using Orchard.Mvc; +using System.Web; +using Orchard.ContentManagement.Aspects; namespace Orchard.Autoroute.Services { public class AutorouteService : Component, IAutorouteService { @@ -19,7 +22,8 @@ public class AutorouteService : Component, IAutorouteService { private readonly IContentDefinitionManager _contentDefinitionManager; private readonly IContentManager _contentManager; private readonly IRouteEvents _routeEvents; - private readonly IAliasStorage _aliasStorage; + private readonly ICultureManager _cultureManager; + private readonly IHttpContextAccessor _httpContextAccessor; private const string AliasSource = "Autoroute:View"; public AutorouteService( @@ -28,14 +32,16 @@ public AutorouteService( IContentDefinitionManager contentDefinitionManager, IContentManager contentManager, IRouteEvents routeEvents, - IAliasStorage aliasStorage) { + ICultureManager cultureManager, + IHttpContextAccessor httpContextAccessor) { _aliasService = aliasService; _tokenizer = tokenizer; _contentDefinitionManager = contentDefinitionManager; _contentManager = contentManager; _routeEvents = routeEvents; - _aliasStorage = aliasStorage; + _cultureManager = cultureManager; + _httpContextAccessor = httpContextAccessor; } public string GenerateAlias(AutoroutePart part) { @@ -43,12 +49,33 @@ public string GenerateAlias(AutoroutePart part) { if (part == null) { throw new ArgumentNullException("part"); } + var settings = part.TypePartDefinition.Settings.GetModel(); + var itemCulture = _cultureManager.GetSiteCulture(); - var pattern = GetDefaultPattern(part.ContentItem.ContentType).Pattern; + // If we are editing an existing content item. + if (part.Record.Id != 0) { + ContentItem contentItem = _contentManager.Get(part.Record.ContentItemRecord.Id); + var aspect = contentItem.As(); - // String.Empty forces pattern based generation. "/" forces homepage. - if (part.UseCustomPattern - && (!String.IsNullOrWhiteSpace(part.CustomPattern) || String.Equals(part.CustomPattern, "/"))) { + if (aspect != null) { + itemCulture = aspect.Culture; + } + } + + if (settings.UseCulturePattern) { + // TODO: Refactor the below so that we don't need to know about Request.Form["Localization.SelectedCulture"]. + // If we are creating from a form post we use the form value for culture. + var context = _httpContextAccessor.Current(); + var selectedCulture = context.Request.Form["Localization.SelectedCulture"]; + if (!String.IsNullOrEmpty(selectedCulture)) { + itemCulture = selectedCulture; + } + } + + var pattern = GetDefaultPattern(part.ContentItem.ContentType, itemCulture).Pattern; + + // String.Empty forces pattern based generation. + if (part.UseCustomPattern && (!String.IsNullOrWhiteSpace(part.CustomPattern))) { pattern = part.CustomPattern; } @@ -65,7 +92,7 @@ public string GenerateAlias(AutoroutePart part) { public void PublishAlias(AutoroutePart part) { var displayRouteValues = _contentManager.GetItemMetadata(part).DisplayRouteValues; - _aliasService.Replace(part.DisplayAlias, displayRouteValues, AliasSource); + _aliasService.Replace(part.DisplayAlias, displayRouteValues, AliasSource, true); _routeEvents.Routed(part, part.DisplayAlias); } @@ -85,7 +112,8 @@ public void CreatePattern(string contentType, string name, string pattern, strin var routePattern = new RoutePattern { Description = description, Name = name, - Pattern = pattern + Pattern = pattern, + Culture = _cultureManager.GetSiteCulture() }; var patterns = settings.Patterns; @@ -94,7 +122,7 @@ public void CreatePattern(string contentType, string name, string pattern, strin // Define which pattern is the default. if (makeDefault || settings.Patterns.Count == 1) { - settings.DefaultPatternIndex = settings.Patterns.IndexOf(routePattern); + settings.DefaultPatterns = new List { new DefaultPattern { PatternIndex = "0", Culture = settings.Patterns[0].Culture } }; } _contentDefinitionManager.AlterTypeDefinition(contentType, builder => builder.WithPart("AutoroutePart", settings.Build)); @@ -105,35 +133,41 @@ public IEnumerable GetPatterns(string contentType) { return settings.Patterns; } - public RoutePattern GetDefaultPattern(string contentType) { + public RoutePattern GetDefaultPattern(string contentType, string culture) { var settings = GetTypePartSettings(contentType).GetModel(); + var defaultPattern = settings.DefaultPatterns.FirstOrDefault(x => x.Culture == culture); + var defaultPatternIndex = defaultPattern != null ? defaultPattern.PatternIndex : "0"; + + if (String.IsNullOrWhiteSpace(defaultPatternIndex)) + defaultPatternIndex = "0"; + + if (!settings.DefaultPatterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) { + var patternIndex = String.IsNullOrWhiteSpace(settings.DefaultPatternIndex) ? "0" : settings.DefaultPatternIndex; + // Lazy updating from old setting. + if (String.Equals(culture, _cultureManager.GetSiteCulture(), StringComparison.OrdinalIgnoreCase)) { + settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = patternIndex, Culture = culture }); + return settings.Patterns.Where(x => x.Culture == null).ElementAt(Convert.ToInt32(defaultPatternIndex)); + } + else { + settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = "0", Culture = culture }); + return new RoutePattern { Name = "Title", Description = "my-title", Pattern = "{Content.Slug}", Culture = culture }; + } + } - // Return a default pattern if none is defined. - if (settings.DefaultPatternIndex < settings.Patterns.Count) { - return settings.Patterns.ElementAt(settings.DefaultPatternIndex); + // Return a default pattern if set. + var patternCultureSearch = settings.Patterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase)) ? culture : null; + + if (settings.Patterns.Any()) { + if (settings.Patterns.Where(x => x.Culture == patternCultureSearch).ElementAt(Convert.ToInt32(defaultPatternIndex)) != null) { + return settings.Patterns.Where(x => x.Culture == patternCultureSearch).ElementAt(Convert.ToInt32(defaultPatternIndex)); + }; } - return new RoutePattern { Name = "Title", Description = "my-title", Pattern = "{Content.Slug}" }; + // Return a default pattern if none is defined. + return new RoutePattern { Name = "Title", Description = "my-title", Pattern = "{Content.Slug}", Culture = culture }; } public void RemoveAliases(AutoroutePart part) { - // https://github.com/OrchardCMS/Orchard/issues/5137 - // If the alias of the specified part is empty while not being the homepage, - // we need to make sure we are not removing all empty aliases in order to prevent losing the homepage content item being the homepage. - if (String.IsNullOrWhiteSpace(part.Path)) { - if (!IsHomePage(part)) { - // The item being removed is NOT the homepage, so we need to make sure we're not removing the alias for the homepage. - var aliasRecordId = GetHomePageAliasRecordId(); - - // Remove all aliases EXCEPT for the alias of the homepage. - _aliasStorage.Remove(x => x.Path == part.Path && x.Source == AliasSource && x.Id != aliasRecordId); - - // Done. - return; - } - } - - // Safe to delete all aliases for the specified part since it is definitely not the homepage. _aliasService.Delete(part.Path, AliasSource); } @@ -141,7 +175,7 @@ public string GenerateUniqueSlug(AutoroutePart part, IEnumerable existin if (existingPaths == null || !existingPaths.Contains(part.Path)) return part.Path; - int? version = existingPaths.Select(s => GetSlugVersion(part.Path, s)).OrderBy(i => i).LastOrDefault(); + var version = existingPaths.Select(s => GetSlugVersion(part.Path, s)).OrderBy(i => i).LastOrDefault(); return version != null ? String.Format("{0}-{1}", part.Path, version) @@ -178,16 +212,6 @@ public bool ProcessPath(AutoroutePart part) { return true; } - private bool IsHomePage(IContent content) { - var homePageRoute = _aliasService.Get(""); - var homePageId = homePageRoute.ContainsKey("id") ? XmlHelper.Parse((string)homePageRoute["id"]) : default(int?); - return content.Id == homePageId; - } - - private int GetHomePageAliasRecordId() { - return _aliasStorage.List(x => x.Path == "").First().Item5; - } - private SettingsDictionary GetTypePartSettings(string contentType) { var contentDefinition = _contentDefinitionManager.GetTypeDefinition(contentType); diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/DefaultSlugService.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/DefaultSlugService.cs index 25316c0b90e..59501255b56 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/DefaultSlugService.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/DefaultSlugService.cs @@ -1,9 +1,7 @@ -using Orchard.ContentManagement; -using System.Text.RegularExpressions; -using Orchard.Utility.Extensions; -using System; -using System.Text; +using System; using System.Globalization; +using System.Text; +using Orchard.ContentManagement; namespace Orchard.Autoroute.Services { @@ -86,6 +84,5 @@ private string Slugify(FillSlugContext slugContext) { public string Slugify(string text) { return Slugify(new FillSlugContext(null, text)); } - } } diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/HomeAliasService.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/HomeAliasService.cs new file mode 100644 index 00000000000..da86ac2bddf --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/HomeAliasService.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Routing; +using Orchard.Alias; +using Orchard.Alias.Implementation.Holder; +using Orchard.Autoroute.Models; +using Orchard.ContentManagement; + +namespace Orchard.Autoroute.Services { + public class HomeAliasService : IHomeAliasService { + private readonly IAliasService _aliasService; + private readonly IContentManager _contentManager; + private readonly IAliasHolder _aliasHolder; + private const string AliasSource = "Autoroute:Home"; + private const string HomeAlias = ""; + + private RouteValueDictionary _homeAliasRoute; + + public HomeAliasService(IAliasService aliasService, IAliasHolder aliasHolder, IContentManager contentManager) { + _aliasService = aliasService; + _aliasHolder = aliasHolder; + _contentManager = contentManager; + } + + public RouteValueDictionary GetHomeRoute() { + if(_homeAliasRoute == null) { + _homeAliasRoute = _aliasService.Get(HomeAlias); + } + + return _homeAliasRoute; + } + + public int? GetHomePageId(VersionOptions version = null) { + var homePage = GetHomePage(version); + return homePage != null ? homePage.Id : default(int?); + } + + public IContent GetHomePage(VersionOptions version = null) { + var homePageRoute = GetHomeRoute(); + + if (homePageRoute == null) + return null; + + var alias = LookupAlias(homePageRoute); + + if (alias == null) + return null; + + var homePage = _contentManager.Query(version).Where(x => x.DisplayAlias == alias).Slice(0, 1).FirstOrDefault(); + return homePage; + } + + public bool IsHomePage(IContent content, VersionOptions homePageVersion = null) { + var homePageId = GetHomePageId(homePageVersion); + return content.Id == homePageId; + } + + public void PublishHomeAlias(IContent content) { + var routeValues = _contentManager.GetItemMetadata(content).DisplayRouteValues; + PublishHomeAlias(routeValues); + } + + public void PublishHomeAlias(string route) { + _aliasService.DeleteBySource(AliasSource); + _aliasService.Set(HomeAlias, route, AliasSource); + } + + public void PublishHomeAlias(RouteValueDictionary route) { + _homeAliasRoute = route; + _aliasService.DeleteBySource(AliasSource); + _aliasService.Set(HomeAlias, route, AliasSource); + } + + private string LookupAlias(RouteValueDictionary routeValues) { + object area; + + if (!routeValues.TryGetValue("area", out area)) + return null; + + var map = _aliasHolder.GetMap(area.ToString()); + if (map == null) + return null; + + var alias = map.GetAliases().FirstOrDefault(x => IsSameRoute(x.RouteValues, routeValues) && !String.IsNullOrWhiteSpace(x.Path)); + return alias != null ? alias.Path : null; + } + + private bool IsSameRoute(IDictionary a, RouteValueDictionary b) { + if(a.Count != b.Count) { + return false; + } + + return a.Keys.All(x => String.Equals(a[x], b[x].ToString(), StringComparison.OrdinalIgnoreCase)); + } + } +} diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/IAutorouteService.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/IAutorouteService.cs index ddfbef2a2e6..7866b61428e 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/IAutorouteService.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/IAutorouteService.cs @@ -13,7 +13,7 @@ public interface IAutorouteService : IDependency { void PublishAlias(AutoroutePart part); void RemoveAliases(AutoroutePart part); void CreatePattern(string contentType, string name, string pattern, string description, bool makeDefault); - RoutePattern GetDefaultPattern(string contentType); + RoutePattern GetDefaultPattern(string contentType, string culture); IEnumerable GetPatterns(string contentType); bool ProcessPath(AutoroutePart part); bool IsPathValid(string slug); diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/IHomeAliasService.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/IHomeAliasService.cs new file mode 100644 index 00000000000..f85cd64fcdd --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/IHomeAliasService.cs @@ -0,0 +1,15 @@ +using System.Web.Routing; +using Orchard.ContentManagement; + +namespace Orchard.Autoroute.Services { + + public interface IHomeAliasService : IDependency { + RouteValueDictionary GetHomeRoute(); + int? GetHomePageId(VersionOptions version = null); + IContent GetHomePage(VersionOptions version = null); + bool IsHomePage(IContent content, VersionOptions homePageVersion = null); + void PublishHomeAlias(IContent content); + void PublishHomeAlias(string route); + void PublishHomeAlias(RouteValueDictionary route); + } +} diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/PathResolutionService.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/PathResolutionService.cs index afdf7e61b6e..91d33dabd6c 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Services/PathResolutionService.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Services/PathResolutionService.cs @@ -6,7 +6,7 @@ namespace Orchard.Autoroute.Services { public class PathResolutionService : IPathResolutionService { private readonly IContentManager _contentManager; - IRepository _autorouteRepository; + private readonly IRepository _autorouteRepository; public PathResolutionService( IRepository autorouteRepository, @@ -17,8 +17,7 @@ public PathResolutionService( public AutoroutePart GetPath(string path) { var autorouteRecord = _autorouteRepository.Table - .Where(part => part.DisplayAlias == path && part.ContentItemVersionRecord.Published) - .FirstOrDefault(); + .FirstOrDefault(part => part.DisplayAlias == path && part.ContentItemVersionRecord.Published); if (autorouteRecord == null) { return null; diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/AutorouteSettings.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/AutorouteSettings.cs index 0c86d3b6afd..75bc1a033de 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/AutorouteSettings.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/AutorouteSettings.cs @@ -1,8 +1,9 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; -using System.Web.Script.Serialization; using Orchard.ContentManagement.MetaData.Builders; +using Orchard.Services; +using System; namespace Orchard.Autoroute.Settings { @@ -12,45 +13,98 @@ namespace Orchard.Autoroute.Settings { public class AutorouteSettings { private List _patterns; + private List _defaultPatterns; public AutorouteSettings() { PerItemConfiguration = false; AllowCustomPattern = true; + UseCulturePattern = false; AutomaticAdjustmentOnEdit = false; PatternDefinitions = "[]"; + DefaultPatternDefinitions = "[]"; + DefaultPatternIndex = null; } public bool PerItemConfiguration { get; set; } public bool AllowCustomPattern { get; set; } + public bool UseCulturePattern { get; set; } public bool AutomaticAdjustmentOnEdit { get; set; } - public int DefaultPatternIndex { get; set; } + public bool? IsDefault { get; set; } + public List SiteCultures { get; set; } + public string DefaultSiteCulture { get; set; } + public string DefaultPatternIndex { get; set; } /// /// A serialized Json array of objects /// public string PatternDefinitions { get; set; } - + public List Patterns { get { if (_patterns == null) { - _patterns = new JavaScriptSerializer().Deserialize(PatternDefinitions).ToList(); + _patterns = new DefaultJsonConverter().Deserialize(PatternDefinitions).ToList(); } return _patterns; } - set { + set { _patterns = value; - PatternDefinitions = new JavaScriptSerializer().Serialize(_patterns.ToArray()); + PatternDefinitions = new DefaultJsonConverter().Serialize(_patterns.ToArray()); + } + } + + /// + /// A serialized Json array of objects + /// + public string DefaultPatternDefinitions { get; set; } + + public List DefaultPatterns { + get { + if (_defaultPatterns == null) { + _defaultPatterns = new DefaultJsonConverter().Deserialize(DefaultPatternDefinitions).ToList(); + } + + //We split the values from the radio button returned values + int i = 0; + foreach (DefaultPattern defaultPattern in _defaultPatterns) { + if (!String.IsNullOrWhiteSpace(defaultPattern.Culture)) { + if (defaultPattern.Culture.Split('|').Count() > 1) { + _defaultPatterns[i].PatternIndex = defaultPattern.Culture.Split('|').Last(); + _defaultPatterns[i].Culture = defaultPattern.Culture.Split('|').First(); + } + } + i++; + } + return _defaultPatterns; + } + + set { + _defaultPatterns = value; + + //We split the values from the radio button returned values + int i = 0; + foreach (DefaultPattern defaultPattern in _defaultPatterns) { + if (!String.IsNullOrWhiteSpace(defaultPattern.Culture)) { + if (defaultPattern.Culture.Split('|').Count() > 1) { + _defaultPatterns[i].PatternIndex = defaultPattern.Culture.Split('|').Last(); + _defaultPatterns[i].Culture = defaultPattern.Culture.Split('|').First(); + } + } + i++; + } + DefaultPatternDefinitions = new DefaultJsonConverter().Serialize(_defaultPatterns.ToArray()); } } public void Build(ContentTypePartDefinitionBuilder builder) { builder.WithSetting("AutorouteSettings.PerItemConfiguration", PerItemConfiguration.ToString(CultureInfo.InvariantCulture)); builder.WithSetting("AutorouteSettings.AllowCustomPattern", AllowCustomPattern.ToString(CultureInfo.InvariantCulture)); + builder.WithSetting("AutorouteSettings.UseCulturePattern", UseCulturePattern.ToString(CultureInfo.InvariantCulture)); builder.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", AutomaticAdjustmentOnEdit.ToString(CultureInfo.InvariantCulture)); builder.WithSetting("AutorouteSettings.PatternDefinitions", PatternDefinitions); - builder.WithSetting("AutorouteSettings.DefaultPatternIndex", DefaultPatternIndex.ToString(CultureInfo.InvariantCulture)); + builder.WithSetting("AutorouteSettings.DefaultPatternDefinitions", DefaultPatternDefinitions); + builder.WithSetting("AutorouteSettings.DefaultPatternIndex", DefaultPatternIndex); } } } diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/AutorouteSettingsEvents.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/AutorouteSettingsEvents.cs index f3345e5998b..fb15c691e6b 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/AutorouteSettingsEvents.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/AutorouteSettingsEvents.cs @@ -8,13 +8,16 @@ using Orchard.ContentManagement.ViewModels; using Orchard.Localization; using Orchard.UI.Notify; +using Orchard.Localization.Services; namespace Orchard.Autoroute.Settings { public class AutorouteSettingsHooks : ContentDefinitionEditorEventsBase { private readonly INotifier _notifier; + private readonly ICultureManager _cultureManager; - public AutorouteSettingsHooks(INotifier notifier) { + public AutorouteSettingsHooks(INotifier notifier, ICultureManager cultureManager) { _notifier = notifier; + _cultureManager = cultureManager; } public Localizer T { get; set; } @@ -25,8 +28,62 @@ public override IEnumerable TypePartEditor(ContentTypePartDef var settings = definition.Settings.GetModel(); - // add an empty pattern for the editor - settings.Patterns.Add(new RoutePattern()); + //get cultures + settings.SiteCultures = _cultureManager.ListCultures().ToList(); + //get default site culture + settings.DefaultSiteCulture = _cultureManager.GetSiteCulture(); + + //if a culture is not set on the pattern we set it to the default site culture for backward compatibility + if (!settings.Patterns.Any(x => String.Equals(x.Culture, settings.DefaultSiteCulture, StringComparison.OrdinalIgnoreCase))) { + foreach (RoutePattern pattern in settings.Patterns.Where(x => String.IsNullOrWhiteSpace(x.Culture))) { + settings.Patterns.Where(x => x.GetHashCode() == pattern.GetHashCode()).FirstOrDefault().Culture = settings.DefaultSiteCulture; + } + } + + //Adding Patterns for the UI + List newPatterns = new List(); + int current = 0; + foreach (string culture in settings.SiteCultures) { + foreach (RoutePattern routePattern in settings.Patterns.Where(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) { + if (settings.Patterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) { + newPatterns.Add(settings.Patterns[current]); + } else { + newPatterns.Add(new RoutePattern { + Name = "Title", + Description = "my-title", + Pattern = "{Content.Slug}", + Culture = settings.DefaultSiteCulture + }); + } + current++; + } + + //We add a pattern for each culture if there is none + if (!settings.Patterns.Where(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase)).Any()) { + newPatterns.Add(new RoutePattern { Culture = culture, Name = "Title", Description = "my-title", Pattern = "{Content.Slug}" }); + } + + //we add a new empty line for each culture + newPatterns.Add(new RoutePattern { Culture = culture, Name = null, Description = null, Pattern = null }); + + // if the content type has no defaultPattern for autoroute, then assign one + if (!settings.DefaultPatterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) { + //if we are in the default culture check the old setting + if (String.Equals(culture, _cultureManager.GetSiteCulture(), StringComparison.OrdinalIgnoreCase)) { + var defaultPatternIndex = settings.DefaultPatternIndex; + if (!String.IsNullOrWhiteSpace(defaultPatternIndex)) { + var patternIndex = defaultPatternIndex; + settings.DefaultPatterns.Add(new DefaultPattern { Culture = settings.DefaultSiteCulture, PatternIndex = patternIndex }); + } else { + settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = "0", Culture = culture }); + } + } else { + settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = "0", Culture = culture }); + } + } + } + + settings.Patterns = newPatterns; yield return DefinitionTemplate(settings); } @@ -39,31 +96,37 @@ public override IEnumerable TypePartEditorUpdate(ContentTypeP Patterns = new List() }; - if (updateModel.TryUpdateModel(settings, "AutorouteSettings", null, null)) { + //get cultures + settings.SiteCultures = _cultureManager.ListCultures().ToList(); - var defaultPattern = settings.Patterns[settings.DefaultPatternIndex]; + if (updateModel.TryUpdateModel(settings, "AutorouteSettings", null, null)) { + //TODO need to add validations client and/or server side here // remove empty patterns var patterns = settings.Patterns; patterns.RemoveAll(p => String.IsNullOrWhiteSpace(p.Name) && String.IsNullOrWhiteSpace(p.Pattern) && String.IsNullOrWhiteSpace(p.Description)); - if (patterns.Count == 0) { - patterns.Add(new RoutePattern { - Name = "Title", - Description = "my-title", - Pattern = "{Content.Slug}" - }); - - _notifier.Warning(T("A default pattern has been added to AutoroutePart")); + //If there is no default pattern for each culture we set default ones + List newPatterns = new List(); + int current = 0; + foreach (string culture in settings.SiteCultures) { + if (settings.Patterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) { + foreach (RoutePattern routePattern in settings.Patterns.Where(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) { + newPatterns.Add(settings.Patterns[current]); + current++; + } + } else { + newPatterns.Add(new RoutePattern { + Name = "Title", + Description = "my-title", + Pattern = "{Content.Slug}", + Culture = culture + }); + + _notifier.Warning(T("A default pattern has been added to AutoroutePart")); + } } - settings.Patterns = patterns; - // search for the pattern which was marked as default, and update its index - settings.DefaultPatternIndex = patterns.IndexOf(defaultPattern); - - // if a wrong pattern was selected and there is at least one pattern, default to first - if (settings.DefaultPatternIndex == -1 && settings.Patterns.Any()) { - settings.DefaultPatternIndex = 0; - } + settings.Patterns = newPatterns; // update the settings builder settings.Build(builder); diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/DefaultPattern.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/DefaultPattern.cs new file mode 100644 index 00000000000..81e55da0417 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/DefaultPattern.cs @@ -0,0 +1,10 @@ +namespace Orchard.Autoroute.Settings { + + /// + /// Models the Default Patterns you can choose from + /// + public class DefaultPattern { + public string Culture { get; set; } + public string PatternIndex { get; set; } + } +} diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/RoutePattern.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/RoutePattern.cs index 2de3a9e5fa2..b479d73b914 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/RoutePattern.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Settings/RoutePattern.cs @@ -7,5 +7,6 @@ public class RoutePattern { public string Name { get; set; } public string Pattern { get; set; } public string Description { get; set; } + public string Culture { get; set; } } } diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.Autoroute/Styles/Web.config index 3a5872f14a3..176fe49cd7a 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Styles/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Styles/Web.config @@ -1,12 +1,12 @@ - + - - - - - - + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Styles/orchard-autoroute-settings.css b/src/Orchard.Web/Modules/Orchard.Autoroute/Styles/orchard-autoroute-settings.css index 4de2eeaf06f..340fb462863 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Styles/orchard-autoroute-settings.css +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Styles/orchard-autoroute-settings.css @@ -18,6 +18,10 @@ text-align: right; } -.autoroute-settings-patterns tr td input { +.autoroute-settings-patterns, .autoroute-settings-patterns tr td input { width: 100%; } + +.autoroute-settings-patterns td, .autoroute-settings-patterns th { + padding:10px; +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/ViewModels/AutoroutePartEditViewModel.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/ViewModels/AutoroutePartEditViewModel.cs index f3e1d3f5a77..4f916fcacb5 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/ViewModels/AutoroutePartEditViewModel.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/ViewModels/AutoroutePartEditViewModel.cs @@ -1,4 +1,5 @@ using Orchard.Autoroute.Settings; +using System.Collections.Generic; namespace Orchard.Autoroute.ViewModels { @@ -8,5 +9,7 @@ public class AutoroutePartEditViewModel { public bool PromoteToHomePage { get; set; } public string CurrentUrl { get; set; } public string CustomPattern { get; set; } + public string CurrentCulture { get; set; } + public IEnumerable SiteCultures { get; set; } } } diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Views/DefinitionTemplates/AutorouteSettings.cshtml b/src/Orchard.Web/Modules/Orchard.Autoroute/Views/DefinitionTemplates/AutorouteSettings.cshtml index 20f659cd72c..b128b071d7b 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Views/DefinitionTemplates/AutorouteSettings.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Views/DefinitionTemplates/AutorouteSettings.cshtml @@ -2,16 +2,12 @@ @using Orchard.Utility.Extensions; @{ + Script.Require("AutorouteBrowser"); Style.Require("AutorouteSettings"); + int patternCount = 0; + int patternCultureCount = 0; } -@*
    -
    - @Html.CheckBoxFor(m => m.PerItemConfiguration) - - @T("Allow the user to change the pattern on each item") -
    -
    -*@
    +
    @Html.CheckBoxFor(m => m.AllowCustomPattern) @@ -25,30 +21,62 @@ @T("This option will cause the Url to automatically be regenerated when you edit existing content and publish it again, otherwise it will always keep the old route, or you have to perform bulk update in the Autoroute admin.")
    +@if (Model.SiteCultures.Count > 1) { +
    +
    + @Html.CheckBoxFor(m => m.UseCulturePattern, new { @class = "use-culture-pattern" }) + + @T("Allow to set pattern(s) for each culture. If left unchecked this means it will use the default website culture pattern(s).") +
    +
    +}
    - - - - - - - - - - - @for (int index = 0; index < Model.Patterns.Count; index++) { - - - - - - - +

    @T("Patterns") :

    + +
    +
    +
      + @{ + int i = 1; + string cssClass = ""; + } +
    • @Model.DefaultSiteCulture
    • + @foreach (var culture in Model.SiteCultures) { + if (culture != Model.DefaultSiteCulture) { + cssClass = i == Model.SiteCultures.Count - 1 ? "last" : "middle"; +
    • @culture
    • + i++; + } + } +
    +
    +
    + @foreach (var culture in Model.SiteCultures) { +
    +
    @T("Default")@T("Name")@T("Name of the pattern")@T("Pattern")@T("The definition of the pattern")@T("Description")@T("The description of the pattern, displayed in the editor") 
    @Html.RadioButtonFor(m => m.DefaultPatternIndex, index, new { @class = "radio" })@Html.TextBoxFor(m => m.Patterns[index].Name, new { @class = "text"})@Html.TextBoxFor(m => m.Patterns[index].Pattern, new { @class = "tokenized text" })@Html.TextBoxFor(m => m.Patterns[index].Description, new { @class = "text" }) 
    + + + + + + + + @for (int index = 0; index < Model.Patterns.Where(x => x.Culture == culture).Count(); index++) { + + + + + + + + if (Model.Patterns[patternCount].Pattern != null) { patternCultureCount++; } else { patternCultureCount = 0; } + patternCount++; + } + +
    @T("Default")@T("Name")@T("Name of the pattern")@T("Pattern")@T("The definition of the pattern")@T("Description")@T("The description of the pattern, displayed in the editor") 
    @Html.RadioButtonFor(m => m.DefaultPatterns[Model.SiteCultures.IndexOf(culture)].Culture, culture + "|" + patternCultureCount, patternCultureCount.ToString() == Model.DefaultPatterns[Model.SiteCultures.IndexOf(culture)].PatternIndex ? new { @checked = "checked" } : null)@Html.TextBoxFor(m => m.Patterns[patternCount].Name, new { @class = "text" })@Html.TextBoxFor(m => m.Patterns[patternCount].Pattern, new { @class = "tokenized text" })@Html.TextBoxFor(m => m.Patterns[patternCount].Description, new { @class = "text" })@Html.HiddenFor(m => m.Patterns[patternCount].Culture) 
    +
    } - - - - +
-@Display.TokenHint() \ No newline at end of file +@Display.TokenHint() diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Views/EditorTemplates/Parts.Autoroute.Edit.cshtml b/src/Orchard.Web/Modules/Orchard.Autoroute/Views/EditorTemplates/Parts.Autoroute.Edit.cshtml index 46c62843885..db6d9be356d 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Views/EditorTemplates/Parts.Autoroute.Edit.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Views/EditorTemplates/Parts.Autoroute.Edit.cshtml @@ -3,61 +3,64 @@ @using Orchard.Mvc.Extensions @model Orchard.Autoroute.ViewModels.AutoroutePartEditViewModel -@if(Model.Settings.DefaultPatternIndex == -1) { +@if (Model.Settings.Patterns.Where(x => x.Culture == Model.CurrentCulture).Count() == 0) {
@T("The current Content Type does not have a default Autoroute Pattern. Please edit the settings first.")
return; } @{ - var defaultPattern = Model.Settings.Patterns[Model.Settings.DefaultPatternIndex]; + var defaultPattern = Model.Settings.DefaultPatterns.Where(x => x.Culture == Model.CurrentCulture).FirstOrDefault(); + var pattern = Model.Settings.Patterns.Where(x => x.Culture == Model.CurrentCulture); + var urlPrefix = WorkContext.Resolve().RequestUrlPrefix; if (!String.IsNullOrWhiteSpace(urlPrefix)) { urlPrefix += "/"; } } -@if (!Model.IsHomePage) { - +@if (!Model.IsHomePage) { if (AuthorizedFor(Permissions.SetHomePage)) { -
- - @Html.EditorFor(m => m.PromoteToHomePage) - - - @T("Check to promote this content as the home page.") -
- } +
+ + @Html.CheckBoxFor(m => m.PromoteToHomePage) + + + @T("Check to promote this content as the home page.") +
+ } } else { - @T("This content is the current home page.") + @T("This content is the current home page") } diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Web.config b/src/Orchard.Web/Modules/Orchard.Autoroute/Web.config index aeb76478e96..91ff0037561 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Web.config @@ -1,35 +1,36 @@ - + - - -
-
+
+
- + - - - - - - - + + + + + + + - + - - - - - + + + + + + + + @@ -37,16 +38,20 @@ - - + + - - + + - - + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/packages.config b/src/Orchard.Web/Modules/Orchard.Autoroute/packages.config new file mode 100644 index 00000000000..6729ced4977 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/jquery.blockUI.js b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/jquery.blockUI.js deleted file mode 100644 index 72ca5a51ca9..00000000000 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/jquery.blockUI.js +++ /dev/null @@ -1,619 +0,0 @@ -/*! - * jQuery blockUI plugin - * Version 2.66.0-2013.10.09 - * Requires jQuery v1.7 or later - * - * Examples at: http://malsup.com/jquery/block/ - * Copyright (c) 2007-2013 M. Alsup - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - * Thanks to Amir-Hossein Sobhi for some excellent contributions! - */ - -;(function() { -/*jshint eqeqeq:false curly:false latedef:false */ -"use strict"; - - function setup($) { - $.fn._fadeIn = $.fn.fadeIn; - - var noOp = $.noop || function() {}; - - // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle - // confusing userAgent strings on Vista) - var msie = /MSIE/.test(navigator.userAgent); - var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent); - var mode = document.documentMode || 0; - var setExpr = $.isFunction( document.createElement('div').style.setExpression ); - - // global $ methods for blocking/unblocking the entire page - $.blockUI = function(opts) { install(window, opts); }; - $.unblockUI = function(opts) { remove(window, opts); }; - - // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl) - $.growlUI = function(title, message, timeout, onClose) { - var $m = $('
'); - if (title) $m.append('

'+title+'

'); - if (message) $m.append('

'+message+'

'); - if (timeout === undefined) timeout = 3000; - - // Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications - var callBlock = function(opts) { - opts = opts || {}; - - $.blockUI({ - message: $m, - fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700, - fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000, - timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout, - centerY: false, - showOverlay: false, - onUnblock: onClose, - css: $.blockUI.defaults.growlCSS - }); - }; - - callBlock(); - var nonmousedOpacity = $m.css('opacity'); - $m.mouseover(function() { - callBlock({ - fadeIn: 0, - timeout: 30000 - }); - - var displayBlock = $('.blockMsg'); - displayBlock.stop(); // cancel fadeout if it has started - displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency - }).mouseout(function() { - $('.blockMsg').fadeOut(1000); - }); - // End konapun additions - }; - - // plugin method for blocking element content - $.fn.block = function(opts) { - if ( this[0] === window ) { - $.blockUI( opts ); - return this; - } - var fullOpts = $.extend({}, $.blockUI.defaults, opts || {}); - this.each(function() { - var $el = $(this); - if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked')) - return; - $el.unblock({ fadeOut: 0 }); - }); - - return this.each(function() { - if ($.css(this,'position') == 'static') { - this.style.position = 'relative'; - $(this).data('blockUI.static', true); - } - this.style.zoom = 1; // force 'hasLayout' in ie - install(this, opts); - }); - }; - - // plugin method for unblocking element content - $.fn.unblock = function(opts) { - if ( this[0] === window ) { - $.unblockUI( opts ); - return this; - } - return this.each(function() { - remove(this, opts); - }); - }; - - $.blockUI.version = 2.66; // 2nd generation blocking at no extra cost! - - // override these in your code to change the default behavior and style - $.blockUI.defaults = { - // message displayed when blocking (use null for no message) - message: '

Please wait...

', - - title: null, // title string; only used when theme == true - draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded) - - theme: false, // set to true to use with jQuery UI themes - - // styles for the message when blocking; if you wish to disable - // these and use an external stylesheet then do this in your code: - // $.blockUI.defaults.css = {}; - css: { - padding: 0, - margin: 0, - width: '30%', - top: '40%', - left: '35%', - textAlign: 'center', - color: '#000', - border: '3px solid #aaa', - backgroundColor:'#fff', - cursor: 'wait' - }, - - // minimal style set used when themes are used - themedCSS: { - width: '30%', - top: '40%', - left: '35%' - }, - - // styles for the overlay - overlayCSS: { - backgroundColor: '#000', - opacity: 0.6, - cursor: 'wait' - }, - - // style to replace wait cursor before unblocking to correct issue - // of lingering wait cursor - cursorReset: 'default', - - // styles applied when using $.growlUI - growlCSS: { - width: '350px', - top: '10px', - left: '', - right: '10px', - border: 'none', - padding: '5px', - opacity: 0.6, - cursor: 'default', - color: '#fff', - backgroundColor: '#000', - '-webkit-border-radius':'10px', - '-moz-border-radius': '10px', - 'border-radius': '10px' - }, - - // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w - // (hat tip to Jorge H. N. de Vasconcelos) - /*jshint scripturl:true */ - iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank', - - // force usage of iframe in non-IE browsers (handy for blocking applets) - forceIframe: false, - - // z-index for the blocking overlay - baseZ: 1000, - - // set these to true to have the message automatically centered - centerX: true, // <-- only effects element blocking (page block controlled via css above) - centerY: true, - - // allow body element to be stetched in ie6; this makes blocking look better - // on "short" pages. disable if you wish to prevent changes to the body height - allowBodyStretch: true, - - // enable if you want key and mouse events to be disabled for content that is blocked - bindEvents: true, - - // be default blockUI will supress tab navigation from leaving blocking content - // (if bindEvents is true) - constrainTabKey: true, - - // fadeIn time in millis; set to 0 to disable fadeIn on block - fadeIn: 200, - - // fadeOut time in millis; set to 0 to disable fadeOut on unblock - fadeOut: 400, - - // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock - timeout: 0, - - // disable if you don't want to show the overlay - showOverlay: true, - - // if true, focus will be placed in the first available input field when - // page blocking - focusInput: true, - - // elements that can receive focus - focusableElements: ':input:enabled:visible', - - // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) - // no longer needed in 2012 - // applyPlatformOpacityRules: true, - - // callback method invoked when fadeIn has completed and blocking message is visible - onBlock: null, - - // callback method invoked when unblocking has completed; the callback is - // passed the element that has been unblocked (which is the window object for page - // blocks) and the options that were passed to the unblock call: - // onUnblock(element, options) - onUnblock: null, - - // callback method invoked when the overlay area is clicked. - // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used. - onOverlayClick: null, - - // don't ask; if you really must know: http://groups.google.com/requiredUploads/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493 - quirksmodeOffsetHack: 4, - - // class name of the message block - blockMsgClass: 'blockMsg', - - // if it is already blocked, then ignore it (don't unblock and reblock) - ignoreIfBlocked: false - }; - - // private data and functions follow... - - var pageBlock = null; - var pageBlockEls = []; - - function install(el, opts) { - var css, themedCSS; - var full = (el == window); - var msg = (opts && opts.message !== undefined ? opts.message : undefined); - opts = $.extend({}, $.blockUI.defaults, opts || {}); - - if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked')) - return; - - opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {}); - css = $.extend({}, $.blockUI.defaults.css, opts.css || {}); - if (opts.onOverlayClick) - opts.overlayCSS.cursor = 'pointer'; - - themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {}); - msg = msg === undefined ? opts.message : msg; - - // remove the current block (if there is one) - if (full && pageBlock) - remove(window, {fadeOut:0}); - - // if an existing element is being used as the blocking content then we capture - // its current place in the DOM (and current display style) so we can restore - // it when we unblock - if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) { - var node = msg.jquery ? msg[0] : msg; - var data = {}; - $(el).data('blockUI.history', data); - data.el = node; - data.parent = node.parentNode; - data.display = node.style.display; - data.position = node.style.position; - if (data.parent) - data.parent.removeChild(node); - } - - $(el).data('blockUI.onUnblock', opts.onUnblock); - var z = opts.baseZ; - - // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform; - // layer1 is the iframe layer which is used to supress bleed through of underlying content - // layer2 is the overlay layer which has opacity and a wait cursor (by default) - // layer3 is the message content that is displayed while blocking - var lyr1, lyr2, lyr3, s; - if (msie || opts.forceIframe) - lyr1 = $(''); - else - lyr1 = $(''); - - if (opts.theme) - lyr2 = $(''); - else - lyr2 = $(''); - - if (opts.theme && full) { - s = ''; - } - else if (opts.theme) { - s = ''; - } - else if (full) { - s = ''; - } - else { - s = ''; - } - lyr3 = $(s); - - // if we have a message, style it - if (msg) { - if (opts.theme) { - lyr3.css(themedCSS); - lyr3.addClass('ui-widget-content'); - } - else - lyr3.css(css); - } - - // style the overlay - if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/) - lyr2.css(opts.overlayCSS); - lyr2.css('position', full ? 'fixed' : 'absolute'); - - // make iframe layer transparent in IE - if (msie || opts.forceIframe) - lyr1.css('opacity',0.0); - - //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el); - var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el); - $.each(layers, function() { - this.appendTo($par); - }); - - if (opts.theme && opts.draggable && $.fn.draggable) { - lyr3.draggable({ - handle: '.ui-dialog-titlebar', - cancel: 'li' - }); - } - - // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling) - var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0); - if (ie6 || expr) { - // give body 100% height - if (full && opts.allowBodyStretch && $.support.boxModel) - $('html,body').css('height','100%'); - - // fix ie6 issue when blocked element has a border width - if ((ie6 || !$.support.boxModel) && !full) { - var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth'); - var fixT = t ? '(0 - '+t+')' : 0; - var fixL = l ? '(0 - '+l+')' : 0; - } - - // simulate fixed position - $.each(layers, function(i,o) { - var s = o[0].style; - s.position = 'absolute'; - if (i < 2) { - if (full) - s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"'); - else - s.setExpression('height','this.parentNode.offsetHeight + "px"'); - if (full) - s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'); - else - s.setExpression('width','this.parentNode.offsetWidth + "px"'); - if (fixL) s.setExpression('left', fixL); - if (fixT) s.setExpression('top', fixT); - } - else if (opts.centerY) { - if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); - s.marginTop = 0; - } - else if (!opts.centerY && full) { - var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0; - var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"'; - s.setExpression('top',expression); - } - }); - } - - // show the message - if (msg) { - if (opts.theme) - lyr3.find('.ui-widget-content').append(msg); - else - lyr3.append(msg); - if (msg.jquery || msg.nodeType) - $(msg).show(); - } - - if ((msie || opts.forceIframe) && opts.showOverlay) - lyr1.show(); // opacity is zero - if (opts.fadeIn) { - var cb = opts.onBlock ? opts.onBlock : noOp; - var cb1 = (opts.showOverlay && !msg) ? cb : noOp; - var cb2 = msg ? cb : noOp; - if (opts.showOverlay) - lyr2._fadeIn(opts.fadeIn, cb1); - if (msg) - lyr3._fadeIn(opts.fadeIn, cb2); - } - else { - if (opts.showOverlay) - lyr2.show(); - if (msg) - lyr3.show(); - if (opts.onBlock) - opts.onBlock(); - } - - // bind key and mouse events - bind(1, el, opts); - - if (full) { - pageBlock = lyr3[0]; - pageBlockEls = $(opts.focusableElements,pageBlock); - if (opts.focusInput) - setTimeout(focus, 20); - } - else - center(lyr3[0], opts.centerX, opts.centerY); - - if (opts.timeout) { - // auto-unblock - var to = setTimeout(function() { - if (full) - $.unblockUI(opts); - else - $(el).unblock(opts); - }, opts.timeout); - $(el).data('blockUI.timeout', to); - } - } - - // remove the block - function remove(el, opts) { - var count; - var full = (el == window); - var $el = $(el); - var data = $el.data('blockUI.history'); - var to = $el.data('blockUI.timeout'); - if (to) { - clearTimeout(to); - $el.removeData('blockUI.timeout'); - } - opts = $.extend({}, $.blockUI.defaults, opts || {}); - bind(0, el, opts); // unbind events - - if (opts.onUnblock === null) { - opts.onUnblock = $el.data('blockUI.onUnblock'); - $el.removeData('blockUI.onUnblock'); - } - - var els; - if (full) // crazy selector to handle odd field errors in ie6/7 - els = $('body').children().filter('.blockUI').add('body > .blockUI'); - else - els = $el.find('>.blockUI'); - - // fix cursor issue - if ( opts.cursorReset ) { - if ( els.length > 1 ) - els[1].style.cursor = opts.cursorReset; - if ( els.length > 2 ) - els[2].style.cursor = opts.cursorReset; - } - - if (full) - pageBlock = pageBlockEls = null; - - if (opts.fadeOut) { - count = els.length; - els.stop().fadeOut(opts.fadeOut, function() { - if ( --count === 0) - reset(els,data,opts,el); - }); - } - else - reset(els, data, opts, el); - } - - // move blocking element back into the DOM where it started - function reset(els,data,opts,el) { - var $el = $(el); - if ( $el.data('blockUI.isBlocked') ) - return; - - els.each(function(i,o) { - // remove via DOM calls so we don't lose event handlers - if (this.parentNode) - this.parentNode.removeChild(this); - }); - - if (data && data.el) { - data.el.style.display = data.display; - data.el.style.position = data.position; - if (data.parent) - data.parent.appendChild(data.el); - $el.removeData('blockUI.history'); - } - - if ($el.data('blockUI.static')) { - $el.css('position', 'static'); // #22 - } - - if (typeof opts.onUnblock == 'function') - opts.onUnblock(el,opts); - - // fix issue in Safari 6 where block artifacts remain until reflow - var body = $(document.body), w = body.width(), cssW = body[0].style.width; - body.width(w-1).width(w); - body[0].style.width = cssW; - } - - // bind/unbind the handler - function bind(b, el, opts) { - var full = el == window, $el = $(el); - - // don't bother unbinding if there is nothing to unbind - if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) - return; - - $el.data('blockUI.isBlocked', b); - - // don't bind events when overlay is not in use or if bindEvents is false - if (!full || !opts.bindEvents || (b && !opts.showOverlay)) - return; - - // bind anchors and inputs for mouse and key events - var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove'; - if (b) - $(document).bind(events, opts, handler); - else - $(document).unbind(events, handler); - - // former impl... - // var $e = $('a,:input'); - // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler); - } - - // event handler to suppress keyboard/mouse events when blocking - function handler(e) { - // allow tab navigation (conditionally) - if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) { - if (pageBlock && e.data.constrainTabKey) { - var els = pageBlockEls; - var fwd = !e.shiftKey && e.target === els[els.length-1]; - var back = e.shiftKey && e.target === els[0]; - if (fwd || back) { - setTimeout(function(){focus(back);},10); - return false; - } - } - } - var opts = e.data; - var target = $(e.target); - if (target.hasClass('blockOverlay') && opts.onOverlayClick) - opts.onOverlayClick(e); - - // allow events within the message content - if (target.parents('div.' + opts.blockMsgClass).length > 0) - return true; - - // allow events for content that is not being blocked - return target.parents().children().filter('div.blockUI').length === 0; - } - - function focus(back) { - if (!pageBlockEls) - return; - var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0]; - if (e) - e.focus(); - } - - function center(el, x, y) { - var p = el.parentNode, s = el.style; - var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth'); - var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth'); - if (x) s.left = l > 0 ? (l+'px') : '0'; - if (y) s.top = t > 0 ? (t+'px') : '0'; - } - - function sz(el, p) { - return parseInt($.css(el,p),10)||0; - } - - } - - - /*global define:true */ - if (typeof define === 'function' && define.amd && define.amd.jQuery) { - define(['jquery'], setup); - } else { - setup(jQuery); - } - -})(); diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/moment.js b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/moment.js deleted file mode 100644 index 0018faebf9f..00000000000 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/moment.js +++ /dev/null @@ -1,2428 +0,0 @@ -//! moment.js -//! version : 2.5.1 -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! momentjs.com - -(function (undefined) { - - /************************************ - Constants - ************************************/ - - var moment, - VERSION = "2.5.1", - global = this, - round = Math.round, - i, - - YEAR = 0, - MONTH = 1, - DATE = 2, - HOUR = 3, - MINUTE = 4, - SECOND = 5, - MILLISECOND = 6, - - // internal storage for language config files - languages = {}, - - // moment internal properties - momentProperties = { - _isAMomentObject: null, - _i : null, - _f : null, - _l : null, - _strict : null, - _isUTC : null, - _offset : null, // optional. Combine with _isUTC - _pf : null, - _lang : null // optional - }, - - // check for nodeJS - hasModule = (typeof module !== 'undefined' && module.exports && typeof require !== 'undefined'), - - // ASP.NET json date format regex - aspNetJsonRegex = /^\/?Date\((\-?\d+)/i, - aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, - - // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html - // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/, - - // format tokens - formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g, - localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g, - - // parsing token regexes - parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 - parseTokenOneToThreeDigits = /\d{1,3}/, // 0 - 999 - parseTokenOneToFourDigits = /\d{1,4}/, // 0 - 9999 - parseTokenOneToSixDigits = /[+\-]?\d{1,6}/, // -999,999 - 999,999 - parseTokenDigits = /\d+/, // nonzero number of digits - parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic. - parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z - parseTokenT = /T/i, // T (ISO separator) - parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 - parseTokenOrdinal = /\d{1,2}/, - - //strict parsing regexes - parseTokenOneDigit = /\d/, // 0 - 9 - parseTokenTwoDigits = /\d\d/, // 00 - 99 - parseTokenThreeDigits = /\d{3}/, // 000 - 999 - parseTokenFourDigits = /\d{4}/, // 0000 - 9999 - parseTokenSixDigits = /[+-]?\d{6}/, // -999,999 - 999,999 - parseTokenSignedNumber = /[+-]?\d+/, // -inf - inf - - // iso 8601 regex - // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) - isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, - - isoFormat = 'YYYY-MM-DDTHH:mm:ssZ', - - isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], - ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], - ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], - ['GGGG-[W]WW', /\d{4}-W\d{2}/], - ['YYYY-DDD', /\d{4}-\d{3}/] - ], - - // iso time formats and regexes - isoTimes = [ - ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d{1,3}/], - ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], - ['HH:mm', /(T| )\d\d:\d\d/], - ['HH', /(T| )\d\d/] - ], - - // timezone chunker "+10:00" > ["10", "00"] or "-1530" > ["-15", "30"] - parseTimezoneChunker = /([\+\-]|\d\d)/gi, - - // getter and setter names - proxyGettersAndSetters = 'Date|Hours|Minutes|Seconds|Milliseconds'.split('|'), - unitMillisecondFactors = { - 'Milliseconds' : 1, - 'Seconds' : 1e3, - 'Minutes' : 6e4, - 'Hours' : 36e5, - 'Days' : 864e5, - 'Months' : 2592e6, - 'Years' : 31536e6 - }, - - unitAliases = { - ms : 'millisecond', - s : 'second', - m : 'minute', - h : 'hour', - d : 'day', - D : 'date', - w : 'week', - W : 'isoWeek', - M : 'month', - y : 'year', - DDD : 'dayOfYear', - e : 'weekday', - E : 'isoWeekday', - gg: 'weekYear', - GG: 'isoWeekYear' - }, - - camelFunctions = { - dayofyear : 'dayOfYear', - isoweekday : 'isoWeekday', - isoweek : 'isoWeek', - weekyear : 'weekYear', - isoweekyear : 'isoWeekYear' - }, - - // format function strings - formatFunctions = {}, - - // tokens to ordinalize and pad - ordinalizeTokens = 'DDD w W M D d'.split(' '), - paddedTokens = 'M D H h m s w W'.split(' '), - - formatTokenFunctions = { - M : function () { - return this.month() + 1; - }, - MMM : function (format) { - return this.lang().monthsShort(this, format); - }, - MMMM : function (format) { - return this.lang().months(this, format); - }, - D : function () { - return this.date(); - }, - DDD : function () { - return this.dayOfYear(); - }, - d : function () { - return this.day(); - }, - dd : function (format) { - return this.lang().weekdaysMin(this, format); - }, - ddd : function (format) { - return this.lang().weekdaysShort(this, format); - }, - dddd : function (format) { - return this.lang().weekdays(this, format); - }, - w : function () { - return this.week(); - }, - W : function () { - return this.isoWeek(); - }, - YY : function () { - return leftZeroFill(this.year() % 100, 2); - }, - YYYY : function () { - return leftZeroFill(this.year(), 4); - }, - YYYYY : function () { - return leftZeroFill(this.year(), 5); - }, - YYYYYY : function () { - var y = this.year(), sign = y >= 0 ? '+' : '-'; - return sign + leftZeroFill(Math.abs(y), 6); - }, - gg : function () { - return leftZeroFill(this.weekYear() % 100, 2); - }, - gggg : function () { - return leftZeroFill(this.weekYear(), 4); - }, - ggggg : function () { - return leftZeroFill(this.weekYear(), 5); - }, - GG : function () { - return leftZeroFill(this.isoWeekYear() % 100, 2); - }, - GGGG : function () { - return leftZeroFill(this.isoWeekYear(), 4); - }, - GGGGG : function () { - return leftZeroFill(this.isoWeekYear(), 5); - }, - e : function () { - return this.weekday(); - }, - E : function () { - return this.isoWeekday(); - }, - a : function () { - return this.lang().meridiem(this.hours(), this.minutes(), true); - }, - A : function () { - return this.lang().meridiem(this.hours(), this.minutes(), false); - }, - H : function () { - return this.hours(); - }, - h : function () { - return this.hours() % 12 || 12; - }, - m : function () { - return this.minutes(); - }, - s : function () { - return this.seconds(); - }, - S : function () { - return toInt(this.milliseconds() / 100); - }, - SS : function () { - return leftZeroFill(toInt(this.milliseconds() / 10), 2); - }, - SSS : function () { - return leftZeroFill(this.milliseconds(), 3); - }, - SSSS : function () { - return leftZeroFill(this.milliseconds(), 3); - }, - Z : function () { - var a = -this.zone(), - b = "+"; - if (a < 0) { - a = -a; - b = "-"; - } - return b + leftZeroFill(toInt(a / 60), 2) + ":" + leftZeroFill(toInt(a) % 60, 2); - }, - ZZ : function () { - var a = -this.zone(), - b = "+"; - if (a < 0) { - a = -a; - b = "-"; - } - return b + leftZeroFill(toInt(a / 60), 2) + leftZeroFill(toInt(a) % 60, 2); - }, - z : function () { - return this.zoneAbbr(); - }, - zz : function () { - return this.zoneName(); - }, - X : function () { - return this.unix(); - }, - Q : function () { - return this.quarter(); - } - }, - - lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin']; - - function defaultParsingFlags() { - // We need to deep clone this object, and es5 standard is not very - // helpful. - return { - empty : false, - unusedTokens : [], - unusedInput : [], - overflow : -2, - charsLeftOver : 0, - nullInput : false, - invalidMonth : null, - invalidFormat : false, - userInvalidated : false, - iso: false - }; - } - - function padToken(func, count) { - return function (a) { - return leftZeroFill(func.call(this, a), count); - }; - } - function ordinalizeToken(func, period) { - return function (a) { - return this.lang().ordinal(func.call(this, a), period); - }; - } - - while (ordinalizeTokens.length) { - i = ordinalizeTokens.pop(); - formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i], i); - } - while (paddedTokens.length) { - i = paddedTokens.pop(); - formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2); - } - formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3); - - - /************************************ - Constructors - ************************************/ - - function Language() { - - } - - // Moment prototype object - function Moment(config) { - checkOverflow(config); - extend(this, config); - } - - // Duration Constructor - function Duration(duration) { - var normalizedInput = normalizeObjectUnits(duration), - years = normalizedInput.year || 0, - months = normalizedInput.month || 0, - weeks = normalizedInput.week || 0, - days = normalizedInput.day || 0, - hours = normalizedInput.hour || 0, - minutes = normalizedInput.minute || 0, - seconds = normalizedInput.second || 0, - milliseconds = normalizedInput.millisecond || 0; - - // representation for dateAddRemove - this._milliseconds = +milliseconds + - seconds * 1e3 + // 1000 - minutes * 6e4 + // 1000 * 60 - hours * 36e5; // 1000 * 60 * 60 - // Because of dateAddRemove treats 24 hours as different from a - // day when working around DST, we need to store them separately - this._days = +days + - weeks * 7; - // It is impossible translate months into days without knowing - // which months you are are talking about, so we have to store - // it separately. - this._months = +months + - years * 12; - - this._data = {}; - - this._bubble(); - } - - /************************************ - Helpers - ************************************/ - - - function extend(a, b) { - for (var i in b) { - if (b.hasOwnProperty(i)) { - a[i] = b[i]; - } - } - - if (b.hasOwnProperty("toString")) { - a.toString = b.toString; - } - - if (b.hasOwnProperty("valueOf")) { - a.valueOf = b.valueOf; - } - - return a; - } - - function cloneMoment(m) { - var result = {}, i; - for (i in m) { - if (m.hasOwnProperty(i) && momentProperties.hasOwnProperty(i)) { - result[i] = m[i]; - } - } - - return result; - } - - function absRound(number) { - if (number < 0) { - return Math.ceil(number); - } else { - return Math.floor(number); - } - } - - // left zero fill a number - // see http://jsperf.com/left-zero-filling for performance comparison - function leftZeroFill(number, targetLength, forceSign) { - var output = '' + Math.abs(number), - sign = number >= 0; - - while (output.length < targetLength) { - output = '0' + output; - } - return (sign ? (forceSign ? '+' : '') : '-') + output; - } - - // helper function for _.addTime and _.subtractTime - function addOrSubtractDurationFromMoment(mom, duration, isAdding, ignoreUpdateOffset) { - var milliseconds = duration._milliseconds, - days = duration._days, - months = duration._months, - minutes, - hours; - - if (milliseconds) { - mom._d.setTime(+mom._d + milliseconds * isAdding); - } - // store the minutes and hours so we can restore them - if (days || months) { - minutes = mom.minute(); - hours = mom.hour(); - } - if (days) { - mom.date(mom.date() + days * isAdding); - } - if (months) { - mom.month(mom.month() + months * isAdding); - } - if (milliseconds && !ignoreUpdateOffset) { - moment.updateOffset(mom, days || months); - } - // restore the minutes and hours after possibly changing dst - if (days || months) { - mom.minute(minutes); - mom.hour(hours); - } - } - - // check if is an array - function isArray(input) { - return Object.prototype.toString.call(input) === '[object Array]'; - } - - function isDate(input) { - return Object.prototype.toString.call(input) === '[object Date]' || - input instanceof Date; - } - - // compare two arrays, return the number of differences - function compareArrays(array1, array2, dontConvert) { - var len = Math.min(array1.length, array2.length), - lengthDiff = Math.abs(array1.length - array2.length), - diffs = 0, - i; - for (i = 0; i < len; i++) { - if ((dontConvert && array1[i] !== array2[i]) || - (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { - diffs++; - } - } - return diffs + lengthDiff; - } - - function normalizeUnits(units) { - if (units) { - var lowered = units.toLowerCase().replace(/(.)s$/, '$1'); - units = unitAliases[units] || camelFunctions[lowered] || lowered; - } - return units; - } - - function normalizeObjectUnits(inputObject) { - var normalizedInput = {}, - normalizedProp, - prop; - - for (prop in inputObject) { - if (inputObject.hasOwnProperty(prop)) { - normalizedProp = normalizeUnits(prop); - if (normalizedProp) { - normalizedInput[normalizedProp] = inputObject[prop]; - } - } - } - - return normalizedInput; - } - - function makeList(field) { - var count, setter; - - if (field.indexOf('week') === 0) { - count = 7; - setter = 'day'; - } - else if (field.indexOf('month') === 0) { - count = 12; - setter = 'month'; - } - else { - return; - } - - moment[field] = function (format, index) { - var i, getter, - method = moment.fn._lang[field], - results = []; - - if (typeof format === 'number') { - index = format; - format = undefined; - } - - getter = function (i) { - var m = moment().utc().set(setter, i); - return method.call(moment.fn._lang, m, format || ''); - }; - - if (index != null) { - return getter(index); - } - else { - for (i = 0; i < count; i++) { - results.push(getter(i)); - } - return results; - } - }; - } - - function toInt(argumentForCoercion) { - var coercedNumber = +argumentForCoercion, - value = 0; - - if (coercedNumber !== 0 && isFinite(coercedNumber)) { - if (coercedNumber >= 0) { - value = Math.floor(coercedNumber); - } else { - value = Math.ceil(coercedNumber); - } - } - - return value; - } - - function daysInMonth(year, month) { - return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); - } - - function weeksInYear(year, dow, doy) { - return weekOfYear(moment([year, 11, 31 + dow - doy]), dow, doy).week; - } - - function daysInYear(year) { - return isLeapYear(year) ? 366 : 365; - } - - function isLeapYear(year) { - return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; - } - - function checkOverflow(m) { - var overflow; - if (m._a && m._pf.overflow === -2) { - overflow = - m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH : - m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE : - m._a[HOUR] < 0 || m._a[HOUR] > 23 ? HOUR : - m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE : - m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND : - m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND : - -1; - - if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { - overflow = DATE; - } - - m._pf.overflow = overflow; - } - } - - function isValid(m) { - if (m._isValid == null) { - m._isValid = !isNaN(m._d.getTime()) && - m._pf.overflow < 0 && - !m._pf.empty && - !m._pf.invalidMonth && - !m._pf.nullInput && - !m._pf.invalidFormat && - !m._pf.userInvalidated; - - if (m._strict) { - m._isValid = m._isValid && - m._pf.charsLeftOver === 0 && - m._pf.unusedTokens.length === 0; - } - } - return m._isValid; - } - - function normalizeLanguage(key) { - return key ? key.toLowerCase().replace('_', '-') : key; - } - - // Return a moment from input, that is local/utc/zone equivalent to model. - function makeAs(input, model) { - return model._isUTC ? moment(input).zone(model._offset || 0) : - moment(input).local(); - } - - /************************************ - Languages - ************************************/ - - - extend(Language.prototype, { - - set : function (config) { - var prop, i; - for (i in config) { - prop = config[i]; - if (typeof prop === 'function') { - this[i] = prop; - } else { - this['_' + i] = prop; - } - } - }, - - _months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), - months : function (m) { - return this._months[m.month()]; - }, - - _monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), - monthsShort : function (m) { - return this._monthsShort[m.month()]; - }, - - monthsParse : function (monthName) { - var i, mom, regex; - - if (!this._monthsParse) { - this._monthsParse = []; - } - - for (i = 0; i < 12; i++) { - // make the regex if we don't have it already - if (!this._monthsParse[i]) { - mom = moment.utc([2000, i]); - regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); - this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (this._monthsParse[i].test(monthName)) { - return i; - } - } - }, - - _weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), - weekdays : function (m) { - return this._weekdays[m.day()]; - }, - - _weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), - weekdaysShort : function (m) { - return this._weekdaysShort[m.day()]; - }, - - _weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), - weekdaysMin : function (m) { - return this._weekdaysMin[m.day()]; - }, - - weekdaysParse : function (weekdayName) { - var i, mom, regex; - - if (!this._weekdaysParse) { - this._weekdaysParse = []; - } - - for (i = 0; i < 7; i++) { - // make the regex if we don't have it already - if (!this._weekdaysParse[i]) { - mom = moment([2000, 1]).day(i); - regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); - this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); - } - // test the regex - if (this._weekdaysParse[i].test(weekdayName)) { - return i; - } - } - }, - - _longDateFormat : { - LT : "h:mm A", - L : "MM/DD/YYYY", - LL : "MMMM D YYYY", - LLL : "MMMM D YYYY LT", - LLLL : "dddd, MMMM D YYYY LT" - }, - longDateFormat : function (key) { - var output = this._longDateFormat[key]; - if (!output && this._longDateFormat[key.toUpperCase()]) { - output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (val) { - return val.slice(1); - }); - this._longDateFormat[key] = output; - } - return output; - }, - - isPM : function (input) { - // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays - // Using charAt should be more compatible. - return ((input + '').toLowerCase().charAt(0) === 'p'); - }, - - _meridiemParse : /[ap]\.?m?\.?/i, - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'pm' : 'PM'; - } else { - return isLower ? 'am' : 'AM'; - } - }, - - _calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - calendar : function (key, mom) { - var output = this._calendar[key]; - return typeof output === 'function' ? output.apply(mom) : output; - }, - - _relativeTime : { - future : "in %s", - past : "%s ago", - s : "a few seconds", - m : "a minute", - mm : "%d minutes", - h : "an hour", - hh : "%d hours", - d : "a day", - dd : "%d days", - M : "a month", - MM : "%d months", - y : "a year", - yy : "%d years" - }, - relativeTime : function (number, withoutSuffix, string, isFuture) { - var output = this._relativeTime[string]; - return (typeof output === 'function') ? - output(number, withoutSuffix, string, isFuture) : - output.replace(/%d/i, number); - }, - pastFuture : function (diff, output) { - var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); - }, - - ordinal : function (number) { - return this._ordinal.replace("%d", number); - }, - _ordinal : "%d", - - preparse : function (string) { - return string; - }, - - postformat : function (string) { - return string; - }, - - week : function (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - }, - - _week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - }, - - _invalidDate: 'Invalid date', - invalidDate: function () { - return this._invalidDate; - } - }); - - // Loads a language definition into the `languages` cache. The function - // takes a key and optionally values. If not in the browser and no values - // are provided, it will load the language file module. As a convenience, - // this function also returns the language values. - function loadLang(key, values) { - values.abbr = key; - if (!languages[key]) { - languages[key] = new Language(); - } - languages[key].set(values); - return languages[key]; - } - - // Remove a language from the `languages` cache. Mostly useful in tests. - function unloadLang(key) { - delete languages[key]; - } - - // Determines which language definition to use and returns it. - // - // With no parameters, it will return the global language. If you - // pass in a language key, such as 'en', it will return the - // definition for 'en', so long as 'en' has already been loaded using - // moment.lang. - function getLangDefinition(key) { - var i = 0, j, lang, next, split, - get = function (k) { - if (!languages[k] && hasModule) { - try { - require('./lang/' + k); - } catch (e) { } - } - return languages[k]; - }; - - if (!key) { - return moment.fn._lang; - } - - if (!isArray(key)) { - //short-circuit everything else - lang = get(key); - if (lang) { - return lang; - } - key = [key]; - } - - //pick the language from the array - //try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each - //substring from most specific to least, but move to the next array item if it's a more specific variant than the current root - while (i < key.length) { - split = normalizeLanguage(key[i]).split('-'); - j = split.length; - next = normalizeLanguage(key[i + 1]); - next = next ? next.split('-') : null; - while (j > 0) { - lang = get(split.slice(0, j).join('-')); - if (lang) { - return lang; - } - if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { - //the next array item is better than a shallower substring of this one - break; - } - j--; - } - i++; - } - return moment.fn._lang; - } - - /************************************ - Formatting - ************************************/ - - - function removeFormattingTokens(input) { - if (input.match(/\[[\s\S]/)) { - return input.replace(/^\[|\]$/g, ""); - } - return input.replace(/\\/g, ""); - } - - function makeFormatFunction(format) { - var array = format.match(formattingTokens), i, length; - - for (i = 0, length = array.length; i < length; i++) { - if (formatTokenFunctions[array[i]]) { - array[i] = formatTokenFunctions[array[i]]; - } else { - array[i] = removeFormattingTokens(array[i]); - } - } - - return function (mom) { - var output = ""; - for (i = 0; i < length; i++) { - output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; - } - return output; - }; - } - - // format date using native date object - function formatMoment(m, format) { - - if (!m.isValid()) { - return m.lang().invalidDate(); - } - - format = expandFormat(format, m.lang()); - - if (!formatFunctions[format]) { - formatFunctions[format] = makeFormatFunction(format); - } - - return formatFunctions[format](m); - } - - function expandFormat(format, lang) { - var i = 5; - - function replaceLongDateFormatTokens(input) { - return lang.longDateFormat(input) || input; - } - - localFormattingTokens.lastIndex = 0; - while (i >= 0 && localFormattingTokens.test(format)) { - format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); - localFormattingTokens.lastIndex = 0; - i -= 1; - } - - return format; - } - - - /************************************ - Parsing - ************************************/ - - - // get the regex to find the next token - function getParseRegexForToken(token, config) { - var a, strict = config._strict; - switch (token) { - case 'DDDD': - return parseTokenThreeDigits; - case 'YYYY': - case 'GGGG': - case 'gggg': - return strict ? parseTokenFourDigits : parseTokenOneToFourDigits; - case 'Y': - case 'G': - case 'g': - return parseTokenSignedNumber; - case 'YYYYYY': - case 'YYYYY': - case 'GGGGG': - case 'ggggg': - return strict ? parseTokenSixDigits : parseTokenOneToSixDigits; - case 'S': - if (strict) { return parseTokenOneDigit; } - /* falls through */ - case 'SS': - if (strict) { return parseTokenTwoDigits; } - /* falls through */ - case 'SSS': - if (strict) { return parseTokenThreeDigits; } - /* falls through */ - case 'DDD': - return parseTokenOneToThreeDigits; - case 'MMM': - case 'MMMM': - case 'dd': - case 'ddd': - case 'dddd': - return parseTokenWord; - case 'a': - case 'A': - return getLangDefinition(config._l)._meridiemParse; - case 'X': - return parseTokenTimestampMs; - case 'Z': - case 'ZZ': - return parseTokenTimezone; - case 'T': - return parseTokenT; - case 'SSSS': - return parseTokenDigits; - case 'MM': - case 'DD': - case 'YY': - case 'GG': - case 'gg': - case 'HH': - case 'hh': - case 'mm': - case 'ss': - case 'ww': - case 'WW': - return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits; - case 'M': - case 'D': - case 'd': - case 'H': - case 'h': - case 'm': - case 's': - case 'w': - case 'W': - case 'e': - case 'E': - return parseTokenOneOrTwoDigits; - case 'Do': - return parseTokenOrdinal; - default : - a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\', '')), "i")); - return a; - } - } - - function timezoneMinutesFromString(string) { - string = string || ""; - var possibleTzMatches = (string.match(parseTokenTimezone) || []), - tzChunk = possibleTzMatches[possibleTzMatches.length - 1] || [], - parts = (tzChunk + '').match(parseTimezoneChunker) || ['-', 0, 0], - minutes = +(parts[1] * 60) + toInt(parts[2]); - - return parts[0] === '+' ? -minutes : minutes; - } - - // function to convert string input to date - function addTimeToArrayFromToken(token, input, config) { - var a, datePartArray = config._a; - - switch (token) { - // MONTH - case 'M' : // fall through to MM - case 'MM' : - if (input != null) { - datePartArray[MONTH] = toInt(input) - 1; - } - break; - case 'MMM' : // fall through to MMMM - case 'MMMM' : - a = getLangDefinition(config._l).monthsParse(input); - // if we didn't find a month name, mark the date as invalid. - if (a != null) { - datePartArray[MONTH] = a; - } else { - config._pf.invalidMonth = input; - } - break; - // DAY OF MONTH - case 'D' : // fall through to DD - case 'DD' : - if (input != null) { - datePartArray[DATE] = toInt(input); - } - break; - case 'Do' : - if (input != null) { - datePartArray[DATE] = toInt(parseInt(input, 10)); - } - break; - // DAY OF YEAR - case 'DDD' : // fall through to DDDD - case 'DDDD' : - if (input != null) { - config._dayOfYear = toInt(input); - } - - break; - // YEAR - case 'YY' : - datePartArray[YEAR] = toInt(input) + (toInt(input) > 68 ? 1900 : 2000); - break; - case 'YYYY' : - case 'YYYYY' : - case 'YYYYYY' : - datePartArray[YEAR] = toInt(input); - break; - // AM / PM - case 'a' : // fall through to A - case 'A' : - config._isPm = getLangDefinition(config._l).isPM(input); - break; - // 24 HOUR - case 'H' : // fall through to hh - case 'HH' : // fall through to hh - case 'h' : // fall through to hh - case 'hh' : - datePartArray[HOUR] = toInt(input); - break; - // MINUTE - case 'm' : // fall through to mm - case 'mm' : - datePartArray[MINUTE] = toInt(input); - break; - // SECOND - case 's' : // fall through to ss - case 'ss' : - datePartArray[SECOND] = toInt(input); - break; - // MILLISECOND - case 'S' : - case 'SS' : - case 'SSS' : - case 'SSSS' : - datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000); - break; - // UNIX TIMESTAMP WITH MS - case 'X': - config._d = new Date(parseFloat(input) * 1000); - break; - // TIMEZONE - case 'Z' : // fall through to ZZ - case 'ZZ' : - config._useUTC = true; - config._tzm = timezoneMinutesFromString(input); - break; - case 'w': - case 'ww': - case 'W': - case 'WW': - case 'd': - case 'dd': - case 'ddd': - case 'dddd': - case 'e': - case 'E': - token = token.substr(0, 1); - /* falls through */ - case 'gg': - case 'gggg': - case 'GG': - case 'GGGG': - case 'GGGGG': - token = token.substr(0, 2); - if (input) { - config._w = config._w || {}; - config._w[token] = input; - } - break; - } - } - - // convert an array to a date. - // the array should mirror the parameters below - // note: all values past the year are optional and will default to the lowest possible value. - // [year, month, day , hour, minute, second, millisecond] - function dateFromConfig(config) { - var i, date, input = [], currentDate, - yearToUse, fixYear, w, temp, lang, weekday, week; - - if (config._d) { - return; - } - - currentDate = currentDateArray(config); - - //compute day of the year from weeks and weekdays - if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { - fixYear = function (val) { - var int_val = parseInt(val, 10); - return val ? - (val.length < 3 ? (int_val > 68 ? 1900 + int_val : 2000 + int_val) : int_val) : - (config._a[YEAR] == null ? moment().weekYear() : config._a[YEAR]); - }; - - w = config._w; - if (w.GG != null || w.W != null || w.E != null) { - temp = dayOfYearFromWeeks(fixYear(w.GG), w.W || 1, w.E, 4, 1); - } - else { - lang = getLangDefinition(config._l); - weekday = w.d != null ? parseWeekday(w.d, lang) : - (w.e != null ? parseInt(w.e, 10) + lang._week.dow : 0); - - week = parseInt(w.w, 10) || 1; - - //if we're parsing 'd', then the low day numbers may be next week - if (w.d != null && weekday < lang._week.dow) { - week++; - } - - temp = dayOfYearFromWeeks(fixYear(w.gg), week, weekday, lang._week.doy, lang._week.dow); - } - - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; - } - - //if the day of the year is set, figure out what it is - if (config._dayOfYear) { - yearToUse = config._a[YEAR] == null ? currentDate[YEAR] : config._a[YEAR]; - - if (config._dayOfYear > daysInYear(yearToUse)) { - config._pf._overflowDayOfYear = true; - } - - date = makeUTCDate(yearToUse, 0, config._dayOfYear); - config._a[MONTH] = date.getUTCMonth(); - config._a[DATE] = date.getUTCDate(); - } - - // Default to current date. - // * if no year, month, day of month are given, default to today - // * if day of month is given, default month and year - // * if month is given, default only year - // * if year is given, don't default anything - for (i = 0; i < 3 && config._a[i] == null; ++i) { - config._a[i] = input[i] = currentDate[i]; - } - - // Zero out whatever was not defaulted, including time - for (; i < 7; i++) { - config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; - } - - // add the offsets to the time to be parsed so that we can have a clean array for checking isValid - input[HOUR] += toInt((config._tzm || 0) / 60); - input[MINUTE] += toInt((config._tzm || 0) % 60); - - config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input); - } - - function dateFromObject(config) { - var normalizedInput; - - if (config._d) { - return; - } - - normalizedInput = normalizeObjectUnits(config._i); - config._a = [ - normalizedInput.year, - normalizedInput.month, - normalizedInput.day, - normalizedInput.hour, - normalizedInput.minute, - normalizedInput.second, - normalizedInput.millisecond - ]; - - dateFromConfig(config); - } - - function currentDateArray(config) { - var now = new Date(); - if (config._useUTC) { - return [ - now.getUTCFullYear(), - now.getUTCMonth(), - now.getUTCDate() - ]; - } else { - return [now.getFullYear(), now.getMonth(), now.getDate()]; - } - } - - // date from string and format string - function makeDateFromStringAndFormat(config) { - - config._a = []; - config._pf.empty = true; - - // This array is used to make a Date, either with `new Date` or `Date.UTC` - var lang = getLangDefinition(config._l), - string = '' + config._i, - i, parsedInput, tokens, token, skipped, - stringLength = string.length, - totalParsedInputLength = 0; - - tokens = expandFormat(config._f, lang).match(formattingTokens) || []; - - for (i = 0; i < tokens.length; i++) { - token = tokens[i]; - parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; - if (parsedInput) { - skipped = string.substr(0, string.indexOf(parsedInput)); - if (skipped.length > 0) { - config._pf.unusedInput.push(skipped); - } - string = string.slice(string.indexOf(parsedInput) + parsedInput.length); - totalParsedInputLength += parsedInput.length; - } - // don't parse if it's not a known token - if (formatTokenFunctions[token]) { - if (parsedInput) { - config._pf.empty = false; - } - else { - config._pf.unusedTokens.push(token); - } - addTimeToArrayFromToken(token, parsedInput, config); - } - else if (config._strict && !parsedInput) { - config._pf.unusedTokens.push(token); - } - } - - // add remaining unparsed input length to the string - config._pf.charsLeftOver = stringLength - totalParsedInputLength; - if (string.length > 0) { - config._pf.unusedInput.push(string); - } - - // handle am pm - if (config._isPm && config._a[HOUR] < 12) { - config._a[HOUR] += 12; - } - // if is 12 am, change hours to 0 - if (config._isPm === false && config._a[HOUR] === 12) { - config._a[HOUR] = 0; - } - - dateFromConfig(config); - checkOverflow(config); - } - - function unescapeFormat(s) { - return s.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { - return p1 || p2 || p3 || p4; - }); - } - - // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript - function regexpEscape(s) { - return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); - } - - // date from string and array of format strings - function makeDateFromStringAndArray(config) { - var tempConfig, - bestMoment, - - scoreToBeat, - i, - currentScore; - - if (config._f.length === 0) { - config._pf.invalidFormat = true; - config._d = new Date(NaN); - return; - } - - for (i = 0; i < config._f.length; i++) { - currentScore = 0; - tempConfig = extend({}, config); - tempConfig._pf = defaultParsingFlags(); - tempConfig._f = config._f[i]; - makeDateFromStringAndFormat(tempConfig); - - if (!isValid(tempConfig)) { - continue; - } - - // if there is any input that was not parsed add a penalty for that format - currentScore += tempConfig._pf.charsLeftOver; - - //or tokens - currentScore += tempConfig._pf.unusedTokens.length * 10; - - tempConfig._pf.score = currentScore; - - if (scoreToBeat == null || currentScore < scoreToBeat) { - scoreToBeat = currentScore; - bestMoment = tempConfig; - } - } - - extend(config, bestMoment || tempConfig); - } - - // date from iso format - function makeDateFromString(config) { - var i, l, - string = config._i, - match = isoRegex.exec(string); - - if (match) { - config._pf.iso = true; - for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(string)) { - // match[5] should be "T" or undefined - config._f = isoDates[i][0] + (match[6] || " "); - break; - } - } - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(string)) { - config._f += isoTimes[i][0]; - break; - } - } - if (string.match(parseTokenTimezone)) { - config._f += "Z"; - } - makeDateFromStringAndFormat(config); - } - else { - config._d = new Date(string); - } - } - - function makeDateFromInput(config) { - var input = config._i, - matched = aspNetJsonRegex.exec(input); - - if (input === undefined) { - config._d = new Date(); - } else if (matched) { - config._d = new Date(+matched[1]); - } else if (typeof input === 'string') { - makeDateFromString(config); - } else if (isArray(input)) { - config._a = input.slice(0); - dateFromConfig(config); - } else if (isDate(input)) { - config._d = new Date(+input); - } else if (typeof(input) === 'object') { - dateFromObject(config); - } else { - config._d = new Date(input); - } - } - - function makeDate(y, m, d, h, M, s, ms) { - //can't just apply() to create a date: - //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply - var date = new Date(y, m, d, h, M, s, ms); - - //the date constructor doesn't accept years < 1970 - if (y < 1970) { - date.setFullYear(y); - } - return date; - } - - function makeUTCDate(y) { - var date = new Date(Date.UTC.apply(null, arguments)); - if (y < 1970) { - date.setUTCFullYear(y); - } - return date; - } - - function parseWeekday(input, language) { - if (typeof input === 'string') { - if (!isNaN(input)) { - input = parseInt(input, 10); - } - else { - input = language.weekdaysParse(input); - if (typeof input !== 'number') { - return null; - } - } - } - return input; - } - - /************************************ - Relative Time - ************************************/ - - - // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize - function substituteTimeAgo(string, number, withoutSuffix, isFuture, lang) { - return lang.relativeTime(number || 1, !!withoutSuffix, string, isFuture); - } - - function relativeTime(milliseconds, withoutSuffix, lang) { - var seconds = round(Math.abs(milliseconds) / 1000), - minutes = round(seconds / 60), - hours = round(minutes / 60), - days = round(hours / 24), - years = round(days / 365), - args = seconds < 45 && ['s', seconds] || - minutes === 1 && ['m'] || - minutes < 45 && ['mm', minutes] || - hours === 1 && ['h'] || - hours < 22 && ['hh', hours] || - days === 1 && ['d'] || - days <= 25 && ['dd', days] || - days <= 45 && ['M'] || - days < 345 && ['MM', round(days / 30)] || - years === 1 && ['y'] || ['yy', years]; - args[2] = withoutSuffix; - args[3] = milliseconds > 0; - args[4] = lang; - return substituteTimeAgo.apply({}, args); - } - - - /************************************ - Week of Year - ************************************/ - - - // firstDayOfWeek 0 = sun, 6 = sat - // the day of the week that starts the week - // (usually sunday or monday) - // firstDayOfWeekOfYear 0 = sun, 6 = sat - // the first week is the week that contains the first - // of this day of the week - // (eg. ISO weeks use thursday (4)) - function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { - var end = firstDayOfWeekOfYear - firstDayOfWeek, - daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), - adjustedMoment; - - - if (daysToDayOfWeek > end) { - daysToDayOfWeek -= 7; - } - - if (daysToDayOfWeek < end - 7) { - daysToDayOfWeek += 7; - } - - adjustedMoment = moment(mom).add('d', daysToDayOfWeek); - return { - week: Math.ceil(adjustedMoment.dayOfYear() / 7), - year: adjustedMoment.year() - }; - } - - //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { - var d = makeUTCDate(year, 0, 1).getUTCDay(), daysToAdd, dayOfYear; - - weekday = weekday != null ? weekday : firstDayOfWeek; - daysToAdd = firstDayOfWeek - d + (d > firstDayOfWeekOfYear ? 7 : 0) - (d < firstDayOfWeek ? 7 : 0); - dayOfYear = 7 * (week - 1) + (weekday - firstDayOfWeek) + daysToAdd + 1; - - return { - year: dayOfYear > 0 ? year : year - 1, - dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear - }; - } - - /************************************ - Top Level Functions - ************************************/ - - function makeMoment(config) { - var input = config._i, - format = config._f; - - if (input === null) { - return moment.invalid({nullInput: true}); - } - - if (typeof input === 'string') { - config._i = input = getLangDefinition().preparse(input); - } - - if (moment.isMoment(input)) { - config = cloneMoment(input); - - config._d = new Date(+input._d); - } else if (format) { - if (isArray(format)) { - makeDateFromStringAndArray(config); - } else { - makeDateFromStringAndFormat(config); - } - } else { - makeDateFromInput(config); - } - - return new Moment(config); - } - - moment = function (input, format, lang, strict) { - var c; - - if (typeof(lang) === "boolean") { - strict = lang; - lang = undefined; - } - // object construction must be done this way. - // https://github.com/moment/moment/issues/1423 - c = {}; - c._isAMomentObject = true; - c._i = input; - c._f = format; - c._l = lang; - c._strict = strict; - c._isUTC = false; - c._pf = defaultParsingFlags(); - - return makeMoment(c); - }; - - // creating with utc - moment.utc = function (input, format, lang, strict) { - var c; - - if (typeof(lang) === "boolean") { - strict = lang; - lang = undefined; - } - // object construction must be done this way. - // https://github.com/moment/moment/issues/1423 - c = {}; - c._isAMomentObject = true; - c._useUTC = true; - c._isUTC = true; - c._l = lang; - c._i = input; - c._f = format; - c._strict = strict; - c._pf = defaultParsingFlags(); - - return makeMoment(c).utc(); - }; - - // creating with unix timestamp (in seconds) - moment.unix = function (input) { - return moment(input * 1000); - }; - - // duration - moment.duration = function (input, key) { - var duration = input, - // matching against regexp is expensive, do it on demand - match = null, - sign, - ret, - parseIso; - - if (moment.isDuration(input)) { - duration = { - ms: input._milliseconds, - d: input._days, - M: input._months - }; - } else if (typeof input === 'number') { - duration = {}; - if (key) { - duration[key] = input; - } else { - duration.milliseconds = input; - } - } else if (!!(match = aspNetTimeSpanJsonRegex.exec(input))) { - sign = (match[1] === "-") ? -1 : 1; - duration = { - y: 0, - d: toInt(match[DATE]) * sign, - h: toInt(match[HOUR]) * sign, - m: toInt(match[MINUTE]) * sign, - s: toInt(match[SECOND]) * sign, - ms: toInt(match[MILLISECOND]) * sign - }; - } else if (!!(match = isoDurationRegex.exec(input))) { - sign = (match[1] === "-") ? -1 : 1; - parseIso = function (inp) { - // We'd normally use ~~inp for this, but unfortunately it also - // converts floats to ints. - // inp may be undefined, so careful calling replace on it. - var res = inp && parseFloat(inp.replace(',', '.')); - // apply sign while we're at it - return (isNaN(res) ? 0 : res) * sign; - }; - duration = { - y: parseIso(match[2]), - M: parseIso(match[3]), - d: parseIso(match[4]), - h: parseIso(match[5]), - m: parseIso(match[6]), - s: parseIso(match[7]), - w: parseIso(match[8]) - }; - } - - ret = new Duration(duration); - - if (moment.isDuration(input) && input.hasOwnProperty('_lang')) { - ret._lang = input._lang; - } - - return ret; - }; - - // version number - moment.version = VERSION; - - // default format - moment.defaultFormat = isoFormat; - - // This function will be called whenever a moment is mutated. - // It is intended to keep the offset in sync with the timezone. - moment.updateOffset = function () {}; - - // This function will load languages and then set the global language. If - // no arguments are passed in, it will simply return the current global - // language key. - moment.lang = function (key, values) { - var r; - if (!key) { - return moment.fn._lang._abbr; - } - if (values) { - loadLang(normalizeLanguage(key), values); - } else if (values === null) { - unloadLang(key); - key = 'en'; - } else if (!languages[key]) { - getLangDefinition(key); - } - r = moment.duration.fn._lang = moment.fn._lang = getLangDefinition(key); - return r._abbr; - }; - - // returns language data - moment.langData = function (key) { - if (key && key._lang && key._lang._abbr) { - key = key._lang._abbr; - } - return getLangDefinition(key); - }; - - // compare moment object - moment.isMoment = function (obj) { - return obj instanceof Moment || - (obj != null && obj.hasOwnProperty('_isAMomentObject')); - }; - - // for typechecking Duration objects - moment.isDuration = function (obj) { - return obj instanceof Duration; - }; - - for (i = lists.length - 1; i >= 0; --i) { - makeList(lists[i]); - } - - moment.normalizeUnits = function (units) { - return normalizeUnits(units); - }; - - moment.invalid = function (flags) { - var m = moment.utc(NaN); - if (flags != null) { - extend(m._pf, flags); - } - else { - m._pf.userInvalidated = true; - } - - return m; - }; - - moment.parseZone = function () { - return moment.apply(null, arguments).parseZone(); - }; - - /************************************ - Moment Prototype - ************************************/ - - - extend(moment.fn = Moment.prototype, { - - clone : function () { - return moment(this); - }, - - valueOf : function () { - return +this._d + ((this._offset || 0) * 60000); - }, - - unix : function () { - return Math.floor(+this / 1000); - }, - - toString : function () { - return this.clone().lang('en').format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ"); - }, - - toDate : function () { - return this._offset ? new Date(+this) : this._d; - }, - - toISOString : function () { - var m = moment(this).utc(); - if (0 < m.year() && m.year() <= 9999) { - return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); - } else { - return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); - } - }, - - toArray : function () { - var m = this; - return [ - m.year(), - m.month(), - m.date(), - m.hours(), - m.minutes(), - m.seconds(), - m.milliseconds() - ]; - }, - - isValid : function () { - return isValid(this); - }, - - isDSTShifted : function () { - - if (this._a) { - return this.isValid() && compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray()) > 0; - } - - return false; - }, - - parsingFlags : function () { - return extend({}, this._pf); - }, - - invalidAt: function () { - return this._pf.overflow; - }, - - utc : function () { - return this.zone(0); - }, - - local : function () { - this.zone(0); - this._isUTC = false; - return this; - }, - - format : function (inputString) { - var output = formatMoment(this, inputString || moment.defaultFormat); - return this.lang().postformat(output); - }, - - add : function (input, val) { - var dur; - // switch args to support add('s', 1) and add(1, 's') - if (typeof input === 'string') { - dur = moment.duration(+val, input); - } else { - dur = moment.duration(input, val); - } - addOrSubtractDurationFromMoment(this, dur, 1); - return this; - }, - - subtract : function (input, val) { - var dur; - // switch args to support subtract('s', 1) and subtract(1, 's') - if (typeof input === 'string') { - dur = moment.duration(+val, input); - } else { - dur = moment.duration(input, val); - } - addOrSubtractDurationFromMoment(this, dur, -1); - return this; - }, - - diff : function (input, units, asFloat) { - var that = makeAs(input, this), - zoneDiff = (this.zone() - that.zone()) * 6e4, - diff, output; - - units = normalizeUnits(units); - - if (units === 'year' || units === 'month') { - // average number of days in the months in the given dates - diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2 - // difference in months - output = ((this.year() - that.year()) * 12) + (this.month() - that.month()); - // adjust by taking difference in days, average number of days - // and dst in the given months. - output += ((this - moment(this).startOf('month')) - - (that - moment(that).startOf('month'))) / diff; - // same as above but with zones, to negate all dst - output -= ((this.zone() - moment(this).startOf('month').zone()) - - (that.zone() - moment(that).startOf('month').zone())) * 6e4 / diff; - if (units === 'year') { - output = output / 12; - } - } else { - diff = (this - that); - output = units === 'second' ? diff / 1e3 : // 1000 - units === 'minute' ? diff / 6e4 : // 1000 * 60 - units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60 - units === 'day' ? (diff - zoneDiff) / 864e5 : // 1000 * 60 * 60 * 24, negate dst - units === 'week' ? (diff - zoneDiff) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst - diff; - } - return asFloat ? output : absRound(output); - }, - - from : function (time, withoutSuffix) { - return moment.duration(this.diff(time)).lang(this.lang()._abbr).humanize(!withoutSuffix); - }, - - fromNow : function (withoutSuffix) { - return this.from(moment(), withoutSuffix); - }, - - calendar : function () { - // We want to compare the start of today, vs this. - // Getting start-of-today depends on whether we're zone'd or not. - var sod = makeAs(moment(), this).startOf('day'), - diff = this.diff(sod, 'days', true), - format = diff < -6 ? 'sameElse' : - diff < -1 ? 'lastWeek' : - diff < 0 ? 'lastDay' : - diff < 1 ? 'sameDay' : - diff < 2 ? 'nextDay' : - diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(this.lang().calendar(format, this)); - }, - - isLeapYear : function () { - return isLeapYear(this.year()); - }, - - isDST : function () { - return (this.zone() < this.clone().month(0).zone() || - this.zone() < this.clone().month(5).zone()); - }, - - day : function (input) { - var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); - if (input != null) { - input = parseWeekday(input, this.lang()); - return this.add({ d : input - day }); - } else { - return day; - } - }, - - month : function (input) { - var utc = this._isUTC ? 'UTC' : '', - dayOfMonth; - - if (input != null) { - if (typeof input === 'string') { - input = this.lang().monthsParse(input); - if (typeof input !== 'number') { - return this; - } - } - - dayOfMonth = Math.min(this.date(), - daysInMonth(this.year(), input)); - this._d['set' + utc + 'Month'](input, dayOfMonth); - moment.updateOffset(this, true); - return this; - } else { - return this._d['get' + utc + 'Month'](); - } - }, - - startOf: function (units) { - units = normalizeUnits(units); - // the following switch intentionally omits break keywords - // to utilize falling through the cases. - switch (units) { - case 'year': - this.month(0); - /* falls through */ - case 'month': - this.date(1); - /* falls through */ - case 'week': - case 'isoWeek': - case 'day': - this.hours(0); - /* falls through */ - case 'hour': - this.minutes(0); - /* falls through */ - case 'minute': - this.seconds(0); - /* falls through */ - case 'second': - this.milliseconds(0); - /* falls through */ - } - - // weeks are a special case - if (units === 'week') { - this.weekday(0); - } else if (units === 'isoWeek') { - this.isoWeekday(1); - } - - return this; - }, - - endOf: function (units) { - units = normalizeUnits(units); - return this.startOf(units).add((units === 'isoWeek' ? 'week' : units), 1).subtract('ms', 1); - }, - - isAfter: function (input, units) { - units = typeof units !== 'undefined' ? units : 'millisecond'; - return +this.clone().startOf(units) > +moment(input).startOf(units); - }, - - isBefore: function (input, units) { - units = typeof units !== 'undefined' ? units : 'millisecond'; - return +this.clone().startOf(units) < +moment(input).startOf(units); - }, - - isSame: function (input, units) { - units = units || 'ms'; - return +this.clone().startOf(units) === +makeAs(input, this).startOf(units); - }, - - min: function (other) { - other = moment.apply(null, arguments); - return other < this ? this : other; - }, - - max: function (other) { - other = moment.apply(null, arguments); - return other > this ? this : other; - }, - - zone : function (input, adjust) { - adjust = (adjust == null ? true : false); - var offset = this._offset || 0; - if (input != null) { - if (typeof input === "string") { - input = timezoneMinutesFromString(input); - } - if (Math.abs(input) < 16) { - input = input * 60; - } - this._offset = input; - this._isUTC = true; - if (offset !== input && adjust) { - addOrSubtractDurationFromMoment(this, moment.duration(offset - input, 'm'), 1, true); - } - } else { - return this._isUTC ? offset : this._d.getTimezoneOffset(); - } - return this; - }, - - zoneAbbr : function () { - return this._isUTC ? "UTC" : ""; - }, - - zoneName : function () { - return this._isUTC ? "Coordinated Universal Time" : ""; - }, - - parseZone : function () { - if (this._tzm) { - this.zone(this._tzm); - } else if (typeof this._i === 'string') { - this.zone(this._i); - } - return this; - }, - - hasAlignedHourOffset : function (input) { - if (!input) { - input = 0; - } - else { - input = moment(input).zone(); - } - - return (this.zone() - input) % 60 === 0; - }, - - daysInMonth : function () { - return daysInMonth(this.year(), this.month()); - }, - - dayOfYear : function (input) { - var dayOfYear = round((moment(this).startOf('day') - moment(this).startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add("d", (input - dayOfYear)); - }, - - quarter : function () { - return Math.ceil((this.month() + 1.0) / 3.0); - }, - - weekYear : function (input) { - var year = weekOfYear(this, this.lang()._week.dow, this.lang()._week.doy).year; - return input == null ? year : this.add("y", (input - year)); - }, - - isoWeekYear : function (input) { - var year = weekOfYear(this, 1, 4).year; - return input == null ? year : this.add("y", (input - year)); - }, - - week : function (input) { - var week = this.lang().week(this); - return input == null ? week : this.add("d", (input - week) * 7); - }, - - isoWeek : function (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add("d", (input - week) * 7); - }, - - weekday : function (input) { - var weekday = (this.day() + 7 - this.lang()._week.dow) % 7; - return input == null ? weekday : this.add("d", input - weekday); - }, - - isoWeekday : function (input) { - // behaves the same as moment#day except - // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) - // as a setter, sunday should belong to the previous week. - return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); - }, - - isoWeeksInYear : function () { - return weeksInYear(this.year(), 1, 4); - }, - - weeksInYear : function () { - var weekInfo = this._lang._week; - return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); - }, - - get : function (units) { - units = normalizeUnits(units); - return this[units](); - }, - - set : function (units, value) { - units = normalizeUnits(units); - if (typeof this[units] === 'function') { - this[units](value); - } - return this; - }, - - // If passed a language key, it will set the language for this - // instance. Otherwise, it will return the language configuration - // variables for this instance. - lang : function (key) { - if (key === undefined) { - return this._lang; - } else { - this._lang = getLangDefinition(key); - return this; - } - } - }); - - // helper for adding shortcuts - function makeGetterAndSetter(name, key) { - // ignoreOffsetTransitions provides a hint to updateOffset to not - // change hours/minutes when crossing a tz boundary. This is frequently - // desirable when modifying part of an existing moment object directly. - var defaultIgnoreOffsetTransitions = key === 'date' || key === 'month' || key === 'year'; - moment.fn[name] = moment.fn[name + 's'] = function (input, ignoreOffsetTransitions) { - var utc = this._isUTC ? 'UTC' : ''; - if (ignoreOffsetTransitions == null) { - ignoreOffsetTransitions = defaultIgnoreOffsetTransitions; - } - if (input != null) { - this._d['set' + utc + key](input); - moment.updateOffset(this, ignoreOffsetTransitions); - return this; - } else { - return this._d['get' + utc + key](); - } - }; - } - - // loop through and add shortcuts (Date, Hours, Minutes, Seconds, Milliseconds) - // Month has a custom getter/setter. - for (i = 0; i < proxyGettersAndSetters.length; i ++) { - makeGetterAndSetter(proxyGettersAndSetters[i].toLowerCase().replace(/s$/, ''), proxyGettersAndSetters[i]); - } - - // add shortcut for year (uses different syntax than the getter/setter 'year' == 'FullYear') - makeGetterAndSetter('year', 'FullYear'); - - // add plural methods - moment.fn.days = moment.fn.day; - moment.fn.months = moment.fn.month; - moment.fn.weeks = moment.fn.week; - moment.fn.isoWeeks = moment.fn.isoWeek; - - // add aliased format methods - moment.fn.toJSON = moment.fn.toISOString; - - /************************************ - Duration Prototype - ************************************/ - - - extend(moment.duration.fn = Duration.prototype, { - - _bubble : function () { - var milliseconds = this._milliseconds, - days = this._days, - months = this._months, - data = this._data, - seconds, minutes, hours, years; - - // The following code bubbles up values, see the tests for - // examples of what that means. - data.milliseconds = milliseconds % 1000; - - seconds = absRound(milliseconds / 1000); - data.seconds = seconds % 60; - - minutes = absRound(seconds / 60); - data.minutes = minutes % 60; - - hours = absRound(minutes / 60); - data.hours = hours % 24; - - days += absRound(hours / 24); - data.days = days % 30; - - months += absRound(days / 30); - data.months = months % 12; - - years = absRound(months / 12); - data.years = years; - }, - - weeks : function () { - return absRound(this.days() / 7); - }, - - valueOf : function () { - return this._milliseconds + - this._days * 864e5 + - (this._months % 12) * 2592e6 + - toInt(this._months / 12) * 31536e6; - }, - - humanize : function (withSuffix) { - var difference = +this, - output = relativeTime(difference, !withSuffix, this.lang()); - - if (withSuffix) { - output = this.lang().pastFuture(difference, output); - } - - return this.lang().postformat(output); - }, - - add : function (input, val) { - // supports only 2.0-style add(1, 's') or add(moment) - var dur = moment.duration(input, val); - - this._milliseconds += dur._milliseconds; - this._days += dur._days; - this._months += dur._months; - - this._bubble(); - - return this; - }, - - subtract : function (input, val) { - var dur = moment.duration(input, val); - - this._milliseconds -= dur._milliseconds; - this._days -= dur._days; - this._months -= dur._months; - - this._bubble(); - - return this; - }, - - get : function (units) { - units = normalizeUnits(units); - return this[units.toLowerCase() + 's'](); - }, - - as : function (units) { - units = normalizeUnits(units); - return this['as' + units.charAt(0).toUpperCase() + units.slice(1) + 's'](); - }, - - lang : moment.fn.lang, - - toIsoString : function () { - // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js - var years = Math.abs(this.years()), - months = Math.abs(this.months()), - days = Math.abs(this.days()), - hours = Math.abs(this.hours()), - minutes = Math.abs(this.minutes()), - seconds = Math.abs(this.seconds() + this.milliseconds() / 1000); - - if (!this.asSeconds()) { - // this is the same as C#'s (Noda) and python (isodate)... - // but not other JS (goog.date) - return 'P0D'; - } - - return (this.asSeconds() < 0 ? '-' : '') + - 'P' + - (years ? years + 'Y' : '') + - (months ? months + 'M' : '') + - (days ? days + 'D' : '') + - ((hours || minutes || seconds) ? 'T' : '') + - (hours ? hours + 'H' : '') + - (minutes ? minutes + 'M' : '') + - (seconds ? seconds + 'S' : ''); - } - }); - - function makeDurationGetter(name) { - moment.duration.fn[name] = function () { - return this._data[name]; - }; - } - - function makeDurationAsGetter(name, factor) { - moment.duration.fn['as' + name] = function () { - return +this / factor; - }; - } - - for (i in unitMillisecondFactors) { - if (unitMillisecondFactors.hasOwnProperty(i)) { - makeDurationAsGetter(i, unitMillisecondFactors[i]); - makeDurationGetter(i.toLowerCase()); - } - } - - makeDurationAsGetter('Weeks', 6048e5); - moment.duration.fn.asMonths = function () { - return (+this - this.years() * 31536e6) / 2592e6 + this.years() * 12; - }; - - - /************************************ - Default Lang - ************************************/ - - - // Set default language, other languages will inherit from English. - moment.lang('en', { - ordinal : function (number) { - var b = number % 10, - output = (toInt(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); - - /* EMBED_LANGUAGES */ - - /************************************ - Exposing Moment - ************************************/ - - function makeGlobal(deprecate) { - var warned = false, local_moment = moment; - /*global ender:false */ - if (typeof ender !== 'undefined') { - return; - } - // here, `this` means `window` in the browser, or `global` on the server - // add `moment` as a global object via a string identifier, - // for Closure Compiler "advanced" mode - if (deprecate) { - global.moment = function () { - if (!warned && console && console.warn) { - warned = true; - console.warn( - "Accessing Moment through the global scope is " + - "deprecated, and will be removed in an upcoming " + - "release."); - } - return local_moment.apply(null, arguments); - }; - extend(global.moment, local_moment); - } else { - global['moment'] = moment; - } - } - - // CommonJS module is defined - if (hasModule) { - module.exports = moment; - makeGlobal(true); - } else if (typeof define === "function" && define.amd) { - define("moment", function (require, exports, module) { - if (module.config && module.config() && module.config().noGlobal !== true) { - // If user provided noGlobal, he is aware of global - makeGlobal(module.config().noGlobal === undefined); - } - - return moment; - }); - } else { - makeGlobal(); - } -}).call(this); diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/underscore.js b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/underscore.js deleted file mode 100644 index ca61fdc3a4b..00000000000 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/underscore.js +++ /dev/null @@ -1,1344 +0,0 @@ -// Underscore.js 1.6.0 -// http://underscorejs.org -// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `exports` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var - push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.6.0'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return obj; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, length = obj.length; i < length; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return; - } - } - return obj; - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results.push(iterator.call(context, value, index, list)); - }); - return results; - }; - - var reduceError = 'Reduce of empty array with no initial value'; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; - } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, predicate, context) { - var result; - any(obj, function(value, index, list) { - if (predicate.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, predicate, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context); - each(obj, function(value, index, list) { - if (predicate.call(context, value, index, list)) results.push(value); - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, predicate, context) { - return _.filter(obj, function(value, index, list) { - return !predicate.call(context, value, index, list); - }, context); - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, predicate, context) { - predicate || (predicate = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context); - each(obj, function(value, index, list) { - if (!(result = result && predicate.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, predicate, context) { - predicate || (predicate = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context); - each(obj, function(value, index, list) { - if (result || (result = predicate.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function(obj, target) { - if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - return (isFunc ? method : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, _.property(key)); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs) { - return _.filter(obj, _.matches(attrs)); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.find(obj, _.matches(attrs)); - }; - - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797) - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - var result = -Infinity, lastComputed = -Infinity; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - if (computed > lastComputed) { - result = value; - lastComputed = computed; - } - }); - return result; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - var result = Infinity, lastComputed = Infinity; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - if (computed < lastComputed) { - result = value; - lastComputed = computed; - } - }); - return result; - }; - - // Shuffle an array, using the modern version of the - // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). - _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // Sample **n** random values from a collection. - // If **n** is not specified, returns a single random element. - // The internal `guard` argument allows it to work with `map`. - _.sample = function(obj, n, guard) { - if (n == null || guard) { - if (obj.length !== +obj.length) obj = _.values(obj); - return obj[_.random(obj.length - 1)]; - } - return _.shuffle(obj).slice(0, Math.max(0, n)); - }; - - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - if (value == null) return _.identity; - if (_.isFunction(value)) return value; - return _.property(value); - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, iterator, context) { - iterator = lookupIterator(iterator); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value: value, - index: index, - criteria: iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(behavior) { - return function(obj, iterator, context) { - var result = {}; - iterator = lookupIterator(iterator); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; - }; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = group(function(result, key, value) { - _.has(result, key) ? result[key].push(value) : result[key] = [value]; - }); - - // Indexes the object's values by a criterion, similar to `groupBy`, but for - // when you know that your index values will be unique. - _.indexBy = group(function(result, key, value) { - result[key] = value; - }); - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = group(function(result, key) { - _.has(result, key) ? result[key]++ : result[key] = 1; - }); - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = lookupIterator(iterator); - var value = iterator.call(context, obj); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely create a real, live array from anything iterable. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (obj.length === +obj.length) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - if ((n == null) || guard) return array[0]; - if (n < 0) return []; - return slice.call(array, 0, n); - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if ((n == null) || guard) return array[array.length - 1]; - return slice.call(array, Math.max(array.length - n, 0)); - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - if (shallow && _.every(input, _.isArray)) { - return concat.apply(output, input); - } - each(input, function(value) { - if (_.isArray(value) || _.isArguments(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); - } else { - output.push(value); - } - }); - return output; - }; - - // Flatten out an array, either recursively (by default), or just one level. - _.flatten = function(array, shallow) { - return flatten(array, shallow, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Split an array into two arrays: one whose elements all satisfy the given - // predicate, and one whose elements all do not satisfy the predicate. - _.partition = function(array, predicate, context) { - predicate = lookupIterator(predicate); - var pass = [], fail = []; - each(array, function(elem) { - (predicate.call(context, elem) ? pass : fail).push(elem); - }); - return [pass, fail]; - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; - isSorted = false; - } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; - var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); - } - }); - return results; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(_.flatten(arguments, true)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.contains(other, item); - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var length = _.max(_.pluck(arguments, 'length').concat(0)); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(arguments, '' + i); - } - return results; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, length = list.length; i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i = 0, length = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted); - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < length; i++) if (array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item, from) { - if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); - } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(length); - - while(idx < length) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Reusable constructor function for prototype setting. - var ctor = function(){}; - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - var args, bound; - if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError; - args = slice.call(arguments, 2); - return bound = function() { - if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); - ctor.prototype = func.prototype; - var self = new ctor; - ctor.prototype = null; - var result = func.apply(self, args.concat(slice.call(arguments))); - if (Object(result) === result) return result; - return self; - }; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. _ acts - // as a placeholder, allowing any combination of arguments to be pre-filled. - _.partial = function(func) { - var boundArgs = slice.call(arguments, 1); - return function() { - var position = 0; - var args = boundArgs.slice(); - for (var i = 0, length = args.length; i < length; i++) { - if (args[i] === _) args[i] = arguments[position++]; - } - while (position < arguments.length) args.push(arguments[position++]); - return func.apply(this, args); - }; - }; - - // Bind a number of an object's methods to that object. Remaining arguments - // are the method names to be bound. Useful for ensuring that all callbacks - // defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) throw new Error('bindAll must be passed function names'); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. Normally, the throttled function will run - // as much as it can, without ever going more than once per `wait` duration; - // but if you'd like to disable the execution on the leading edge, pass - // `{leading: false}`. To disable execution on the trailing edge, ditto. - _.throttle = function(func, wait, options) { - var context, args, result; - var timeout = null; - var previous = 0; - options || (options = {}); - var later = function() { - previous = options.leading === false ? 0 : _.now(); - timeout = null; - result = func.apply(context, args); - context = args = null; - }; - return function() { - var now = _.now(); - if (!previous && options.leading === false) previous = now; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, args, context, timestamp, result; - - var later = function() { - var last = _.now() - timestamp; - if (last < wait) { - timeout = setTimeout(later, wait - last); - } else { - timeout = null; - if (!immediate) { - result = func.apply(context, args); - context = args = null; - } - } - }; - - return function() { - context = this; - args = arguments; - timestamp = _.now(); - var callNow = immediate && !timeout; - if (!timeout) { - timeout = setTimeout(later, wait); - } - if (callNow) { - result = func.apply(context, args); - context = args = null; - } - - return result; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return _.partial(wrapper, func); - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = function(obj) { - if (!_.isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys.push(key); - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var values = new Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[keys[i]]; - } - return values; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var pairs = new Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [keys[i], obj[keys[i]]]; - } - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - result[obj[keys[i]]] = keys[i]; - } - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; - } - return copy; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] === void 0) obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; - } - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor)) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, [], []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { - _.isFunction = function(obj) { - return typeof obj === 'function'; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - _.constant = function(value) { - return function () { - return value; - }; - }; - - _.property = function(key) { - return function(obj) { - return obj[key]; - }; - }; - - // Returns a predicate for checking whether an object has a given set of `key:value` pairs. - _.matches = function(attrs) { - return function(obj) { - if (obj === attrs) return true; //avoid comparing an object to itself. - for (var key in attrs) { - if (attrs[key] !== obj[key]) - return false; - } - return true; - } - }; - - // Run a function **n** times. - _.times = function(n, iterator, context) { - var accum = Array(Math.max(0, n)); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // A (possibly faster) way to get the current timestamp as an integer. - _.now = Date.now || function() { return new Date().getTime(); }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - } - }; - entityMap.unescape = _.invert(entityMap.escape); - - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); - }; - }); - - // If the value of the named `property` is a function then invoke it with the - // `object` as context; otherwise, return it. - _.result = function(object, property) { - if (object == null) return void 0; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name) { - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - index = offset + match.length; - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; - - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(obj) { - return this._chain ? _(obj).chain() : obj; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); - - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - - // AMD registration happens at the end for compatibility with AMD loaders - // that may not enforce next-turn semantics on modules. Even though general - // practice for AMD registration is to be anonymous, underscore registers - // as a named module because, like jQuery, it is a base library that is - // popular enough to be bundled in a third party lib, but not be part of - // an AMD load request. Those cases could generate an error when an - // anonymous define() is called outside of a loader request. - if (typeof define === 'function' && define.amd) { - define('underscore', [], function() { - return _; - }); - } -}).call(this); diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/uri.js b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/uri.js deleted file mode 100644 index 4b3fd16d80c..00000000000 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/JavaScript/Lib/uri.js +++ /dev/null @@ -1,53 +0,0 @@ -/*! URI.js v1.12.1 http://medialize.github.com/URI.js/ */ -/* build contains: URI.js */ -(function(p,r){"object"===typeof exports?module.exports=r(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"===typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],r):p.URI=r(p.punycode,p.IPv6,p.SecondLevelDomains,p)})(this,function(p,r,v,w){function e(a,b){if(!(this instanceof e))return new e(a,b);void 0===a&&(a="undefined"!==typeof location?location.href+"":"");this.href(a);return void 0!==b?this.absoluteTo(b):this}function s(a){return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g, -"\\$1")}function y(a){return void 0===a?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}function l(a){return"Array"===y(a)}function x(a,b){var c,e;if(l(b)){c=0;for(e=b.length;c]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019]))/ig;e.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u201e\u2018\u2019]+$/};e.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"};e.invalid_hostname_characters= -/[^a-zA-Z0-9\.-]/;e.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src"};e.getDomAttribute=function(a){if(a&&a.nodeName){var b=a.nodeName.toLowerCase();return"input"===b&&"image"!==a.type?void 0:e.domAttributes[b]}};e.encode=z;e.decode=decodeURIComponent;e.iso8859=function(){e.encode=escape;e.decode=unescape};e.unicode=function(){e.encode=z;e.decode=decodeURIComponent};e.characters= -{pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}}};e.encodeQuery= -function(a,b){var c=e.encode(a+"");void 0===b&&(b=e.escapeQuerySpace);return b?c.replace(/%20/g,"+"):c};e.decodeQuery=function(a,b){a+="";void 0===b&&(b=e.escapeQuerySpace);try{return e.decode(b?a.replace(/\+/g,"%20"):a)}catch(c){return a}};e.recodePath=function(a){a=(a+"").split("/");for(var b=0,c=a.length;be)return a.charAt(0)===b.charAt(0)&&"/"===a.charAt(0)?"/":"";if("/"!==a.charAt(e)||"/"!==b.charAt(e))e=a.substring(0,e).lastIndexOf("/");return a.substring(0,e+1)};e.withinString=function(a,b,c){c||(c={});var g=c.start||e.findUri.start,d=c.end||e.findUri.end,k=c.trim||e.findUri.trim,h=/[a-z0-9-]=["']?$/i;for(g.lastIndex=0;;){var n=g.exec(a);if(!n)break;n=n.index;if(c.ignoreHtml){var l= -a.slice(Math.max(n-3,0),n);if(l&&h.test(l))continue}var l=n+a.slice(n).search(d),m=a.slice(n,l).replace(k,"");c.ignore&&c.ignore.test(m)||(l=n+m.length,m=b(m,n,l,a),a=a.slice(0,n)+m+a.slice(l),g.lastIndex=n+m.length)}g.lastIndex=0;return a};e.ensureValidHostname=function(a){if(a.match(e.invalid_hostname_characters)){if(!p)throw new TypeError("Hostname '"+a+"' contains characters other than [A-Z0-9.-] and Punycode.js is not available");if(p.toASCII(a).match(e.invalid_hostname_characters))throw new TypeError("Hostname '"+ -a+"' contains characters other than [A-Z0-9.-]");}};e.noConflict=function(a){if(a)return a={URI:this.noConflict()},URITemplate&&"function"==typeof URITemplate.noConflict&&(a.URITemplate=URITemplate.noConflict()),r&&"function"==typeof r.noConflict&&(a.IPv6=r.noConflict()),SecondLevelDomains&&"function"==typeof SecondLevelDomains.noConflict&&(a.SecondLevelDomains=SecondLevelDomains.noConflict()),a;w.URI===this&&(w.URI=C);return this};d.build=function(a){if(!0===a)this._deferred_build=!0;else if(void 0=== -a||this._deferred_build)this._string=e.build(this._parts),this._deferred_build=!1;return this};d.clone=function(){return new e(this)};d.valueOf=d.toString=function(){return this.build(!1)._string};q={protocol:"protocol",username:"username",password:"password",hostname:"hostname",port:"port"};u=function(a){return function(b,c){if(void 0===b)return this._parts[a]||"";this._parts[a]=b||null;this.build(!c);return this}};for(m in q)d[m]=u(q[m]);q={query:"?",fragment:"#"};u=function(a,b){return function(c, -e){if(void 0===c)return this._parts[a]||"";null!==c&&(c+="",c.charAt(0)===b&&(c=c.substring(1)));this._parts[a]=c;this.build(!e);return this}};for(m in q)d[m]=u(m,q[m]);q={search:["?","query"],hash:["#","fragment"]};u=function(a,b){return function(c,e){var d=this[a](c,e);return"string"===typeof d&&d.length?b+d:d}};for(m in q)d[m]=u(q[m][1],q[m][0]);d.pathname=function(a,b){if(void 0===a||!0===a){var c=this._parts.path||(this._parts.hostname?"/":"");return a?e.decodePath(c):c}this._parts.path=a?e.recodePath(a): -"/";this.build(!b);return this};d.path=d.pathname;d.href=function(a,b){var c;if(void 0===a)return this.toString();this._string="";this._parts=e._parts();var g=a instanceof e,d="object"===typeof a&&(a.hostname||a.path||a.pathname);a.nodeName&&(d=e.getDomAttribute(a),a=a[d]||"",d=!1);!g&&d&&void 0!==a.pathname&&(a=a.toString());if("string"===typeof a)this._parts=e.parse(a,this._parts);else if(g||d)for(c in g=g?a._parts:a,g)t.call(this._parts,c)&&(this._parts[c]=g[c]);else throw new TypeError("invalid input"); -this.build(!b);return this};d.is=function(a){var b=!1,c=!1,d=!1,f=!1,k=!1,h=!1,l=!1,m=!this._parts.urn;this._parts.hostname&&(m=!1,c=e.ip4_expression.test(this._parts.hostname),d=e.ip6_expression.test(this._parts.hostname),b=c||d,k=(f=!b)&&v&&v.has(this._parts.hostname),h=f&&e.idn_expression.test(this._parts.hostname),l=f&&e.punycode_expression.test(this._parts.hostname));switch(a.toLowerCase()){case "relative":return m;case "absolute":return!m;case "domain":case "name":return f;case "sld":return k; -case "ip":return b;case "ip4":case "ipv4":case "inet4":return c;case "ip6":case "ipv6":case "inet6":return d;case "idn":return h;case "url":return!this._parts.urn;case "urn":return!!this._parts.urn;case "punycode":return l}return null};var D=d.protocol,E=d.port,F=d.hostname;d.protocol=function(a,b){if(void 0!==a&&a&&(a=a.replace(/:(\/\/)?$/,""),!a.match(e.protocol_expression)))throw new TypeError("Protocol '"+a+"' contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return D.call(this, -a,b)};d.scheme=d.protocol;d.port=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a&&(0===a&&(a=null),a&&(a+="",":"===a.charAt(0)&&(a=a.substring(1)),a.match(/[^0-9]/))))throw new TypeError("Port '"+a+"' contains characters other than [0-9]");return E.call(this,a,b)};d.hostname=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a){var c={};e.parseHost(a,c);a=c.hostname}return F.call(this,a,b)};d.host=function(a,b){if(this._parts.urn)return void 0===a?"":this; -if(void 0===a)return this._parts.hostname?e.buildHost(this._parts):"";e.parseHost(a,this._parts);this.build(!b);return this};d.authority=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a)return this._parts.hostname?e.buildAuthority(this._parts):"";e.parseAuthority(a,this._parts);this.build(!b);return this};d.userinfo=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.username)return"";var c=e.buildUserinfo(this._parts);return c.substring(0, -c.length-1)}"@"!==a[a.length-1]&&(a+="@");e.parseUserinfo(a,this._parts);this.build(!b);return this};d.resource=function(a,b){var c;if(void 0===a)return this.path()+this.search()+this.hash();c=e.parse(a);this._parts.path=c.path;this._parts.query=c.query;this._parts.fragment=c.fragment;this.build(!b);return this};d.subdomain=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var c=this._parts.hostname.length-this.domain().length- -1;return this._parts.hostname.substring(0,c)||""}c=this._parts.hostname.length-this.domain().length;c=this._parts.hostname.substring(0,c);c=RegExp("^"+s(c));a&&"."!==a.charAt(a.length-1)&&(a+=".");a&&e.ensureValidHostname(a);this._parts.hostname=this._parts.hostname.replace(c,a);this.build(!b);return this};d.domain=function(a,b){if(this._parts.urn)return void 0===a?"":this;"boolean"===typeof a&&(b=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var c=this._parts.hostname.match(/\./g); -if(c&&2>c.length)return this._parts.hostname;c=this._parts.hostname.length-this.tld(b).length-1;c=this._parts.hostname.lastIndexOf(".",c-1)+1;return this._parts.hostname.substring(c)||""}if(!a)throw new TypeError("cannot set domain empty");e.ensureValidHostname(a);!this._parts.hostname||this.is("IP")?this._parts.hostname=a:(c=RegExp(s(this.domain())+"$"),this._parts.hostname=this._parts.hostname.replace(c,a));this.build(!b);return this};d.tld=function(a,b){if(this._parts.urn)return void 0===a?"": -this;"boolean"===typeof a&&(b=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var c=this._parts.hostname.lastIndexOf("."),c=this._parts.hostname.substring(c+1);return!0!==b&&v&&v.list[c.toLowerCase()]?v.get(this._parts.hostname)||c:c}if(a)if(a.match(/[^a-zA-Z0-9-]/))if(v&&v.is(a))c=RegExp(s(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(c,a);else throw new TypeError("TLD '"+a+"' contains characters other than [A-Z0-9]");else{if(!this._parts.hostname|| -this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");c=RegExp(s(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(c,a)}else throw new TypeError("cannot set TLD empty");this.build(!b);return this};d.directory=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var c=this._parts.path.length-this.filename().length-1,c=this._parts.path.substring(0, -c)||(this._parts.hostname?"/":"");return a?e.decodePath(c):c}c=this._parts.path.length-this.filename().length;c=this._parts.path.substring(0,c);c=RegExp("^"+s(c));this.is("relative")||(a||(a="/"),"/"!==a.charAt(0)&&(a="/"+a));a&&"/"!==a.charAt(a.length-1)&&(a+="/");a=e.recodePath(a);this._parts.path=this._parts.path.replace(c,a);this.build(!b);return this};d.filename=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return""; -var c=this._parts.path.lastIndexOf("/"),c=this._parts.path.substring(c+1);return a?e.decodePathSegment(c):c}c=!1;"/"===a.charAt(0)&&(a=a.substring(1));a.match(/\.?\//)&&(c=!0);var d=RegExp(s(this.filename())+"$");a=e.recodePath(a);this._parts.path=this._parts.path.replace(d,a);c?this.normalizePath(b):this.build(!b);return this};d.suffix=function(a,b){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";var c=this.filename(),d=c.lastIndexOf("."); -if(-1===d)return"";c=c.substring(d+1);c=/^[a-z0-9%]+$/i.test(c)?c:"";return a?e.decodePathSegment(c):c}"."===a.charAt(0)&&(a=a.substring(1));if(c=this.suffix())d=a?RegExp(s(c)+"$"):RegExp(s("."+c)+"$");else{if(!a)return this;this._parts.path+="."+e.recodePath(a)}d&&(a=e.recodePath(a),this._parts.path=this._parts.path.replace(d,a));this.build(!b);return this};d.segment=function(a,b,c){var e=this._parts.urn?":":"/",d=this.path(),k="/"===d.substring(0,1),d=d.split(e);void 0!==a&&"number"!==typeof a&& -(c=b,b=a,a=void 0);if(void 0!==a&&"number"!==typeof a)throw Error("Bad segment '"+a+"', must be 0-based integer");k&&d.shift();0>a&&(a=Math.max(d.length+a,0));if(void 0===b)return void 0===a?d:d[a];if(null===a||void 0===d[a])if(l(b)){d=[];a=0;for(var h=b.length;a, Brian Surowiec +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module uri { + + interface URI { + absoluteTo(path: string): URI; + absoluteTo(path: URI): URI; + addFragment(fragment: string): URI; + addQuery(qry: string): URI; + addQuery(qry: Object): URI; + addSearch(qry: string): URI; + addSearch(key: string, value:any): URI; + addSearch(qry: Object): URI; + authority(): string; + authority(authority: string): URI; + + clone(): URI; + + directory(): string; + directory(dir: boolean): string; + directory(dir: string): URI; + domain(): string; + domain(domain: boolean): string; + domain(domain: string): URI; + + duplicateQueryParameters(val: boolean): URI; + + equals(): boolean; + equals(url: string): boolean; + + filename(): string; + filename(file: boolean): string; + filename(file: string): URI; + fragment(): string; + fragment(fragment: string): URI; + fragmentPrefix(prefix: string): URI; + + hash(): string; + hash(hash: string): URI; + host(): string; + host(host: string): URI; + hostname(): string; + hostname(hostname: string): URI; + href(): string; + href(url: string): void; + + is(qry: string): boolean; + iso8859(): URI; + + normalize(): URI; + normalizeFragment(): URI; + normalizeHash(): URI; + normalizeHostname(): URI; + normalizePath(): URI; + normalizePathname(): URI; + normalizePort(): URI; + normalizeProtocol(): URI; + normalizeQuery(): URI; + normalizeSearch(): URI; + + password(): string; + password(pw: string): URI; + path(): string; + path(path: boolean): string; + path(path: string): URI; + pathname(): string; + pathname(path: boolean): string; + pathname(path: string): URI; + port(): string; + port(port: string): URI; + protocol(): string; + protocol(protocol: string): URI; + + query(): string; + query(qry: string): URI; + query(qry: boolean): Object; + query(qry: Object): URI; + + readable(): string; + relativeTo(path: string): URI; + removeQuery(qry: string): URI; + removeQuery(qry: Object): URI; + removeSearch(qry: string): URI; + removeSearch(qry: Object): URI; + resource(): string; + resource(resource: string): URI; + + scheme(): string; + scheme(protocol: string): URI; + search(): string; + search(qry: string): URI; + search(qry: boolean): any; + search(qry: Object): URI; + segment(): string[]; + segment(segments: string[]): URI; + segment(position: number): string; + segment(position: number, level: string): URI; + segment(segment: string): URI; + setQuery(key: string, value: string): URI; + setQuery(qry: Object): URI; + setSearch(key: string, value: string): URI; + setSearch(qry: Object): URI; + subdomain(): string; + subdomain(subdomain: string): URI; + suffix(): string; + suffix(suffix: boolean): string; + suffix(suffix: string): URI; + + tld(): string; + tld(tld: boolean): string; + tld(tld: string): URI; + + unicode(): URI; + userinfo(): string; + userinfo(userinfo: string): URI; + username(): string; + username(uname: string): URI; + + valueOf(): string; + } + + interface URIOptions { + protocol?: string; + username?: string; + password?: string; + hostname?: string; + port?: string; + path?: string; + query?: string; + fragment?: string; + } + + interface URIStatic { + (): URI; + (value: string | URIOptions | HTMLElement): URI; + + new (): URI; + new (value: string | URIOptions | HTMLElement): URI; + + addQuery(data: Object, prop: string, value: string): Object; + addQuery(data: Object, qryObj: Object): Object; + + build(parts: { + protocol: string; + username: string; + password: string; + hostname: string; + port: string; + path: string; + query: string; + fragment: string; + }): string; + buildAuthority(parts: { + username?: string; + password?: string; + hostname?: string; + port?: string; + }): string; + buildHost(parts: { + hostname?: string; + port?: string; + }): string; + buildQuery(qry: Object): string; + buildQuery(qry: Object, duplicates: boolean): string; + buildUserinfo(parts: { + username?: string; + password?: string; + }): string; + + commonPath(path1: string, path2: string): string; + + decode(str: string): string; + decodeQuery(qry: string): string; + + encode(str: string): string; + encodeQuery(qry: string): string; + encodeReserved(str: string): string; + expand(template: string, vals: Object): URI; + + iso8859(): void; + + parse(url: string): { + protocol: string; + username: string; + password: string; + hostname: string; + port: string; + path: string; + query: string; + fragment: string; + }; + parseAuthority(url: string, parts: { + username?: string; + password?: string; + hostname?: string; + port?: string; + }): string; + parseHost(url: string, parts: { + hostname?: string; + port?: string; + }): string; + parseQuery(url: string): Object; + parseUserinfo(url: string, parts: { + username?: string; + password?: string; + }): string; + + removeQuery(data: Object, prop: string, value: string): Object; + removeQuery(data: Object, props: string[]): Object; + removeQuery(data: Object, props: Object): Object; + + unicode(): void; + + withinString(source: string, func: (url: string) => string): string; + } + +} + +interface JQuery { + uri(): uri.URI; +} + +declare var URI: uri.URIStatic; + +declare module 'URI' { + export = URI; +} diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/TypeScript/Typings/jquery.d.ts b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/TypeScript/Typings/jquery.d.ts index 4b8e9f49c0e..ad9e9345512 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/TypeScript/Typings/jquery.d.ts +++ b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/TypeScript/Typings/jquery.d.ts @@ -1,3 +1,8 @@ +// Type definitions for jQuery 1.10.x / 2.0.x +// Project: http://jquery.com/ +// Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton , Diullei Gomes , Tass Iliopoulos , Jason Swearingen , Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , James Harrison Fisher , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly , Dick van den Brink +// Definitions: https://github.com/borisyankov/DefinitelyTyped + /* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -13,14 +18,10 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -// Typing for the jQuery library, version 1.10.x / 2.0.x -// Project: http://jquery.com/ -// Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton, Diullei Gomes , Tass Iliopoulos , Jason Swearingen, Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , James Harrison Fisher , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly -// Definitions: https://github.com/borisyankov/DefinitelyTyped -/* - Interface for the AJAX setting that will configure the AJAX request -*/ +/** + * Interface for the AJAX setting that will configure the AJAX request + */ interface JQueryAjaxSettings { /** * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. @@ -79,7 +80,7 @@ interface JQueryAjaxSettings { /** * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. */ - error? (jqXHR: JQueryXHR, textStatus: string, errorThrow: string): any; + error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; /** * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. */ @@ -99,11 +100,15 @@ interface JQueryAjaxSettings { /** * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } */ - jsonp?: string; + jsonp?: any; /** * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. */ jsonpCallback?: any; + /** + * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0) + */ + method?: string; /** * A mime type to override the XHR mime type. (version added: 1.5.1) */ @@ -158,115 +163,298 @@ interface JQueryAjaxSettings { xhrFields?: { [key: string]: any; }; } -/* - Interface for the jqXHR object -*/ +/** + * Interface for the jqXHR object + */ interface JQueryXHR extends XMLHttpRequest, JQueryPromise { + /** + * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). + */ overrideMimeType(mimeType: string): any; + /** + * Cancel the request. + * + * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled" + */ abort(statusText?: string): void; + /** + * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. + */ + then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise; + /** + * Property containing the parsed response if the response Content-Type is json + */ + responseJSON?: any; + /** + * A function to be called if the request fails. + */ + error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void; } -/* - Interface for the JQuery callback -*/ +/** + * Interface for the JQuery callback + */ interface JQueryCallback { - add(...callbacks: any[]): any; - disable(): any; - empty(): any; - fire(...arguments: any[]): any; + /** + * Add a callback or a collection of callbacks to a callback list. + * + * @param callbacks A function, or array of functions, that are to be added to the callback list. + */ + add(callbacks: Function): JQueryCallback; + /** + * Add a callback or a collection of callbacks to a callback list. + * + * @param callbacks A function, or array of functions, that are to be added to the callback list. + */ + add(callbacks: Function[]): JQueryCallback; + + /** + * Disable a callback list from doing anything more. + */ + disable(): JQueryCallback; + + /** + * Determine if the callbacks list has been disabled. + */ + disabled(): boolean; + + /** + * Remove all of the callbacks from a list. + */ + empty(): JQueryCallback; + + /** + * Call all of the callbacks with the given arguments + * + * @param arguments The argument or list of arguments to pass back to the callback list. + */ + fire(...arguments: any[]): JQueryCallback; + + /** + * Determine if the callbacks have already been called at least once. + */ fired(): boolean; - fireWith(context: any, ...args: any[]): any; - has(callback: any): boolean; - lock(): any; + + /** + * Call all callbacks in a list with the given context and arguments. + * + * @param context A reference to the context in which the callbacks in the list should be fired. + * @param arguments An argument, or array of arguments, to pass to the callbacks in the list. + */ + fireWith(context?: any, ...args: any[]): JQueryCallback; + + /** + * Determine whether a supplied callback is in a list + * + * @param callback The callback to search for. + */ + has(callback: Function): boolean; + + /** + * Lock a callback list in its current state. + */ + lock(): JQueryCallback; + + /** + * Determine if the callbacks list has been locked. + */ locked(): boolean; - remove(...callbacks: any[]): any; + + /** + * Remove a callback or a collection of callbacks from a callback list. + * + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + */ + remove(callbacks: Function): JQueryCallback; + /** + * Remove a callback or a collection of callbacks from a callback list. + * + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + */ + remove(callbacks: Function[]): JQueryCallback; } -/* - Allows jQuery Promises to interop with non-jQuery promises -*/ +/** + * Allows jQuery Promises to interop with non-jQuery promises + */ interface JQueryGenericPromise { - then(onFulfill: (value: T) => U, onReject?: (reason: any) => U): JQueryGenericPromise; - then(onFulfill: (value: T) => JQueryGenericPromise, onReject?: (reason: any) => U): JQueryGenericPromise; - then(onFulfill: (value: T) => U, onReject?: (reason: any) => JQueryGenericPromise): JQueryGenericPromise; - then(onFulfill: (value: T) => JQueryGenericPromise, onReject?: (reason: any) => JQueryGenericPromise): JQueryGenericPromise; + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + */ + then(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; + + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + */ + then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; } -/* - Interface for the JQuery promise, part of callbacks -*/ -interface JQueryPromise { - // Generic versions of callbacks - always(...alwaysCallbacks: T[]): JQueryPromise; - done(...doneCallbacks: T[]): JQueryPromise; - fail(...failCallbacks: T[]): JQueryPromise; - progress(...progressCallbacks: T[]): JQueryPromise; - - always(...alwaysCallbacks: any[]): JQueryPromise; - done(...doneCallbacks: any[]): JQueryPromise; - fail(...failCallbacks: any[]): JQueryPromise; - progress(...progressCallbacks: any[]): JQueryPromise; +/** + * Interface for the JQuery promise/deferred callbacks + */ +interface JQueryPromiseCallback { + (value?: T, ...args: any[]): void; +} - // Deprecated - given no typings - pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; +interface JQueryPromiseOperator { + (callback1: JQueryPromiseCallback|JQueryPromiseCallback[], ...callbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; +} - then(onFulfill: (value: T) => U, onReject?: (...reasons: any[]) => U, onProgress?: (...progression: any[]) => any): JQueryPromise; - then(onFulfill: (value: T) => JQueryGenericPromise, onReject?: (...reasons: any[]) => U, onProgress?: (...progression: any[]) => any): JQueryPromise; - then(onFulfill: (value: T) => U, onReject?: (...reasons: any[]) => JQueryGenericPromise, onProgress?: (...progression: any[]) => any): JQueryPromise; - then(onFulfill: (value: T) => JQueryGenericPromise, onReject?: (...reasons: any[]) => JQueryGenericPromise, onProgress?: (...progression: any[]) => any): JQueryPromise; +/** + * Interface for the JQuery promise, part of callbacks + */ +interface JQueryPromise extends JQueryGenericPromise { + /** + * Determine the current state of a Deferred object. + */ + state(): string; + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + */ + always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + */ + done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + */ + fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. + */ + progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; - // Because JQuery Promises Suck - then(onFulfill: (...values: any[]) => U, onReject?: (...reasons: any[]) => U, onProgress?: (...progression: any[]) => any): JQueryPromise; - then(onFulfill: (...values: any[]) => JQueryGenericPromise, onReject?: (...reasons: any[]) => U, onProgress?: (...progression: any[]) => any): JQueryPromise; - then(onFulfill: (...values: any[]) => U, onReject?: (...reasons: any[]) => JQueryGenericPromise, onProgress?: (...progression: any[]) => any): JQueryPromise; - then(onFulfill: (...values: any[]) => JQueryGenericPromise, onReject?: (...reasons: any[]) => JQueryGenericPromise, onProgress?: (...progression: any[]) => any): JQueryPromise; + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; } -/* - Interface for the JQuery deferred, part of callbacks -*/ -interface JQueryDeferred extends JQueryPromise { - // Generic versions of callbacks - always(...alwaysCallbacks: T[]): JQueryDeferred; - done(...doneCallbacks: T[]): JQueryDeferred; - fail(...failCallbacks: T[]): JQueryDeferred; - progress(...progressCallbacks: T[]): JQueryDeferred; - - always(...alwaysCallbacks: any[]): JQueryDeferred; - done(...doneCallbacks: any[]): JQueryDeferred; - fail(...failCallbacks: any[]): JQueryDeferred; - progress(...progressCallbacks: any[]): JQueryDeferred; - - notify(...args: any[]): JQueryDeferred; - notifyWith(context: any, ...args: any[]): JQueryDeferred; - - reject(...args: any[]): JQueryDeferred; - rejectWith(context: any, ...args: any[]): JQueryDeferred; - - resolve(val: T): JQueryDeferred; - resolve(...args: any[]): JQueryDeferred; - resolveWith(context: any, ...args: any[]): JQueryDeferred; +/** + * Interface for the JQuery deferred, part of callbacks + */ +interface JQueryDeferred extends JQueryGenericPromise { + /** + * Determine the current state of a Deferred object. + */ state(): string; + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + */ + always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + */ + done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + */ + fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. + */ + progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + + /** + * Call the progressCallbacks on a Deferred object with the given args. + * + * @param args Optional arguments that are passed to the progressCallbacks. + */ + notify(value?: any, ...args: any[]): JQueryDeferred; + + /** + * Call the progressCallbacks on a Deferred object with the given context and args. + * + * @param context Context passed to the progressCallbacks as the this object. + * @param args Optional arguments that are passed to the progressCallbacks. + */ + notifyWith(context: any, value?: any, ...args: any[]): JQueryDeferred; + + /** + * Reject a Deferred object and call any failCallbacks with the given args. + * + * @param args Optional arguments that are passed to the failCallbacks. + */ + reject(value?: any, ...args: any[]): JQueryDeferred; + /** + * Reject a Deferred object and call any failCallbacks with the given context and args. + * + * @param context Context passed to the failCallbacks as the this object. + * @param args An optional array of arguments that are passed to the failCallbacks. + */ + rejectWith(context: any, value?: any, ...args: any[]): JQueryDeferred; + + /** + * Resolve a Deferred object and call any doneCallbacks with the given args. + * + * @param value First argument passed to doneCallbacks. + * @param args Optional subsequent arguments that are passed to the doneCallbacks. + */ + resolve(value?: T, ...args: any[]): JQueryDeferred; + + /** + * Resolve a Deferred object and call any doneCallbacks with the given context and args. + * + * @param context Context passed to the doneCallbacks as the this object. + * @param args An optional array of arguments that are passed to the doneCallbacks. + */ + resolveWith(context: any, value?: T, ...args: any[]): JQueryDeferred; + /** + * Return a Deferred's Promise object. + * + * @param target Object onto which the promise methods have to be attached + */ promise(target?: any): JQueryPromise; -} -/* - Interface of the JQuery extension of the W3C event object -*/ + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; +} +/** + * Interface of the JQuery extension of the W3C event object + */ interface BaseJQueryEventObject extends Event { data: any; delegateTarget: Element; isDefaultPrevented(): boolean; - isImmediatePropogationStopped(): boolean; + isImmediatePropagationStopped(): boolean; isPropagationStopped(): boolean; namespace: string; + originalEvent: Event; preventDefault(): any; relatedTarget: Element; result: any; stopImmediatePropagation(): void; stopPropagation(): void; + target: Element; pageX: number; pageY: number; which: number; @@ -299,11 +487,7 @@ interface JQueryKeyEventObject extends JQueryInputEventObject { keyCode: number; } -interface JQueryPopStateEventObject extends BaseJQueryEventObject { - originalEvent: PopStateEvent; -} - -interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject, JQueryPopStateEventObject { +interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ } /* @@ -333,7 +517,19 @@ interface JQuerySupport { } interface JQueryParam { + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * + * @param obj An array or object to serialize. + */ (obj: any): string; + + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * + * @param obj An array or object to serialize. + * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. + */ (obj: any, traditional: boolean): string; } @@ -348,10 +544,72 @@ interface JQueryEventConstructor { new (name: string, eventProperties?: any): JQueryEventObject; } +/** + * The interface used to specify coordinates. + */ +interface JQueryCoordinates { + left: number; + top: number; +} -/* - Static members of jQuery (those on $ and jQuery themselves) -*/ +/** + * Elements in the array returned by serializeArray() + */ +interface JQuerySerializeArrayElement { + name: string; + value: string; +} + +interface JQueryAnimationOptions { + /** + * A string or number determining how long the animation will run. + */ + duration?: any; + /** + * A string indicating which easing function to use for the transition. + */ + easing?: string; + /** + * A function to call once the animation is complete. + */ + complete?: Function; + /** + * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. + */ + step?: (now: number, tween: any) => any; + /** + * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) + */ + progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any; + /** + * A function to call when the animation begins. (version added: 1.8) + */ + start?: (animation: JQueryPromise) => any; + /** + * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) + */ + done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) + */ + fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) + */ + always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. + */ + queue?: any; + /** + * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) + */ + specialEasing?: Object; +} + +/** + * Static members of jQuery (those on $ and jQuery themselves) + */ interface JQueryStatic { /** @@ -407,16 +665,7 @@ interface JQueryStatic { * @param success A callback function that is executed if the request succeeds. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). */ - get(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - /** - * Load data from the server using a HTTP GET request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). - */ - get(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * Load JSON-encoded data from the server using a GET HTTP request. * @@ -431,15 +680,7 @@ interface JQueryStatic { * @param data A plain object or string that is sent to the server with the request. * @param success A callback function that is executed if the request succeeds. */ - getJSON(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; - /** - * Load JSON-encoded data from the server using a GET HTTP request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. - */ - getJSON(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; /** * Load a JavaScript file from the server using a GET HTTP request, then execute it. * @@ -448,6 +689,9 @@ interface JQueryStatic { */ getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + */ param: JQueryParam; /** @@ -466,16 +710,7 @@ interface JQueryStatic { * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). */ - post(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - /** - * Load data from the server using a HTTP POST request. - * - * @param url A string containing the URL to which the request is sent. - * @param data A plain object or string that is sent to the server with the request. - * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. - * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). - */ - post(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; /** * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. @@ -491,41 +726,87 @@ interface JQueryStatic { */ holdReady(hold: boolean): void; - (selector: string, context?: any): JQuery; + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param selector A string containing a selector expression + * @param context A DOM Element, Document, or jQuery to use as context + */ + (selector: string, context?: Element|JQuery): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param element A DOM element to wrap in a jQuery object. + */ (element: Element): JQuery; - (object: {}): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. + */ (elementArray: Element[]): JQuery; + + /** + * Binds a function to be executed when the DOM has finished loading. + * + * @param callback A function to execute after the DOM is ready. + */ + (callback: (jQueryAlias?: JQueryStatic) => any): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param object A plain object to wrap in a jQuery object. + */ + (object: {}): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param object An existing jQuery object to clone. + */ (object: JQuery): JQuery; - (func: Function): JQuery; - (array: any[]): JQuery; + + /** + * Specify a function to execute when the DOM is fully loaded. + */ (): JQuery; /** - * Relinquish jQuery's control of the $ variable. + * Creates DOM elements on the fly from the provided string of raw HTML. * - * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). + * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. + * @param ownerDocument A document in which the new elements will be created. */ - noConflict(removeAll?: boolean): Object; + (html: string, ownerDocument?: Document): JQuery; /** - * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. + * Creates DOM elements on the fly from the provided string of raw HTML. * - * @param deferreds One or more Deferred objects, or plain JavaScript objects. + * @param html A string defining a single, standalone, HTML element (e.g.
or
). + * @param attributes An object of attributes, events, and methods to call on the newly-created element. */ - when(...deferreds: JQueryGenericPromise[]): JQueryPromise; + (html: string, attributes: Object): JQuery; + /** - * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. + * Relinquish jQuery's control of the $ variable. * - * @param deferreds One or more Deferred objects, or plain JavaScript objects. + * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). */ - when(...deferreds: T[]): JQueryPromise; + noConflict(removeAll?: boolean): Object; + /** * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. * * @param deferreds One or more Deferred objects, or plain JavaScript objects. */ - when(...deferreds: any[]): JQueryPromise; + when(...deferreds: Array/* as JQueryDeferred */>): JQueryPromise; + /** + * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. + */ cssHooks: { [key: string]: any; }; cssNumber: any; @@ -551,90 +832,302 @@ interface JQueryStatic { */ data(element: Element): any; - dequeue(element: Element, queueName?: string): any; + /** + * Execute the next function on the queue for the matched element. + * + * @param element A DOM element from which to remove and execute a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + dequeue(element: Element, queueName?: string): void; + /** + * Determine whether an element has any jQuery data associated with it. + * + * @param element A DOM element to be checked for data. + */ hasData(element: Element): boolean; - queue(element: Element, queueName?: string): any[]; - queue(element: Element, queueName: string, newQueueOrCallback: any): JQuery; + /** + * Show the queue of functions to be executed on the matched element. + * + * @param element A DOM element to inspect for an attached queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + queue(element: Element, queueName?: string): any[]; + /** + * Manipulate the queue of functions to be executed on the matched element. + * + * @param element A DOM element where the array of queued functions is attached. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(element: Element, queueName: string, newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed on the matched element. + * + * @param element A DOM element on which to add a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param callback The new function to add to the queue. + */ + queue(element: Element, queueName: string, callback: Function): JQuery; + /** + * Remove a previously-stored piece of data. + * + * @param element A DOM element from which to remove data. + * @param name A string naming the piece of data to remove. + */ removeData(element: Element, name?: string): JQuery; - // Deferred + /** + * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. + * + * @param beforeStart A function that is called just before the constructor returns. + */ Deferred(beforeStart?: (deferred: JQueryDeferred) => any): JQueryDeferred; - // Effects - fx: { tick: () => void; interval: number; stop: () => void; speeds: { slow: number; fast: number; }; off: boolean; step: any; }; + /** + * Effects + */ + fx: { + tick: () => void; + /** + * The rate (in milliseconds) at which animations fire. + */ + interval: number; + stop: () => void; + speeds: { slow: number; fast: number; }; + /** + * Globally disable all animations. + */ + off: boolean; + step: any; + }; - // Events - proxy(fn: (...args: any[]) => any, context: any, ...args: any[]): any; - proxy(context: any, name: string, ...args: any[]): any; + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param fnction The function whose context will be changed. + * @param context The object to which the context (this) of the function should be set. + * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. + */ + proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any; + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param context The object to which the context (this) of the function should be set. + * @param name The name of the function whose context will be changed (should be a property of the context object). + * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. + */ + proxy(context: Object, name: string, ...additionalArguments: any[]): any; Event: JQueryEventConstructor; - // Internals + /** + * Takes a string and throws an exception containing it. + * + * @param message The message to send out. + */ error(message: any): JQuery; - // Miscellaneous expr: any; fn: any; //TODO: Decide how we want to type this + isReady: boolean; // Properties support: JQuerySupport; - // Utilities + /** + * Check to see if a DOM element is a descendant of another DOM element. + * + * @param container The DOM element that may contain the other element. + * @param contained The DOM element that may be contained by (a descendant of) the other element. + */ contains(container: Element, contained: Element): boolean; - each(collection: any, callback: (indexInArray: any, valueOfElement: any) => any): any; - each(collection: JQuery, callback: (indexInArray: number, valueOfElement: HTMLElement) => any): any; - each(collection: T[], callback: (indexInArray: number, valueOfElement: T) => any): any; + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + */ + each( + collection: T[], + callback: (indexInArray: number, valueOfElement: T) => any + ): any; + + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + */ + each( + collection: any, + callback: (indexInArray: any, valueOfElement: any) => any + ): any; - extend(target: any, ...objs: any[]): any; - extend(deep: boolean, target: any, ...objs: any[]): any; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + */ + extend(target: any, object1?: any, ...objectN: any[]): any; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param deep If true, the merge becomes recursive (aka. deep copy). + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + */ + extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any; + /** + * Execute some JavaScript code globally. + * + * @param code The JavaScript code to execute. + */ globalEval(code: string): any; + /** + * Finds the elements of an array which satisfy a filter function. The original array is not affected. + * + * @param array The array to search through. + * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. + * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false. + */ grep(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[]; + /** + * Search for a specified value within an array and return its index (or -1 if not found). + * + * @param value The value to search for. + * @param array An array through which to search. + * @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array. + */ inArray(value: T, array: T[], fromIndex?: number): number; + /** + * Determine whether the argument is an array. + * + * @param obj Object to test whether or not it is an array. + */ isArray(obj: any): boolean; + /** + * Check to see if an object is empty (contains no enumerable properties). + * + * @param obj The object that will be checked to see if it's empty. + */ isEmptyObject(obj: any): boolean; + /** + * Determine if the argument passed is a Javascript function object. + * + * @param obj Object to test whether or not it is a function. + */ isFunction(obj: any): boolean; + /** + * Determines whether its argument is a number. + * + * @param obj The value to be tested. + */ isNumeric(value: any): boolean; + /** + * Check to see if an object is a plain object (created using "{}" or "new Object"). + * + * @param obj The object that will be checked to see if it's a plain object. + */ isPlainObject(obj: any): boolean; + /** + * Determine whether the argument is a window. + * + * @param obj Object to test whether or not it is a window. + */ isWindow(obj: any): boolean; + /** + * Check to see if a DOM node is within an XML document (or is an XML document). + * + * @param node he DOM node that will be checked to see if it's in an XML document. + */ isXMLDoc(node: Node): boolean; + /** + * Convert an array-like object into a true JavaScript array. + * + * @param obj Any object to turn into a native Array. + */ makeArray(obj: any): any[]; + /** + * Translate all items in an array or object to new array of items. + * + * @param array The Array to translate. + * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. + */ map(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[]; - map(array: any, callback: (elementOfArray: any, indexInArray: any) => any): any; + /** + * Translate all items in an array or object to new array of items. + * + * @param arrayOrObject The Array or Object to translate. + * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. + */ + map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any; + /** + * Merge the contents of two arrays together into the first array. + * + * @param first The first array to merge, the elements of second added. + * @param second The second array to merge into the first, unaltered. + */ merge(first: T[], second: T[]): T[]; - merge(first: T[], second: U[]): any[]; + /** + * An empty function. + */ noop(): any; + /** + * Return a number representing the current time. + */ now(): number; + /** + * Takes a well-formed JSON string and returns the resulting JavaScript object. + * + * @param json The JSON string to parse. + */ parseJSON(json: string): any; /** * Parses a string into an XML document. * - * @param dataa well-formed XML string to be parsed + * @param data a well-formed XML string to be parsed */ parseXML(data: string): XMLDocument; - queue(element: Element, queueName: string, newQueue: any[]): JQuery; - + /** + * Remove the whitespace from the beginning and end of a string. + * + * @param str Remove the whitespace from the beginning and end of a string. + */ trim(str: string): string; + /** + * Determine the internal JavaScript [[Class]] of an object. + * + * @param obj Object to get the internal JavaScript [[Class]] of. + */ type(obj: any): string; - unique(arr: any[]): any[]; + /** + * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. + * + * @param array The Array of DOM elements. + */ + unique(array: Element[]): Element[]; /** * Parses a string into an array of DOM nodes. @@ -645,117 +1138,262 @@ interface JQueryStatic { */ parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; - Animation(elem: any, properties: any, options: any): any; - + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context DOM element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + */ + parseHTML(data: string, context?: Document, keepScripts?: boolean): any[]; } -/* - The jQuery instance members -*/ +/** + * The jQuery instance members + */ interface JQuery { - // AJAX - ajaxComplete(handler: any): JQuery; - ajaxError(handler: (event: any, jqXHR: any, settings: any, exception: any) => any): JQuery; - ajaxSend(handler: (event: any, jqXHR: any, settings: any, exception: any) => any): JQuery; + /** + * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. + * + * @param handler The function to be invoked. + */ + ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery; + /** + * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery; + /** + * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery; + /** + * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ ajaxStart(handler: () => any): JQuery; + /** + * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ ajaxStop(handler: () => any): JQuery; - ajaxSuccess(handler: (event: any, jqXHR: any, settings: any, exception: any) => any): JQuery; + /** + * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery; - load(url: string, data?: any, complete?: any): JQuery; + /** + * Load data from the server and place the returned HTML into the matched element. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param complete A callback function that is executed when the request completes. + */ + load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; + /** + * Encode a set of form elements as a string for submission. + */ serialize(): string; - serializeArray(): any[]; + /** + * Encode a set of form elements as an array of names and values. + */ + serializeArray(): JQuerySerializeArrayElement[]; - // Attributes - addClass(classNames: string): JQuery; - addClass(func: (index: any, currentClass: any) => string): JQuery; + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param className One or more space-separated classes to be added to the class attribute of each matched element. + */ + addClass(className: string): JQuery; + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param function A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. + */ + addClass(func: (index: number, className: string) => string): JQuery; - // http://api.jquery.com/addBack/ + /** + * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. + */ addBack(selector?: string): JQuery; - + /** + * Get the value of an attribute for the first element in the set of matched elements. + * + * @param attributeName The name of the attribute to get. + */ attr(attributeName: string): string; - attr(attributeName: string, value: any): JQuery; - attr(attributeName: string, func: (index: any, attr: any) => any): JQuery; - attr(map: any): JQuery; - + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributeName The name of the attribute to set. + * @param value A value to set for the attribute. + */ + attr(attributeName: string, value: string|number): JQuery; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributeName The name of the attribute to set. + * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. + */ + attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributes An object of attribute-value pairs to set. + */ + attr(attributes: Object): JQuery; + + /** + * Determine whether any of the matched elements are assigned the given class. + * + * @param className The class name to search for. + */ hasClass(className: string): boolean; + /** + * Get the HTML contents of the first element in the set of matched elements. + */ html(): string; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param htmlString A string of HTML to set as the content of each matched element. + */ html(htmlString: string): JQuery; - html(htmlContent: (index: number, oldhtml: string) => string): JQuery; - html(obj: JQuery): JQuery; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. + */ + html(func: (index: number, oldhtml: string) => string): JQuery; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. + */ + /** + * Get the value of a property for the first element in the set of matched elements. + * + * @param propertyName The name of the property to get. + */ prop(propertyName: string): any; - prop(propertyName: string, value: any): JQuery; - prop(map: any): JQuery; - prop(propertyName: string, func: (index: any, oldPropertyValue: any) => any): JQuery; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param value A value to set for the property. + */ + prop(propertyName: string, value: string|number|boolean): JQuery; + /** + * Set one or more properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + */ + prop(properties: Object): JQuery; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. + */ + prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery; + /** + * Remove an attribute from each element in the set of matched elements. + * + * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. + */ removeAttr(attributeName: string): JQuery; + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * + * @param className One or more space-separated classes to be removed from the class attribute of each matched element. + */ removeClass(className?: string): JQuery; - removeClass(func: (index: any, cls: any) => any): JQuery; + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * + * @param function A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. + */ + removeClass(func: (index: number, className: string) => string): JQuery; + /** + * Remove a property for the set of matched elements. + * + * @param propertyName The name of the property to remove. + */ removeProp(propertyName: string): JQuery; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. + * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. + */ toggleClass(className: string, swtch?: boolean): JQuery; - toggleClass(swtch?: boolean): JQuery; - toggleClass(func: (index: any, cls: any, swtch: any) => any): JQuery; - - val(): any; - val(value: string[]): JQuery; - val(value: string): JQuery; - val(value: number): JQuery; - val(func: (index: any, value: any) => any): JQuery; - /** - * Get the value of style properties for the first element in the set of matched elements. + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. * - * @param propertyName A CSS property. + * @param swtch A boolean value to determine whether the class should be added or removed. */ - css(propertyName: string): string; + toggleClass(swtch?: boolean): JQuery; /** - * Set one or more CSS properties for the set of matched elements. + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. * - * @param propertyName A CSS property name. - * @param value A value to set for the property. + * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. + * @param swtch A boolean value to determine whether the class should be added or removed. */ - css(propertyName: string, value: string): JQuery; + toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery; + /** - * Set one or more CSS properties for the set of matched elements. + * Get the current value of the first element in the set of matched elements. + */ + val(): any; + /** + * Set the value of each element in the set of matched elements. * - * @param propertyName A CSS property name. - * @param value A value to set for the property. + * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. */ - css(propertyName: string, value: number): JQuery; + val(value: string|string[]): JQuery; /** - * Set one or more CSS properties for the set of matched elements. + * Set the value of each element in the set of matched elements. * - * @param propertyName A CSS property name. - * @param value A value to set for the property. + * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */ - css(propertyName: string, value: string[]): JQuery; + val(func: (index: number, value: string) => string): JQuery; + + /** - * Set one or more CSS properties for the set of matched elements. + * Get the value of style properties for the first element in the set of matched elements. * - * @param propertyName A CSS property name. - * @param value A value to set for the property. + * @param propertyName A CSS property. */ - css(propertyName: string, value: number[]): JQuery; + css(propertyName: string): string; /** * Set one or more CSS properties for the set of matched elements. * * @param propertyName A CSS property name. - * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + * @param value A value to set for the property. */ - css(propertyName: string, value: (index: number, value: string) => string): JQuery; + css(propertyName: string, value: string|number): JQuery; /** * Set one or more CSS properties for the set of matched elements. * * @param propertyName A CSS property name. * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. */ - css(propertyName: string, value: (index: number, value: number) => number): JQuery; + css(propertyName: string, value: (index: number, value: string) => string|number): JQuery; /** * Set one or more CSS properties for the set of matched elements. * @@ -763,104 +1401,526 @@ interface JQuery { */ css(properties: Object): JQuery; + /** + * Get the current computed height for the first element in the set of matched elements. + */ height(): number; - height(value: number): JQuery; - height(value: string): JQuery; - height(func: (index: any, height: any) => any): JQuery; + /** + * Set the CSS height of every matched element. + * + * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). + */ + height(value: number|string): JQuery; + /** + * Set the CSS height of every matched element. + * + * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. + */ + height(func: (index: number, height: number) => number|string): JQuery; + /** + * Get the current computed height for the first element in the set of matched elements, including padding but not border. + */ innerHeight(): number; - innerHeight(value: number): JQuery; + /** + * Sets the inner height on elements in the set of matched elements, including padding but not border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + innerHeight(height: number|string): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements, including padding but not border. + */ innerWidth(): number; - innerWidth(value: number): JQuery; - offset(): { left: number; top: number; }; - offset(coordinates: any): JQuery; - offset(func: (index: any, coords: any) => any): JQuery; + /** + * Sets the inner width on elements in the set of matched elements, including padding but not border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + innerWidth(width: number|string): JQuery; + + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the document. + */ + offset(): JQueryCoordinates; + /** + * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + * + * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + */ + offset(coordinates: JQueryCoordinates): JQuery; + /** + * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + * + * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. + */ + offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery; + /** + * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + */ outerHeight(includeMargin?: boolean): number; - outerHeight(value: number, includeMargin?: boolean): JQuery; + /** + * Sets the outer height on elements in the set of matched elements, including padding and border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + outerHeight(height: number|string): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements, including padding and border. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + */ outerWidth(includeMargin?: boolean): number; - outerWidth(value: number, includeMargin?: boolean): JQuery; - position(): { top: number; left: number; }; + /** + * Sets the outer width on elements in the set of matched elements, including padding and border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + outerWidth(width: number|string): JQuery; + + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. + */ + position(): JQueryCoordinates; + /** + * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element. + */ scrollLeft(): number; + /** + * Set the current horizontal position of the scroll bar for each of the set of matched elements. + * + * @param value An integer indicating the new position to set the scroll bar to. + */ scrollLeft(value: number): JQuery; + /** + * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. + */ scrollTop(): number; + /** + * Set the current vertical position of the scroll bar for each of the set of matched elements. + * + * @param value An integer indicating the new position to set the scroll bar to. + */ scrollTop(value: number): JQuery; + /** + * Get the current computed width for the first element in the set of matched elements. + */ width(): number; - width(value: number): JQuery; - width(value: string): JQuery; - width(func: (index: any, height: any) => any): JQuery; + /** + * Set the CSS width of each element in the set of matched elements. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + width(value: number|string): JQuery; + /** + * Set the CSS width of each element in the set of matched elements. + * + * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. + */ + width(func: (index: number, width: number) => number|string): JQuery; - // Data + /** + * Remove from the queue all items that have not yet been run. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ clearQueue(queueName?: string): JQuery; + /** + * Store arbitrary data associated with the matched elements. + * + * @param key A string naming the piece of data to set. + * @param value The new data value; it can be any Javascript type including Array or Object. + */ data(key: string, value: any): JQuery; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + * + * @param key Name of the data stored. + */ + data(key: string): any; + /** + * Store arbitrary data associated with the matched elements. + * + * @param obj An object of key-value pairs of data to update. + */ data(obj: { [key: string]: any; }): JQuery; - data(key?: string): any; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + */ + data(): any; + /** + * Execute the next function on the queue for the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ dequeue(queueName?: string): JQuery; - removeData(nameOrList?: any): JQuery; + /** + * Remove a previously-stored piece of data. + * + * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete. + */ + removeData(name: string): JQuery; + /** + * Remove a previously-stored piece of data. + * + * @param list An array of strings naming the pieces of data to delete. + */ + removeData(list: string[]): JQuery; - // Deferred - promise(type?: any, target?: any): JQueryPromise; + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. + * + * @param type The type of queue that needs to be observed. (default: fx) + * @param target Object onto which the promise methods have to be attached + */ + promise(type?: string, target?: Object): JQueryPromise; - // Effects - animate(properties: any, duration?: any, complete?: Function): JQuery; - animate(properties: any, duration?: any, easing?: string, complete?: Function): JQuery; - animate(properties: any, options: { duration?: any; easing?: string; complete?: Function; step?: Function; queue?: boolean; specialEasing?: any; }): JQuery; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + animate(properties: Object, duration?: string|number, complete?: Function): JQuery; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. (default: swing) + * @param complete A function to call once the animation is complete. + */ + animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param options A map of additional options to pass to the method. + */ + animate(properties: Object, options: JQueryAnimationOptions): JQuery; + /** + * Set a timer to delay execution of subsequent items in the queue. + * + * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ delay(duration: number, queueName?: string): JQuery; - fadeIn(duration?: any, callback?: any): JQuery; - fadeIn(duration?: any, easing?: string, callback?: any): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeIn(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param options A map of additional options to pass to the method. + */ + fadeIn(options: JQueryAnimationOptions): JQuery; - fadeOut(duration?: any, callback?: any): JQuery; - fadeOut(duration?: any, easing?: string, callback?: any): JQuery; + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeOut(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements by fading them to transparent. + * + * @param options A map of additional options to pass to the method. + */ + fadeOut(options: JQueryAnimationOptions): JQuery; - fadeTo(duration: any, opacity: number, callback?: any): JQuery; - fadeTo(duration: any, opacity: number, easing?: string, callback?: any): JQuery; + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param complete A function to call once the animation is complete. + */ + fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery; + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery; - fadeToggle(duration?: any, callback?: any): JQuery; - fadeToggle(duration?: any, easing?: string, callback?: any): JQuery; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeToggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param options A map of additional options to pass to the method. + */ + fadeToggle(options: JQueryAnimationOptions): JQuery; - finish(): JQuery; + /** + * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. + * + * @param queue The name of the queue in which to stop animations. + */ + finish(queue?: string): JQuery; - hide(duration?: any, callback?: any): JQuery; - hide(duration?: any, easing?: string, callback?: any): JQuery; + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + hide(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + hide(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + hide(options: JQueryAnimationOptions): JQuery; - show(duration?: any, callback?: any): JQuery; - show(duration?: any, easing?: string, callback?: any): JQuery; + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + show(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + show(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + show(options: JQueryAnimationOptions): JQuery; - slideDown(duration?: any, callback?: any): JQuery; - slideDown(duration?: any, easing?: string, callback?: any): JQuery; + /** + * Display the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideDown(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideDown(options: JQueryAnimationOptions): JQuery; - slideToggle(duration?: any, callback?: any): JQuery; - slideToggle(duration?: any, easing?: string, callback?: any): JQuery; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideToggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideToggle(options: JQueryAnimationOptions): JQuery; - slideUp(duration?: any, callback?: any): JQuery; - slideUp(duration?: any, easing?: string, callback?: any): JQuery; + /** + * Hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideUp(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideUp(options: JQueryAnimationOptions): JQuery; + /** + * Stop the currently-running animation on the matched elements. + * + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + */ stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery; - stop(queue?: any, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; + /** + * Stop the currently-running animation on the matched elements. + * + * @param queue The name of the queue in which to stop animations. + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + */ + stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; - toggle(duration?: any, callback?: any): JQuery; - toggle(duration?: any, easing?: string, callback?: any): JQuery; + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + toggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + toggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + toggle(options: JQueryAnimationOptions): JQuery; + /** + * Display or hide the matched elements. + * + * @param showOrHide A Boolean indicating whether to show or hide the elements. + */ toggle(showOrHide: boolean): JQuery; - // Events - bind(eventType: string, eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + */ + bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + */ bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + */ bind(eventType: string, preventBubble: boolean): JQuery; - bind(...events: any[]): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param events An object containing one or more DOM event types and functions to execute for them. + */ + bind(events: any): JQuery; + /** + * Trigger the "blur" event on an element + */ + blur(): JQuery; + /** + * Bind an event handler to the "blur" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ blur(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "blur" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; /** @@ -918,6 +1978,7 @@ interface JQuery { dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; /** * Trigger the "focus" event on an element. @@ -990,7 +2051,7 @@ interface JQuery { */ keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; /** - * Bind an event handler to the keydown"" JavaScript event + * Bind an event handler to the "keydown" JavaScript event * * @param eventData An object containing data that will be passed to the event handler. * @param handler A function to execute each time the event is triggered. @@ -1204,9 +2265,17 @@ interface JQuery { * Attach an event handler function for one or more events to the selected elements. * * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". - * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax). */ - on(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * @@ -1214,7 +2283,7 @@ interface JQuery { * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. */ - on(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * @@ -1223,7 +2292,7 @@ interface JQuery { * @param data Data to be passed to the handler in event.data when an event is triggered. * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. */ - on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; /** * Attach an event handler function for one or more events to the selected elements. * @@ -1231,7 +2300,14 @@ interface JQuery { * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. * @param data Data to be passed to the handler in event.data when an event occurs. */ - on(events: { [key: string]: any; }, selector?: any, data?: any): JQuery; + on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + on(events: { [key: string]: any; }, data?: any): JQuery; /** * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. @@ -1276,13 +2352,21 @@ interface JQuery { */ one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + one(events: { [key: string]: any; }, data?: any): JQuery; + /** * Specify a function to execute when the DOM is fully loaded. * * @param handler A function to execute after the DOM is ready. */ - ready(handler: Function): JQuery; + ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery; /** * Trigger the "resize" event on an element. @@ -1356,179 +2440,736 @@ interface JQuery { */ submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - trigger(eventType: string, ...extraParameters: any[]): JQuery; - trigger(event: JQueryEventObject): JQuery; + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters Additional parameters to pass along to the event handler. + */ + trigger(eventType: string, extraParameters?: any[]|Object): JQuery; + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param event A jQuery.Event object. + * @param extraParameters Additional parameters to pass along to the event handler. + */ + trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery; + /** + * Execute all handlers attached to an element for an event. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters An array of additional parameters to pass along to the event handler. + */ triggerHandler(eventType: string, ...extraParameters: any[]): Object; + /** + * Execute all handlers attached to an element for an event. + * + * @param event A jQuery.Event object. + * @param extraParameters An array of additional parameters to pass along to the event handler. + */ + triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object; + + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param handler The function that is to be no longer executed. + */ unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). + */ unbind(eventType: string, fls: boolean): JQuery; + /** + * Remove a previously-attached event handler from the elements. + * + * @param evt A JavaScript event object as passed to an event handler. + */ unbind(evt: any): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + */ undelegate(): JQuery; - undelegate(selector: any, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; - undelegate(selector: any, events: any): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" + * @param handler A function to execute at the time the event is triggered. + */ + undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param events An object of one or more event types and previously bound functions to unbind from them. + */ + undelegate(selector: string, events: Object): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param namespace A string containing a namespace to unbind all events from. + */ undelegate(namespace: string): JQuery; + /** + * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) + * + * @param handler A function to execute when the event is triggered. + */ unload(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) + * + * @param eventData A plain object of data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; - // Internals + /** + * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10) + */ context: Element; + jquery: string; + /** + * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) + * + * @param handler A function to execute when the event is triggered. + */ error(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) + * + * @param eventData A plain object of data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + */ pushStack(elements: any[]): JQuery; - pushStack(elements: any[], name: any, arguments: any): JQuery; + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + * @param name The name of a jQuery method that generated the array of elements. + * @param arguments The arguments that were passed in to the jQuery method (for serialization). + */ + pushStack(elements: any[], name: string, arguments: any[]): JQuery; - // Manipulation - after(...content: any[]): JQuery; - after(func: (index: any) => any): JQuery; + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. + */ + after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + after(func: (index: number, html: string) => string|Element|JQuery): JQuery; - append(...content: any[]): JQuery; - append(func: (index: any, html: any) => any): JQuery; + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. + */ + append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + */ + append(func: (index: number, html: string) => string|Element|JQuery): JQuery; - appendTo(target: any): JQuery; + /** + * Insert every element in the set of matched elements to the end of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. + */ + appendTo(target: JQuery|any[]|Element|string): JQuery; - before(...content: any[]): JQuery; - before(func: (index: any) => any): JQuery; + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. + */ + before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + before(func: (index: number, html: string) => string|Element|JQuery): JQuery; + /** + * Create a deep copy of the set of matched elements. + * + * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. + * param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false). + */ clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery; - detach(selector?: any): JQuery; + /** + * Remove the set of matched elements from the DOM. + * + * param selector A selector expression that filters the set of matched elements to be removed. + */ + detach(selector?: string): JQuery; + /** + * Remove all child nodes of the set of matched elements from the DOM. + */ empty(): JQuery; - insertAfter(target: any): JQuery; - insertBefore(target: any): JQuery; + /** + * Insert every element in the set of matched elements after the target. + * + * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. + */ + insertAfter(target: JQuery|any[]|Element|Text|string): JQuery; + + /** + * Insert every element in the set of matched elements before the target. + * + * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. + */ + insertBefore(target: JQuery|any[]|Element|Text|string): JQuery; - prepend(...content: any[]): JQuery; - prepend(func: (index: any, html: any) => any): JQuery; + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. + */ + prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + */ + prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery; - prependTo(target: any): JQuery; + /** + * Insert every element in the set of matched elements to the beginning of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. + */ + prependTo(target: JQuery|any[]|Element|string): JQuery; - remove(selector?: any): JQuery; + /** + * Remove the set of matched elements from the DOM. + * + * @param selector A selector expression that filters the set of matched elements to be removed. + */ + remove(selector?: string): JQuery; - replaceAll(target: any): JQuery; + /** + * Replace each target element with the set of matched elements. + * + * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. + */ + replaceAll(target: JQuery|any[]|Element|string): JQuery; - replaceWith(func: any): JQuery; + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * + * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. + */ + replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery; + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * + * param func A function that returns content with which to replace the set of matched elements. + */ + replaceWith(func: () => Element|JQuery): JQuery; + /** + * Get the combined text contents of each element in the set of matched elements, including their descendants. + */ text(): string; - text(textString: any): JQuery; - text(textString: (index: number, text: string) => string): JQuery; + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation. + */ + text(text: string|number|boolean): JQuery; + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. + */ + text(func: (index: number, text: string) => string): JQuery; + /** + * Retrieve all the elements contained in the jQuery set, as an array. + */ toArray(): any[]; + /** + * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. + */ unwrap(): JQuery; - wrap(wrappingElement: any): JQuery; - wrap(func: (index: any) => any): JQuery; + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + */ + wrap(wrappingElement: JQuery|Element|string): JQuery; + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + wrap(func: (index: number) => string|JQuery): JQuery; - wrapAll(wrappingElement: any): JQuery; + /** + * Wrap an HTML structure around all elements in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + */ + wrapAll(wrappingElement: JQuery|Element|string): JQuery; + wrapAll(func: (index: number) => string): JQuery; - wrapInner(wrappingElement: any): JQuery; - wrapInner(func: (index: any) => any): JQuery; + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * + * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. + */ + wrapInner(wrappingElement: JQuery|Element|string): JQuery; + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * + * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + wrapInner(func: (index: number) => string): JQuery; - // Miscellaneous - each(func: (index: any, elem: Element) => any): JQuery; + /** + * Iterate over a jQuery object, executing a function for each matched element. + * + * @param func A function to execute for each matched element. + */ + each(func: (index: number, elem: Element) => any): JQuery; - get(index?: number): any; + /** + * Retrieve one of the elements matched by the jQuery object. + * + * @param index A zero-based integer indicating which element to retrieve. + */ + get(index: number): HTMLElement; + /** + * Retrieve the elements matched by the jQuery object. + */ + get(): any[]; + /** + * Search for a given element from among the matched elements. + */ index(): number; - index(selector: string): number; - index(element: any): number; + /** + * Search for a given element from among the matched elements. + * + * @param selector A selector representing a jQuery collection in which to look for an element. + */ + index(selector: string|JQuery|Element): number; - // Properties + /** + * The number of elements in the jQuery object. + */ length: number; + /** + * A selector representing selector passed to jQuery(), if any, when creating the original set. + * version deprecated: 1.7, removed: 1.9 + */ selector: string; - [x: string]: any; - [x: number]: HTMLElement; + [index: string]: any; + [index: number]: HTMLElement; - // Traversing - add(selector: string, context?: any): JQuery; - add(...elements: any[]): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. + * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. + */ + add(selector: string, context?: Element): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param elements One or more elements to add to the set of matched elements. + */ + add(...elements: Element[]): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param html An HTML fragment to add to the set of matched elements. + */ add(html: string): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param obj An existing jQuery object to add to the set of matched elements. + */ add(obj: JQuery): JQuery; - children(selector?: any): JQuery; + /** + * Get the children of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + children(selector?: string): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + */ closest(selector: string): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. + */ closest(selector: string, context?: Element): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param obj A jQuery object to match elements against. + */ closest(obj: JQuery): JQuery; - closest(element: any): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param element An element to match elements against. + */ + closest(element: Element): JQuery; + + /** + * Get an array of all the elements and selectors matched against the current element up through the DOM tree. + * + * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object). + * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. + */ closest(selectors: any, context?: Element): any[]; + /** + * Get the children of each element in the set of matched elements, including text and comment nodes. + */ contents(): JQuery; + /** + * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. + */ end(): JQuery; + /** + * Reduce the set of matched elements to the one at the specified index. + * + * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set. + * + */ eq(index: number): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param selector A string containing a selector expression to match the current set of elements against. + */ filter(selector: string): JQuery; - filter(func: (index: any) => any): JQuery; - filter(element: any): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param func A function used as a test for each element in the set. this is the current DOM element. + */ + filter(func: (index: number, element: Element) => any): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param element An element to match the current set of elements against. + */ + filter(element: Element): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ filter(obj: JQuery): JQuery; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param selector A string containing a selector expression to match elements against. + */ find(selector: string): JQuery; - find(element: any): JQuery; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param element An element to match elements against. + */ + find(element: Element): JQuery; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param obj A jQuery object to match elements against. + */ find(obj: JQuery): JQuery; + /** + * Reduce the set of matched elements to the first in the set. + */ first(): JQuery; + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + */ has(selector: string): JQuery; + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param contained A DOM element to match elements against. + */ has(contained: Element): JQuery; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + */ is(selector: string): boolean; - is(func: (index: any) => any): boolean; - is(element: any): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. + */ + is(func: (index: number, element: Element) => boolean): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ is(obj: JQuery): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + */ + is(elements: any): boolean; + /** + * Reduce the set of matched elements to the final one in the set. + */ last(): JQuery; - map(callback: (index: any, domElement: Element) => any): JQuery; + /** + * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. + * + * @param callback A function object that will be invoked for each element in the current set. + */ + map(callback: (index: number, domElement: Element) => any): JQuery; + /** + * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. + * + * @param selector A string containing a selector expression to match elements against. + */ next(selector?: string): JQuery; + /** + * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ nextAll(selector?: string): JQuery; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ nextUntil(selector?: string, filter?: string): JQuery; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ nextUntil(element?: Element, filter?: string): JQuery; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ nextUntil(obj?: JQuery, filter?: string): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param selector A string containing a selector expression to match elements against. + */ not(selector: string): JQuery; - not(func: (index: any) => any): JQuery; - not(element: any): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param func A function used as a test for each element in the set. this is the current DOM element. + */ + not(func: (index: number, element: Element) => boolean): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param elements One or more DOM elements to remove from the matched set. + */ + not(...elements: Element[]): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ not(obj: JQuery): JQuery; + /** + * Get the closest ancestor element that is positioned. + */ offsetParent(): JQuery; + /** + * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ parent(selector?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ parents(selector?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ parentsUntil(selector?: string, filter?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ parentsUntil(element?: Element, filter?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ parentsUntil(obj?: JQuery, filter?: string): JQuery; + /** + * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ prev(selector?: string): JQuery; + /** + * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ prevAll(selector?: string): JQuery; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ prevUntil(selector?: string, filter?: string): JQuery; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ prevUntil(element?: Element, filter?: string): JQuery; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ prevUntil(obj?: JQuery, filter?: string): JQuery; + /** + * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ siblings(selector?: string): JQuery; + /** + * Reduce the set of matched elements to a subset specified by a range of indices. + * + * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set. + * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. + */ slice(start: number, end?: number): JQuery; - // Utilities - + /** + * Show the queue of functions to be executed on the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ queue(queueName?: string): any[]; - queue(queueName: string, newQueueOrCallback: any): JQuery; - queue(newQueueOrCallback: any): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. + */ + queue(callback: Function): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(queueName: string, newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. + */ + queue(queueName: string, callback: Function): JQuery; } declare module "jquery" { export = $; diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/TypeScript/Typings/jqueryui.d.ts b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/TypeScript/Typings/jqueryui.d.ts index 0a403ea52a6..738b0e0057a 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/TypeScript/Typings/jqueryui.d.ts +++ b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Assets/TypeScript/Typings/jqueryui.d.ts @@ -1,6 +1,6 @@ // Type definitions for jQueryUI 1.9 // Project: http://jqueryui.com/ -// Definitions by: Boris Yankov +// Definitions by: Boris Yankov , John Reilly // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -9,7 +9,7 @@ declare module JQueryUI { // Accordion ////////////////////////////////////////////////// - interface AccordionOptions { + interface AccordionOptions extends AccordionEvents { active?: any; // boolean or number animate?: any; // boolean, number, string or object collapsible?: boolean; @@ -37,13 +37,13 @@ declare module JQueryUI { create?: AccordionEvent; } - interface Accordion extends Widget, AccordionOptions, AccordionEvents { + interface Accordion extends Widget, AccordionOptions { } // Autocomplete ////////////////////////////////////////////////// - interface AutocompleteOptions { + interface AutocompleteOptions extends AutocompleteEvents { appendTo?: any; //Selector; autoFocus?: boolean; delay?: number; @@ -54,7 +54,10 @@ declare module JQueryUI { } interface AutocompleteUIParams { - + /** + * The item selected from the menu, if any. Otherwise the property is null + */ + item?: any; } interface AutocompleteEvent { @@ -72,8 +75,8 @@ declare module JQueryUI { select?: AutocompleteEvent; } - interface Autocomplete extends Widget, AutocompleteOptions, AutocompleteEvents { - escapeRegex: (string) => string; + interface Autocomplete extends Widget, AutocompleteOptions { + escapeRegex: (value: string) => string; } @@ -83,7 +86,8 @@ declare module JQueryUI { disabled?: boolean; icons?: any; label?: string; - text?: boolean; + text?: string|boolean; + click?: (event?: Event) => void; } interface Button extends Widget, ButtonOptions { @@ -93,55 +97,227 @@ declare module JQueryUI { // Datepicker ////////////////////////////////////////////////// interface DatepickerOptions { - altFieldType?: any; // Selecotr, jQuery or Element + /** + * An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field. + */ + altField?: any; // Selector, jQuery or Element + /** + * The dateFormat to be used for the altField option. This allows one date format to be shown to the user for selection purposes, while a different format is actually sent behind the scenes. For a full list of the possible formats see the formatDate function + */ altFormat?: string; + /** + * The text to display after each date field, e.g., to show the required format. + */ appendText?: string; + /** + * Set to true to automatically resize the input field to accommodate dates in the current dateFormat. + */ autoSize?: boolean; - beforeShow?: (input: Element, inst: any) => void; - beforeShowDay?: (date: Date) => void; + /** + * A function that takes an input field and current datepicker instance and returns an options object to update the datepicker with. It is called just before the datepicker is displayed. + */ + beforeShow?: (input: Element, inst: any) => JQueryUI.DatepickerOptions; + /** + * A function that takes a date as a parameter and must return an array with: + * [0]: true/false indicating whether or not this date is selectable + * [1]: a CSS class name to add to the date's cell or "" for the default presentation + * [2]: an optional popup tooltip for this date + * The function is called for each day in the datepicker before it is displayed. + */ + beforeShowDay?: (date: Date) => any[]; + /** + * A URL of an image to use to display the datepicker when the showOn option is set to "button" or "both". If set, the buttonText option becomes the alt value and is not directly displayed. + */ buttonImage?: string; + /** + * Whether the button image should be rendered by itself instead of inside a button element. This option is only relevant if the buttonImage option has also been set. + */ buttonImageOnly?: boolean; + /** + * The text to display on the trigger button. Use in conjunction with the showOn option set to "button" or "both". + */ buttonText?: string; - calculateWeek?: () => any; + /** + * A function to calculate the week of the year for a given date. The default implementation uses the ISO 8601 definition: weeks start on a Monday; the first week of the year contains the first Thursday of the year. + */ + calculateWeek?: (date: Date) => string; + /** + * Whether the month should be rendered as a dropdown instead of text. + */ changeMonth?: boolean; + /** + * Whether the year should be rendered as a dropdown instead of text. Use the yearRange option to control which years are made available for selection. + */ changeYear?: boolean; + /** + * The text to display for the close link. Use the showButtonPanel option to display this button. + */ closeText?: string; + /** + * When true, entry in the input field is constrained to those characters allowed by the current dateFormat option. + */ constrainInput?: boolean; + /** + * The text to display for the current day link. Use the showButtonPanel option to display this button. + */ currentText?: string; + /** + * The format for parsed and displayed dates. For a full list of the possible formats see the formatDate function. + */ dateFormat?: string; + /** + * The list of long day names, starting from Sunday, for use as requested via the dateFormat option. + */ dayNames?: string[]; + /** + * The list of minimised day names, starting from Sunday, for use as column headers within the datepicker. + */ dayNamesMin?: string[]; + /** + * The list of abbreviated day names, starting from Sunday, for use as requested via the dateFormat option. + */ dayNamesShort?: string[]; - defaultDateType?: any; // Date, number or string + /** + * Set the date to highlight on first opening if the field is blank. Specify either an actual date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '+1m +7d'), or null for today. + * Multiple types supported: + * Date: A date object containing the default date. + * Number: A number of days from today. For example 2 represents two days from today and -1 represents yesterday. + * String: A string in the format defined by the dateFormat option, or a relative date. Relative dates must contain value and period pairs; valid periods are "y" for years, "m" for months, "w" for weeks, and "d" for days. For example, "+1m +7d" represents one month and seven days from today. + */ + defaultDate?: any; // Date, number or string + /** + * Control the speed at which the datepicker appears, it may be a time in milliseconds or a string representing one of the three predefined speeds ("slow", "normal", "fast"). + */ duration?: string; + /** + * Set the first day of the week: Sunday is 0, Monday is 1, etc. + */ firstDay?: number; + /** + * When true, the current day link moves to the currently selected date instead of today. + */ gotoCurrent?: boolean; + /** + * Normally the previous and next links are disabled when not applicable (see the minDate and maxDate options). You can hide them altogether by setting this attribute to true. + */ hideIfNoPrevNext?: boolean; + /** + * Whether the current language is drawn from right to left. + */ isRTL?: boolean; + /** + * The maximum selectable date. When set to null, there is no maximum. + * Multiple types supported: + * Date: A date object containing the maximum date. + * Number: A number of days from today. For example 2 represents two days from today and -1 represents yesterday. + * String: A string in the format defined by the dateFormat option, or a relative date. Relative dates must contain value and period pairs; valid periods are "y" for years, "m" for months, "w" for weeks, and "d" for days. For example, "+1m +7d" represents one month and seven days from today. + */ maxDate?: any; // Date, number or string + /** + * The minimum selectable date. When set to null, there is no minimum. + * Multiple types supported: + * Date: A date object containing the minimum date. + * Number: A number of days from today. For example 2 represents two days from today and -1 represents yesterday. + * String: A string in the format defined by the dateFormat option, or a relative date. Relative dates must contain value and period pairs; valid periods are "y" for years, "m" for months, "w" for weeks, and "d" for days. For example, "+1m +7d" represents one month and seven days from today. + */ minDate?: any; // Date, number or string + /** + * The list of full month names, for use as requested via the dateFormat option. + */ monthNames?: string[]; + /** + * The list of abbreviated month names, as used in the month header on each datepicker and as requested via the dateFormat option. + */ monthNamesShort?: string[]; + /** + * Whether the prevText and nextText options should be parsed as dates by the formatDate function, allowing them to display the target month names for example. + */ navigationAsDateFormat?: boolean; + /** + * The text to display for the next month link. With the standard ThemeRoller styling, this value is replaced by an icon. + */ nextText?: string; - numberOfMonths?: any; // number or [] + /** + * The number of months to show at once. + * Multiple types supported: + * Number: The number of months to display in a single row. + * Array: An array defining the number of rows and columns to display. + */ + numberOfMonths?: any; // number or number[] + /** + * Called when the datepicker moves to a new month and/or year. The function receives the selected year, month (1-12), and the datepicker instance as parameters. this refers to the associated input field. + */ onChangeMonthYear?: (year: number, month: number, inst: any) => void; + /** + * Called when the datepicker is closed, whether or not a date is selected. The function receives the selected date as text ("" if none) and the datepicker instance as parameters. this refers to the associated input field. + */ onClose?: (dateText: string, inst: any) => void; + /** + * Called when the datepicker is selected. The function receives the selected date as text and the datepicker instance as parameters. this refers to the associated input field. + */ onSelect?: (dateText: string, inst: any) => void; + /** + * The text to display for the previous month link. With the standard ThemeRoller styling, this value is replaced by an icon. + */ prevText?: string; + /** + * Whether days in other months shown before or after the current month are selectable. This only applies if the showOtherMonths option is set to true. + */ selectOtherMonths?: boolean; + /** + * The cutoff year for determining the century for a date (used in conjunction with dateFormat 'y'). Any dates entered with a year value less than or equal to the cutoff year are considered to be in the current century, while those greater than it are deemed to be in the previous century. + * Multiple types supported: + * Number: A value between 0 and 99 indicating the cutoff year. + * String: A relative number of years from the current year, e.g., "+3" or "-5". + */ shortYearCutoff?: any; // number or string + /** + * The name of the animation used to show and hide the datepicker. Use "show" (the default), "slideDown", "fadeIn", any of the jQuery UI effects. Set to an empty string to disable animation. + */ showAnim?: string; + /** + * Whether to display a button pane underneath the calendar. The button pane contains two buttons, a Today button that links to the current day, and a Done button that closes the datepicker. The buttons' text can be customized using the currentText and closeText options respectively. + */ showButtonPanel?: boolean; + /** + * When displaying multiple months via the numberOfMonths option, the showCurrentAtPos option defines which position to display the current month in. + */ showCurrentAtPos?: number; + /** + * Whether to show the month after the year in the header. + */ showMonthAfterYear?: boolean; + /** + * When the datepicker should appear. The datepicker can appear when the field receives focus ("focus"), when a button is clicked ("button"), or when either event occurs ("both"). + */ showOn?: string; + /** + * If using one of the jQuery UI effects for the showAnim option, you can provide additional settings for that animation via this option. + */ showOptions?: any; // TODO + /** + * Whether to display dates in other months (non-selectable) at the start or end of the current month. To make these days selectable use the selectOtherMonths option. + */ showOtherMonths?: boolean; + /** + * When true, a column is added to show the week of the year. The calculateWeek option determines how the week of the year is calculated. You may also want to change the firstDay option. + */ showWeek?: boolean; + /** + * Set how many months to move when clicking the previous/next links. + */ stepMonths?: number; + /** + * The text to display for the week of the year column heading. Use the showWeek option to display this column. + */ weekHeader?: string; + /** + * The range of years displayed in the year drop-down: either relative to today's year ("-nn:+nn"), relative to the currently selected year ("c-nn:c+nn"), absolute ("nnnn:nnnn"), or combinations of these formats ("nnnn:-nn"). Note that this option only affects what appears in the drop-down, to restrict which dates may be selected use the minDate and/or maxDate options. + */ yearRange?: string; + /** + * Additional text to display after the year in the month headers. + */ yearSuffix?: string; } @@ -154,25 +330,26 @@ declare module JQueryUI { interface Datepicker extends Widget, DatepickerOptions { regional: { [languageCod3: string]: any; }; - setDefaults(defaults: DatepickerOptions); + setDefaults(defaults: DatepickerOptions): void; formatDate(format: string, date: Date, settings?: DatepickerFormatDateOptions): string; parseDate(format: string, date: string, settings?: DatepickerFormatDateOptions): Date; - iso8601Week(date: Date): void; - noWeekends(): void; + iso8601Week(date: Date): number; + noWeekends(date: Date): any[]; } // Dialog ////////////////////////////////////////////////// - interface DialogOptions { + interface DialogOptions extends DialogEvents { autoOpen?: boolean; - buttons?: any; // object or [] + buttons?: { [buttonText: string]: (event?: Event) => void } | DialogButtonOptions[]; closeOnEscape?: boolean; closeText?: string; dialogClass?: string; disabled?: boolean; draggable?: boolean; - height?: any; // number or string + height?: number | string; + hide?: boolean | number | string | DialogShowHideOptions; maxHeight?: number; maxWidth?: number; minHeight?: number; @@ -180,11 +357,28 @@ declare module JQueryUI { modal?: boolean; position?: any; // object, string or [] resizable?: boolean; - show?: any; // number, string or object + show?: boolean | number | string | DialogShowHideOptions; stack?: boolean; title?: string; width?: any; // number or string zIndex?: number; + + close?: DialogEvent; + } + + interface DialogButtonOptions { + icons?: any; + showText?: string | boolean; + text?: string; + click?: (eventObject: JQueryEventObject) => any; + [attr: string]: any; // attributes for the + +
+ @if (cultures.Count() > 1) { + + + } + + + + + + +
+
+@Display(Model.ContentItems) +
+@Display(Model.Pager) +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Dashboards/Views/Elements/Column.Dashboard.cshtml b/src/Orchard.Web/Modules/Orchard.Dashboards/Views/Elements/Column.Dashboard.cshtml new file mode 100644 index 00000000000..8be7225829c --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Dashboards/Views/Elements/Column.Dashboard.cshtml @@ -0,0 +1,19 @@ +@using Orchard.Core.Shapes +@using Orchard.DisplayManagement.Shapes +@using Orchard.Layouts.Helpers +@{ + var columnSpan = (int?)Model.Width; + var columnOffset = (int?)Model.Offset; + var columnOffsetCss = columnOffset > 0 ? "offset-lg-" + columnOffset : default(string); + var tagBuilder = TagBuilderExtensions.AddCommonElementAttributes(new OrchardTagBuilder("div"), Model); + + tagBuilder.AddCssClass(String.Concat("col-lg-", columnSpan)); + tagBuilder.AddCssClass(columnOffsetCss); +} +@if (!Model.Collapsed) { + @tagBuilder.StartElement + foreach (var item in CoreShapes.Order(Model)) { + @Display(item) + } + @tagBuilder.EndElement +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Dashboards/Views/Elements/Grid.Dashboard.cshtml b/src/Orchard.Web/Modules/Orchard.Dashboards/Views/Elements/Grid.Dashboard.cshtml new file mode 100644 index 00000000000..fd162e4d01e --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Dashboards/Views/Elements/Grid.Dashboard.cshtml @@ -0,0 +1,8 @@ +@using Orchard.Layouts.Helpers +@{ + var tagBuilder = TagBuilderExtensions.CreateElementTagBuilder(Model); + tagBuilder.AddCssClass("container-fluid"); +} +@tagBuilder.StartElement +@DisplayChildren(Model) +@tagBuilder.EndElement \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Dashboards/Views/Parts/Layout.Dashboard.cshtml b/src/Orchard.Web/Modules/Orchard.Dashboards/Views/Parts/Layout.Dashboard.cshtml new file mode 100644 index 00000000000..08730f7e078 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Dashboards/Views/Parts/Layout.Dashboard.cshtml @@ -0,0 +1,11 @@ +@using Orchard.Dashboards +
+ @Display(Model.LayoutRoot) +
+@if (AuthorizedFor(Permissions.ManageDashboards)) { +
+
+ @Html.ActionLink(T("Edit").ToString(), "Edit", new {controller = "Dashboard", area = "Orchard.Dashboards"}, new {@class = "button"}) +
+
+} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Dashboards/Views/StaticDashboard.cshtml b/src/Orchard.Web/Modules/Orchard.Dashboards/Views/StaticDashboard.cshtml new file mode 100644 index 00000000000..c1b38df780c --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Dashboards/Views/StaticDashboard.cshtml @@ -0,0 +1,37 @@ +@{ Layout.Title = T("Welcome to Orchard").ToString(); } +
+
+

@T("Get up and running")

+

@T("Start by exploring the menu on the left and familiarize yourself with Orchard. As for the basics, we suggest changing the theme, adding some pages, setup up a blog, and configuring basic settings.", + Url.Action("Index", "Admin", new { area = "Orchard.Themes" }), + Url.Action("Create", "Admin", new { area = "Contents", id = "Page" }), + Url.Action("Create", "BlogAdmin", new { area = "Orchard.Blogs" }), + Url.Action("Index", "Admin", new { area = "Settings", groupInfoId = "Index" }))

+
+
+ +

@T("Change the way your site works and looks with themes and modules. There’s plenty to choose from in the Orchard Gallery. We’re always adding things, so be sure to check back often to see what’s new.", + Url.Action("Themes", "Gallery", new { area = "Orchard.Packaging" }), + Url.Action("Modules", "Gallery", new { area = "Orchard.Packaging" })) +

+
+
+

@T("Read the Docs")

+

@T("Are you ready to go deeper and become an Orchard expert? Take a look at the Orchard Documentation to learn about how everything connects together and what makes Orchard tick.")

+
+
+

@T("Make friends")

+

@T("Find friends that share your interest of Orchard. There are a couple ways that you can discuss and get connected to the project including mailing lists, forums and IRC.")

+
+
+

@T("Contribute back")

+

@T("Help grow Orchard. We encourage contributions of all sorts, including code submissions, documentation, translations, feature recommendations, and more. Here are some ways to give back to the project.")

+
+ +
+

@T("Stay up to date")

+ +
+
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Dashboards/Web.config b/src/Orchard.Web/Modules/Orchard.Dashboards/Web.config new file mode 100644 index 00000000000..d1587f722cd --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Dashboards/Web.config @@ -0,0 +1,59 @@ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Dashboards/packages.config b/src/Orchard.Web/Modules/Orchard.Dashboards/packages.config new file mode 100644 index 00000000000..6729ced4977 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Dashboards/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Module.txt b/src/Orchard.Web/Modules/Orchard.DesignerTools/Module.txt index dbf40181adc..133880a70b7 100644 --- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Module.txt +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Module.txt @@ -2,13 +2,13 @@ AntiForgery: enabled Author: The Orchard Team Website: http://orchardproject.net -Version: 1.9.2 +Version: 1.10 OrchardVersion: 1.9 Description: Contains designer tools to ease the Themes development process FeatureName: Shape Tracing Category: Designer FeatureDescription: Displays all currently displayed shapes and some information to customize them -Dependencies: Orchard.jQuery +Dependencies: Orchard.Resources Features: UrlAlternates: Name: Url Alternates diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Orchard.DesignerTools.csproj b/src/Orchard.Web/Modules/Orchard.DesignerTools/Orchard.DesignerTools.csproj index d4d7bc9a4b5..546c5469b93 100644 --- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Orchard.DesignerTools.csproj +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Orchard.DesignerTools.csproj @@ -12,7 +12,7 @@ Properties Orchard.DesignerTools Orchard.DesignerTools - v4.5.1 + v4.5.2 false @@ -50,14 +50,38 @@ + + ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + True + - - False - ..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll - + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll + True + + + ..\..\..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll + True + + + ..\..\..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll + True + @@ -99,9 +123,7 @@ - - - + @@ -112,12 +134,16 @@ {2d1d92bb-4555-4cbe-8d0e-63563d6ce4c6} Orchard.Framework + false {194d3ccc-1153-474d-8176-fde8d7d0d0bd} Orchard.Widgets + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Properties/AssemblyInfo.cs b/src/Orchard.Web/Modules/Orchard.DesignerTools/Properties/AssemblyInfo.cs index 6e9067cb6b7..727cdd933aa 100644 --- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Properties/AssemblyInfo.cs +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.9.2")] -[assembly: AssemblyFileVersion("1.9.2")] +[assembly: AssemblyVersion("1.10")] +[assembly: AssemblyFileVersion("1.10")] diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/Web.config b/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/Web.config index 8171989953c..176fe49cd7a 100644 --- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/Web.config +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/Web.config @@ -1,16 +1,12 @@ - + - - - - - - - - - - + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/UrlAlternatesFactory.cs b/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/UrlAlternatesFactory.cs index 0b7434bd8ce..789ea12551f 100644 --- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/UrlAlternatesFactory.cs +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/UrlAlternatesFactory.cs @@ -51,7 +51,7 @@ public override void Displaying(ShapeDisplayingContext context) { return; } - // prevent applying alternate again, c.f. http://orchard.codeplex.com/workitem/18298 + // prevent applying alternate again, c.f. https://github.com/OrchardCMS/Orchard/issues/2125 if(displayedContext.ShapeMetadata.Alternates.Any(x => x.Contains("__url__"))) { return; } diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/Web.config index 8171989953c..176fe49cd7a 100644 --- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/Web.config +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/Web.config @@ -1,16 +1,12 @@ - + - - - - - - - - - - + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config b/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config index 2ee9337d875..bfeea149d0f 100644 --- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config @@ -1,37 +1,38 @@ - + - - -
-
+
+
- + - - - - - - - - + + + + + + + + - + - - - - - - + + + + + + + + + @@ -39,16 +40,20 @@ - - + + - - + + - - + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/packages.config b/src/Orchard.Web/Modules/Orchard.DesignerTools/packages.config new file mode 100644 index 00000000000..6729ced4977 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Activities/DynamicFormValidatingActivity.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Activities/DynamicFormValidatingActivity.cs index 91f56618768..8455dcb1bb1 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Activities/DynamicFormValidatingActivity.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Activities/DynamicFormValidatingActivity.cs @@ -7,6 +7,7 @@ using Orchard.Environment.Extensions; namespace Orchard.DynamicForms.Activities { + [OrchardFeature("Orchard.DynamicForms.Activities.Validation")] public class DynamicFormValidatingActivity : DynamicFormActivity { private readonly ICSharpService _csharpService; private readonly IOrchardServices _orchardServices; diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Assets/JavaScript/LayoutEditor/Models/Form.js b/src/Orchard.Web/Modules/Orchard.DynamicForms/Assets/JavaScript/LayoutEditor/Models/Form.js index 36737ee48d7..d6b58fa54d0 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Assets/JavaScript/LayoutEditor/Models/Form.js +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Assets/JavaScript/LayoutEditor/Models/Form.js @@ -1,8 +1,8 @@ var LayoutEditor; (function ($, LayoutEditor) { - LayoutEditor.Form = function (data, htmlId, htmlClass, htmlStyle, isTemplated, name, formBindingContentType, contentType, contentTypeLabel, contentTypeClass, hasEditor, children) { - LayoutEditor.Element.call(this, "Form", data, htmlId, htmlClass, htmlStyle, isTemplated); + LayoutEditor.Form = function (data, htmlId, htmlClass, htmlStyle, isTemplated, name, formBindingContentType, contentType, contentTypeLabel, contentTypeClass, hasEditor, rule, children) { + LayoutEditor.Element.call(this, "Form", data, htmlId, htmlClass, htmlStyle, isTemplated, rule); LayoutEditor.Container.call(this, ["Grid", "Content"], children); var self = this; @@ -71,6 +71,7 @@ value.contentTypeLabel, value.contentTypeClass, value.hasEditor, + value.rule, LayoutEditor.childrenFrom(value.children)); }; diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Bindings/EnumerationFieldBindings.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Bindings/EnumerationFieldBindings.cs index 1c9955bc79c..0798a5db3b1 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Bindings/EnumerationFieldBindings.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Bindings/EnumerationFieldBindings.cs @@ -8,8 +8,19 @@ public class EnumerationFieldBindings : Component, IBindingProvider { public void Describe(BindingDescribeContext context) { context.For() .Binding("SelectedValues", (contentItem, field, s) => { - var items = (s ?? "").Split(new[] {',', ';'}, StringSplitOptions.RemoveEmptyEntries); - field.SelectedValues = items; + if (String.IsNullOrWhiteSpace(s)) { + field.Value = ""; + return; + } + + var separators = new[] {',', ';'}; + var hasMultipleValues = s.IndexOfAny(separators) >= 0; + + if (hasMultipleValues) + field.SelectedValues = s.Split(separators, StringSplitOptions.RemoveEmptyEntries); + else { + field.Value = s; + } }); } } diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Bindings/NumericFieldBindings.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Bindings/NumericFieldBindings.cs new file mode 100644 index 00000000000..d9e40402ec2 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Bindings/NumericFieldBindings.cs @@ -0,0 +1,13 @@ +using Orchard.ContentManagement; +using Orchard.DynamicForms.Services; +using Orchard.DynamicForms.Services.Models; +using Orchard.Fields.Fields; + +namespace Orchard.DynamicForms.Bindings { + public class NumericFieldBindings : Component, IBindingProvider { + public void Describe(BindingDescribeContext context) { + context.For() + .Binding("Value", (contentItem, field, s) => field.Value = XmlHelper.Parse(s)); + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Bindings/UserPartBindings.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Bindings/UserPartBindings.cs index 63ae32bf752..bd27a81b041 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Bindings/UserPartBindings.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Bindings/UserPartBindings.cs @@ -1,9 +1,11 @@ using Orchard.DynamicForms.Services; using Orchard.DynamicForms.Services.Models; +using Orchard.Environment.Extensions; using Orchard.Security; using Orchard.Users.Models; namespace Orchard.DynamicForms.Bindings { + [OrchardFeature("Orchard.DynamicForms.Bindings.Users")] public class UserPartBindings : Component, IBindingProvider { private readonly IMembershipService _membershipService; public UserPartBindings(IMembershipService membershipService) { diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Controllers/FormController.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Controllers/FormController.cs index fc5ad4c889c..67fde869c4a 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Controllers/FormController.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Controllers/FormController.cs @@ -9,6 +9,7 @@ using Orchard.Services; using Orchard.Tokens; using Orchard.UI.Notify; +using Orchard.Utility.Extensions; using IController = Orchard.DynamicForms.Services.IController; namespace Orchard.DynamicForms.Controllers { diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/BindingsElementDriver.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/BindingsElementDriver.cs index f30894420ba..fa7c2ee1355 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/BindingsElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/BindingsElementDriver.cs @@ -37,7 +37,7 @@ protected override EditorResult OnBuildEditor(FormElement element, ElementEditor var bindingsEditor = context.ShapeFactory.EditorTemplate(TemplateName: "FormBindings", Model: viewModel); - bindingsEditor.Metadata.Position = "Bindings:10"; + bindingsEditor.Metadata.Position = "Bindings:20"; return Editor(context, bindingsEditor); } diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/ButtonElementDriver.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/ButtonElementDriver.cs index 9ae4e1e255d..c0c1927b25f 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/ButtonElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/ButtonElementDriver.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using Orchard.DynamicForms.Elements; -using Orchard.Forms.Services; using Orchard.Layouts.Framework.Display; using Orchard.Layouts.Framework.Drivers; using Orchard.Layouts.Helpers; +using Orchard.Layouts.Services; using Orchard.Tokens; using DescribeContext = Orchard.Forms.Services.DescribeContext; @@ -11,7 +11,7 @@ namespace Orchard.DynamicForms.Drivers { public class ButtonElementDriver : FormsElementDriver
+
+
- - @Html.TextBoxFor(m => m.UserName, new { @class = "text" }) - @Html.ValidationMessage("UserName", "*") - @T("The username for authentication.") + @Html.RadioButtonFor(m => m.UseDefaultCredentials, false, new { id = "customCredentialsOption", name = "UseDefaultCredentials" }) + + @Html.ValidationMessage("UseDefaultCredentials", "*")
+
- - @Html.TextBoxFor(m => m.Password, new { type = "password", @class = "text medium" }) - @Html.ValidationMessage("Password", "*") - @T("The password for authentication.") + @Html.RadioButtonFor(m => m.UseDefaultCredentials, true, new { id = "defaultCredentialsOptions", name = "UseDefaultCredentials" }) + + @Html.ValidationMessage("UseDefaultCredentials", "*") + @T("When this option is selected, the aplication pool or host-process identity is used to authenticate with the mail server. ") +
+
+ + + @Html.TextBoxFor(m => m.UserName, new { @class = "text" }) + @Html.ValidationMessage("UserName", "*") + @T("The username for authentication.") + + + + @Html.TextBoxFor(m => m.Password, new { type = "password", @class = "text medium" }) + @Html.ValidationMessage("Password", "*") + @T("The password for authentication.") +
@@ -80,7 +96,8 @@
- @using (Script.Foot()) { + @using (Script.Foot()) + { - - - - - - - - - - - - - - - - - - - diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/BreadcrumbsElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/BreadcrumbsElementDriver.cs new file mode 100644 index 00000000000..1ded6cc96dc --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/BreadcrumbsElementDriver.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Orchard.ContentManagement; +using Orchard.Core.Navigation.Services; +using Orchard.Core.Title.Models; +using Orchard.DisplayManagement; +using Orchard.Environment.Extensions; +using Orchard.Layouts.Elements; +using Orchard.Layouts.Framework.Display; +using Orchard.Layouts.Framework.Drivers; +using Orchard.Layouts.ViewModels; +using Orchard.UI.Navigation; +using Orchard.Utility.Extensions; + +namespace Orchard.Layouts.Drivers { + [OrchardFeature("Orchard.Layouts.UI")] + public class BreadcrumbsElementDriver : ElementDriver { + private readonly IWorkContextAccessor _workContextAccessor; + private readonly IMenuService _menuService; + private readonly INavigationManager _navigationManager; + + public BreadcrumbsElementDriver(IMenuService menuService, INavigationManager navigationManager, IWorkContextAccessor workContextAccessor, IShapeFactory shapeFactory) { + _workContextAccessor = workContextAccessor; + _menuService = menuService; + _navigationManager = navigationManager; + New = shapeFactory; + } + + public dynamic New { get; set; } + + protected override EditorResult OnBuildEditor(Breadcrumbs element, ElementEditorContext context) { + var viewModel = new BreadcrumbsEditorViewModel { + CurrentMenuId = element.MenuContentItemId, + StartLevel = element.StartLevel, + StopLevel = element.Levels, + AddCurrentPage = element.AddCurrentPage, + AddHomePage = element.AddHomePage, + Menus = _menuService.GetMenus(), + }; + var editor = context.ShapeFactory.EditorTemplate(TemplateName: "Elements.Breadcrumbs", Model: viewModel); + + if (context.Updater != null) { + if (context.Updater.TryUpdateModel(viewModel, context.Prefix, null, null)) { + element.StartLevel = viewModel.StartLevel; + element.Levels = viewModel.StopLevel; + element.AddCurrentPage = viewModel.AddCurrentPage; + element.AddHomePage = viewModel.AddHomePage; + element.MenuContentItemId = viewModel.CurrentMenuId; + } + } + + return Editor(context, editor); + } + + protected override void OnDisplaying(Breadcrumbs element, ElementDisplayingContext context) { + var menu = _menuService.GetMenu(element.MenuContentItemId); + + if (menu == null) + return; + + var menuName = menu.As().Title.HtmlClassify(); + var currentCulture = _workContextAccessor.GetContext().CurrentCulture; + var menuItems = _navigationManager.BuildMenu(menu); + var localized = new List(); + foreach (var menuItem in menuItems) { + // If there is no associated content, it as culture neutral. + if (menuItem.Content == null) + localized.Add(menuItem); + + // If the menu item is culture neutral or of the current culture. + else if (String.IsNullOrEmpty(menuItem.Culture) || String.Equals(menuItem.Culture, currentCulture, StringComparison.OrdinalIgnoreCase)) + localized.Add(menuItem); + } + + menuItems = localized; + + var shapeHelper = New; + var request = _workContextAccessor.GetContext().HttpContext.Request; + var routeData = request.RequestContext.RouteData; + var selectedPath = NavigationHelper.SetSelectedPath(menuItems, request, routeData); + var menuShape = shapeHelper.Menu(); + + + menuItems = selectedPath ?? new Stack(); + foreach (var menuItem in menuItems) { + menuItem.Items = Enumerable.Empty(); + } + + // Apply level limits to breadcrumb. + menuItems = menuItems.Skip(element.StartLevel - 1); + if (element.Levels > 0) { + menuItems = menuItems.Take(element.Levels); + } + + var result = new List(menuItems); + + // Inject the home page. + if (element.AddHomePage) { + result.Insert(0, new MenuItem { + Href = _navigationManager.GetUrl("~/", null), + Text = T("Home") + }); + } + + // Inject the current page. + if (!element.AddCurrentPage && selectedPath != null) { + result.RemoveAt(result.Count - 1); + } + + // Prevent the home page to be added as the home page and the current page. + if (result.Count == 2 && String.Equals(result[0].Href, result[1].Href, StringComparison.OrdinalIgnoreCase)) { + result.RemoveAt(1); + } + + menuItems = result; + menuShape = shapeHelper.Breadcrumb(); + menuShape.MenuName(menuName); + menuShape.ContentItem(menu); + + NavigationHelper.PopulateMenu(shapeHelper, menuShape, menuShape, menuItems); + + context.ElementShape.Menu = menuShape; + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ColumnElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ColumnElementDriver.cs index daeba8486bd..254af9cbbad 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ColumnElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ColumnElementDriver.cs @@ -1,37 +1,14 @@ -using System.Collections.Generic; -using Orchard.Forms.Services; -using Orchard.Layouts.Elements; +using Orchard.Layouts.Elements; +using Orchard.Layouts.Framework.Display; using Orchard.Layouts.Framework.Drivers; namespace Orchard.Layouts.Drivers { - public class ColumnElementDriver : FormsElementDriver { - public ColumnElementDriver(IFormManager formManager) : base(formManager) { - } - - protected override IEnumerable FormNames { - get { - yield return "Column"; - } - } - - protected override void DescribeForm(DescribeContext context) { - context.Form("Column", factory => { - var shape = (dynamic)factory; - var form = shape.Fieldset( - Id: "Column", - _Span: shape.Textbox( - Id: "ColumnSpan", - Name: "ColumnSpan", - Title: "Span", - Description: T("The column span.")), - _Offset: shape.Textbox( - Id: "ColumnOffset", - Name: "ColumnOffset", - Title: "Offset", - Description: T("The column offset expressed in span size."))); + public class ColumnElementDriver : ElementDriver { - return form; - }); + protected override void OnDisplaying(Column element, ElementDisplayingContext context) { + context.ElementShape.Width = element.Width; + context.ElementShape.Offset = element.Offset; + context.ElementShape.Collapsed = false; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ContentItemElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ContentItemElementDriver.cs index c148009185d..6e91a8d2d3b 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ContentItemElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ContentItemElementDriver.cs @@ -37,7 +37,7 @@ protected override EditorResult OnBuildEditor(ContentItem element, ElementEditor return Editor(context, editor); } - protected override void OnDisplaying(ContentItem element, ElementDisplayContext context) { + protected override void OnDisplaying(ContentItem element, ElementDisplayingContext context) { var contentItemIds = context.Content != null ? RemoveCurrentContentItemId(element.ContentItemIds, context.Content.Id) : element.ContentItemIds; var displayType = element.DisplayType; var contentItems = GetContentItems(contentItemIds).ToArray(); diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ContentPartElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ContentPartElementDriver.cs index dd8c5c6db4d..5d4ec214fea 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ContentPartElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ContentPartElementDriver.cs @@ -19,7 +19,7 @@ public ContentPartElementDriver(IContentPartDisplay contentPartDisplay, ICulture _transactionManager = transactionManager; } - protected override void OnDisplaying(ContentPart element, ElementDisplayContext context) { + protected override void OnDisplaying(ContentPart element, ElementDisplayingContext context) { // Content is optional context, so if it's null, we can't render the part element. // This typically only happens when the layout editor is used outside the context of // a content item and still renders the various content part elements as part of the toolbox. diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ElementWrapperPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ElementWrapperPartDriver.cs index 1f85551f223..2f73ed98442 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ElementWrapperPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ElementWrapperPartDriver.cs @@ -1,4 +1,6 @@ -using System.Linq; +using System; +using System.Diagnostics.Eventing.Reader; +using System.Linq; using Orchard.ContentManagement; using Orchard.ContentManagement.Drivers; using Orchard.ContentManagement.Handlers; @@ -87,7 +89,37 @@ protected override void Exporting(ElementWrapperPart part, ExportContentContext context.Element(part.PartDefinition.Name).SetValue(exportableData); } + protected override void Exported(ElementWrapperPart part, ExportContentContext context) { + var describeContext = CreateDescribeContext(part); + var descriptor = _elementManager.GetElementDescriptorByTypeName(describeContext, part.ElementTypeName); + var data = ElementDataHelper.Deserialize(part.ElementData); + var element = _elementManager.ActivateElement(descriptor, e => e.Data = data); + + _elementManager.Exported(new[] { element }, new ExportLayoutContext()); + var exportableData = _serializer.Serialize(element); + + context.Element(part.PartDefinition.Name).SetValue(exportableData); + } + protected override void Importing(ElementWrapperPart part, ImportContentContext context) { + HandleImportEvent(part, context, (describeContext, element) => { + _elementManager.Importing(new[] { element }, new ImportLayoutContext { Session = new ImportContentContextWrapper(context) }); + }); + } + + protected override void Imported(ElementWrapperPart part, ImportContentContext context) { + HandleImportEvent(part, context, (describeContext, element) => { + _elementManager.Imported(new[] { element }, new ImportLayoutContext { Session = new ImportContentContextWrapper(context) }); + }); + } + + protected override void ImportCompleted(ElementWrapperPart part, ImportContentContext context) { + HandleImportEvent(part, context, (describeContext, element) => { + _elementManager.ImportCompleted(new[] { element }, new ImportLayoutContext { Session = new ImportContentContextWrapper(context) }); + }); + } + + private void HandleImportEvent(ElementWrapperPart part, ImportContentContext context, Action callback) { var root = context.Data.Element(part.PartDefinition.Name); if (root == null) @@ -97,7 +129,7 @@ protected override void Importing(ElementWrapperPart part, ImportContentContext var describeContext = CreateDescribeContext(part); var element = _serializer.Deserialize(exportedData, describeContext); - _elementManager.Importing(new[]{element}, new ImportLayoutContext { Session = new ImportContentContextWrapper(context)}); + callback(describeContext, element); part.ElementData = element.Data.Serialize(); } diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/HeadingElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/HeadingElementDriver.cs index e2723215f69..0bc14c531e9 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/HeadingElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/HeadingElementDriver.cs @@ -29,7 +29,7 @@ protected override EditorResult OnBuildEditor(Heading element, ElementEditorCont return Editor(context, editor); } - protected override void OnDisplaying(Heading element, ElementDisplayContext context) { + protected override void OnDisplaying(Heading element, ElementDisplayingContext context) { context.ElementShape.ProcessedContent = _processor.ProcessContent(element.Content, "html", context.GetTokenData()); context.ElementShape.Level = element.Level; } diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/HtmlElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/HtmlElementDriver.cs index ba24559668a..09d877c5be3 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/HtmlElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/HtmlElementDriver.cs @@ -27,7 +27,7 @@ protected override EditorResult OnBuildEditor(Html element, ElementEditorContext return Editor(context, editor); } - protected override void OnDisplaying(Html element, ElementDisplayContext context) { + protected override void OnDisplaying(Html element, ElementDisplayingContext context) { context.ElementShape.ProcessedContent = _processor.ProcessContent(element.Content, "html", context.GetTokenData()); } } diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ImageElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ImageElementDriver.cs index 7fca50f1353..03849aac400 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ImageElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ImageElementDriver.cs @@ -33,7 +33,7 @@ protected override EditorResult OnBuildEditor(Image element, ElementEditorContex return Editor(context, editor); } - protected override void OnDisplaying(Image element, ElementDisplayContext context) { + protected override void OnDisplaying(Image element, ElementDisplayingContext context) { var imageId = element.MediaId; var image = imageId != null ? GetImage(imageId.Value) : default(ImagePart); context.ElementShape.ImagePart = image; diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/LayoutPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/LayoutPartDriver.cs index 6061abe34fc..33b516544c9 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/LayoutPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/LayoutPartDriver.cs @@ -5,6 +5,7 @@ using Orchard.ContentManagement.Drivers; using Orchard.ContentManagement.Handlers; using Orchard.DisplayManagement; +using Orchard.Layouts.Elements; using Orchard.Layouts.Framework.Display; using Orchard.Layouts.Framework.Drivers; using Orchard.Layouts.Framework.Elements; @@ -90,7 +91,8 @@ protected override DriverResult Editor(LayoutPart part, dynamic shapeHelper) { protected override DriverResult Editor(LayoutPart part, IUpdateModel updater, dynamic shapeHelper) { return ContentShape("Parts_Layout_Edit", () => { - if (part.Id == 0) { + if (part.Id == 0 && String.IsNullOrWhiteSpace(part.LayoutData)) { + var settings = part.TypePartDefinition.Settings.GetModel(); // If the default layout setting is left empty, use the one from the service @@ -111,12 +113,12 @@ protected override DriverResult Editor(LayoutPart part, IUpdateModel updater, dy updater.TryUpdateModel(viewModel, Prefix, null, new[] { "Part", "Templates" }); var describeContext = new DescribeElementsContext { Content = part }; var elementInstances = _mapper.ToLayoutModel(viewModel.LayoutEditor.Data, describeContext).ToArray(); - var removedElementInstances = _serializer.Deserialize(viewModel.LayoutEditor.Trash, describeContext).ToArray(); + var recycleBin = (RecycleBin)_mapper.ToLayoutModel(viewModel.LayoutEditor.RecycleBin, describeContext).SingleOrDefault(); var context = new LayoutSavingContext { Content = part, Updater = updater, Elements = elementInstances, - RemovedElements = removedElementInstances + RemovedElements = recycleBin != null ? recycleBin.Elements : Enumerable.Empty() }; _elementManager.Saving(context); @@ -134,9 +136,7 @@ protected override DriverResult Editor(LayoutPart part, IUpdateModel updater, dy protected override void Exporting(LayoutPart part, ExportContentContext context) { _layoutManager.Exporting(new ExportLayoutContext { Layout = part }); - - context.Element(part.PartDefinition.Name).SetElementValue("LayoutData", part.LayoutData); - + if (part.TemplateId != null) { var template = part.ContentItem.ContentManager.Get(part.TemplateId.Value); @@ -145,23 +145,45 @@ protected override void Exporting(LayoutPart part, ExportContentContext context) context.Element(part.PartDefinition.Name).SetAttributeValue("TemplateId", templateIdentity); } } + + context.Element(part.PartDefinition.Name).SetElementValue("LayoutData", part.LayoutData); + } + + protected override void Exported(LayoutPart part, ExportContentContext context) { + _layoutManager.Exported(new ExportLayoutContext { Layout = part }); + + context.Element(part.PartDefinition.Name).SetElementValue("LayoutData", part.LayoutData); } protected override void Importing(LayoutPart part, ImportContentContext context) { + HandleImportEvent(part, context, importLayoutContext => { + context.ImportChildEl(part.PartDefinition.Name, "LayoutData", s => { + part.LayoutData = s; + _layoutManager.Importing(importLayoutContext); + }); + + context.ImportAttribute(part.PartDefinition.Name, "TemplateId", s => part.TemplateId = GetTemplateId(context, s)); + }); + } + + protected override void Imported(LayoutPart part, ImportContentContext context) { + HandleImportEvent(part, context, importLayoutContext => _layoutManager.Imported(importLayoutContext)); + } + + protected override void ImportCompleted(LayoutPart part, ImportContentContext context) { + HandleImportEvent(part, context, importLayoutContext => _layoutManager.ImportCompleted(importLayoutContext)); + } + + private void HandleImportEvent(LayoutPart part, ImportContentContext context, Action callback) { // Don't do anything if the tag is not specified. if (context.Data.Element(part.PartDefinition.Name) == null) { return; } - context.ImportChildEl(part.PartDefinition.Name, "LayoutData", s => { - part.LayoutData = s; - _layoutManager.Importing(new ImportLayoutContext { - Layout = part, - Session = new ImportContentContextWrapper(context) - }); + callback(new ImportLayoutContext { + Layout = part, + Session = new ImportContentContextWrapper(context) }); - - context.ImportAttribute(part.PartDefinition.Name, "TemplateId", s => part.TemplateId = GetTemplateId(context, s)); } private static int? GetTemplateId(ImportContentContext context, string templateIdentity) { @@ -171,5 +193,10 @@ protected override void Importing(LayoutPart part, ImportContentContext context) var template = context.GetItemFromSession(templateIdentity); return template != null ? template.Id : default(int?); } + + protected override void Cloning(LayoutPart originalPart, LayoutPart clonePart, CloneContentContext context) { + clonePart.LayoutData = originalPart.LayoutData; + clonePart.TemplateId = originalPart.TemplateId; + } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/MarkdownElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/MarkdownElementDriver.cs index 7329eea3ca8..e988c89a17d 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/MarkdownElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/MarkdownElementDriver.cs @@ -28,7 +28,7 @@ protected override EditorResult OnBuildEditor(MarkdownElement element, ElementEd return Editor(context, editor); } - protected override void OnDisplaying(MarkdownElement element, ElementDisplayContext context) { + protected override void OnDisplaying(MarkdownElement element, ElementDisplayingContext context) { context.ElementShape.ProcessedContent = _processor.ProcessContent(element.Content, "markdown", context.GetTokenData()); } } diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/MediaItemElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/MediaItemElementDriver.cs index f1f71e0bdd4..5cfbe8bc686 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/MediaItemElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/MediaItemElementDriver.cs @@ -39,7 +39,7 @@ protected override EditorResult OnBuildEditor(MediaItem element, ElementEditorCo return Editor(context, editor); } - protected override void OnDisplaying(MediaItem element, ElementDisplayContext context) { + protected override void OnDisplaying(MediaItem element, ElementDisplayingContext context) { var contentItemIds = RemoveCurrentContentItemId(element.MediaItemIds, context.Content.Id); var displayType = context.DisplayType != "Design" ? element.DisplayType : "Thumbnail"; var contentItems = GetContentItems(contentItemIds).ToArray(); diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/MenuElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/MenuElementDriver.cs new file mode 100644 index 00000000000..505cf0a522e --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/MenuElementDriver.cs @@ -0,0 +1,154 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Orchard.ContentManagement; +using Orchard.Core.Navigation.Services; +using Orchard.Core.Title.Models; +using Orchard.DisplayManagement; +using Orchard.Environment.Extensions; +using Orchard.Layouts.Elements; +using Orchard.Layouts.Framework.Display; +using Orchard.Layouts.Framework.Drivers; +using Orchard.Layouts.Helpers; +using Orchard.Layouts.ViewModels; +using Orchard.UI.Navigation; +using Orchard.Utility.Extensions; + +namespace Orchard.Layouts.Drivers { + [OrchardFeature("Orchard.Layouts.UI")] + public class MenuElementDriver : ElementDriver { + private readonly IWorkContextAccessor _workContextAccessor; + private readonly IMenuService _menuService; + private readonly INavigationManager _navigationManager; + private readonly IContentManager _contentManager; + + public MenuElementDriver( + IWorkContextAccessor workContextAccessor, + IMenuService menuService, + INavigationManager navigationManager, + IContentManager contentManager, + IShapeFactory shapeFactory) { + _workContextAccessor = workContextAccessor; + _menuService = menuService; + _navigationManager = navigationManager; + _contentManager = contentManager; + New = shapeFactory; + } + + public dynamic New { get; set; } + + protected override EditorResult OnBuildEditor(Menu element, ElementEditorContext context) { + var viewModel = new MenuEditorViewModel { + CurrentMenuId = element.MenuContentItemId, + StartLevel = element.StartLevel, + StopLevel = element.Levels, + ShowFullMenu = element.ShowFullMenu, + Menus = _menuService.GetMenus(), + }; + var editor = context.ShapeFactory.EditorTemplate(TemplateName: "Elements.Menu", Model: viewModel); + + if (context.Updater != null) { + if (context.Updater.TryUpdateModel(viewModel, context.Prefix, null, null)) { + element.StartLevel = viewModel.StartLevel; + element.Levels = viewModel.StopLevel; + element.ShowFullMenu = viewModel.ShowFullMenu; + element.MenuContentItemId = viewModel.CurrentMenuId; + } + } + + return Editor(context, editor); + } + + protected override void OnDisplaying(Menu element, ElementDisplayingContext context) { + var menu = _menuService.GetMenu(element.MenuContentItemId); + + if (menu == null) + return; + + var menuName = menu.As().Title.HtmlClassify(); + var currentCulture = _workContextAccessor.GetContext().CurrentCulture; + var menuItems = _navigationManager.BuildMenu(menu); + var localized = new List(); + foreach (var menuItem in menuItems) { + // If there is no associated content, it as culture neutral. + if (menuItem.Content == null) + localized.Add(menuItem); + + // If the menu item is culture neutral or of the current culture. + else if (String.IsNullOrEmpty(menuItem.Culture) || String.Equals(menuItem.Culture, currentCulture, StringComparison.OrdinalIgnoreCase)) + localized.Add(menuItem); + } + + menuItems = localized; + + var shapeHelper = New; + var request = _workContextAccessor.GetContext().HttpContext.Request; + var routeData = request.RequestContext.RouteData; + var selectedPath = NavigationHelper.SetSelectedPath(menuItems, request, routeData); + var menuShape = shapeHelper.Menu(); + var topLevelItems = menuItems.ToList(); + + // Apply start level by pushing children as top level items. When the start level is + // greater than 1 (ie. below the top level), only menu items along the selected path + // will be displayed. + for (var i = 0; topLevelItems.Any() && i < element.StartLevel - 1; i++) { + var temp = new List(); + // Should the menu be filtered on the currently displayed page? + if (element.ShowFullMenu) { + foreach (var menuItem in topLevelItems) { + temp.AddRange(menuItem.Items); + } + } + else if (selectedPath != null) { + topLevelItems = topLevelItems.Intersect(selectedPath.Where(x => x.Selected)).ToList(); + foreach (var menuItem in topLevelItems) { + temp.AddRange(menuItem.Items); + } + } + topLevelItems = temp; + } + + // Limit the number of levels to display (down from and including the start level). + if (element.Levels > 0) { + var current = topLevelItems.ToList(); + for (var i = 1; current.Any() && i < element.Levels; i++) { + var temp = new List(); + foreach (var menuItem in current) { + temp.AddRange(menuItem.Items); + } + current = temp; + } + // Cut the sub-levels beneath any menu items that are at the lowest level being displayed. + foreach (var menuItem in current) { + menuItem.Items = Enumerable.Empty(); + } + } + + menuItems = topLevelItems; + menuShape.MenuName(menuName); + menuShape.ContentItem(menu); + + NavigationHelper.PopulateMenu(shapeHelper, menuShape, menuShape, menuItems); + + context.ElementShape.Menu = menuShape; + } + + protected override void OnExporting(Menu element, ExportElementContext context) { + var menu = _contentManager.Get(element.MenuContentItemId); + var menuIdentity = menu != null ? _contentManager.GetItemMetadata(menu).Identity.ToString() : default(string); + + if (menuIdentity != null) + context.ExportableData["MenuId"] = menuIdentity; + } + + protected override void OnImporting(Menu element, ImportElementContext context) { + var menuIdentity = context.ExportableData.Get("MenuId"); + var menu = menuIdentity != null ? context.Session.GetItemFromSession(menuIdentity) : default(ContentManagement.ContentItem); + + if (menu == null) + return; + + element.MenuContentItemId = menu.Id; + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/NotificationsElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/NotificationsElementDriver.cs new file mode 100644 index 00000000000..2bb16e58b5c --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/NotificationsElementDriver.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.Linq; +using Orchard.DisplayManagement; +using Orchard.Environment.Extensions; +using Orchard.Layouts.Elements; +using Orchard.Layouts.Framework.Display; +using Orchard.Layouts.Framework.Drivers; +using Orchard.Mvc; +using Orchard.UI.Notify; + +namespace Orchard.Layouts.Drivers { + [OrchardFeature("Orchard.Layouts.UI")] + public class NotificationsElementDriver : ElementDriver { + private readonly IHttpContextAccessor _httpContextAccessor; + public NotificationsElementDriver(IHttpContextAccessor httpContextAccessor, IShapeFactory shapeFactory) { + _httpContextAccessor = httpContextAccessor; + New = shapeFactory; + } + + public dynamic New { get; set; } + + protected override void OnCreatingDisplay(Notifications element, ElementCreatingDisplayShapeContext context) { + if (context.DisplayType == "Design") + return; + + var httpContext = _httpContextAccessor.Current(); + if (httpContext == null) + return; + + var messageEntries = httpContext.Items[NotifyFilter.TempDataMessages] as IList ?? new List(); + + context.Cancel = !messageEntries.Any(); + } + + protected override void OnDisplaying(Notifications element, ElementDisplayingContext context) { + var httpContext = _httpContextAccessor.Current(); + var messageEntries = httpContext.Items[NotifyFilter.TempDataMessages] as IList ?? new List(); + var shapes = messageEntries.Select(x => New.Message(x)).ToList(); + + context.ElementShape.Messages = shapes; + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ParagraphElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ParagraphElementDriver.cs index a4aaadabcd4..0d285207ad5 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ParagraphElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ParagraphElementDriver.cs @@ -27,7 +27,7 @@ protected override EditorResult OnBuildEditor(Paragraph element, ElementEditorCo return Editor(context, editor); } - protected override void OnDisplaying(Paragraph element, ElementDisplayContext context) { + protected override void OnDisplaying(Paragraph element, ElementDisplayingContext context) { context.ElementShape.ProcessedContent = _processor.ProcessContent(element.Content, "html", context.GetTokenData()); } } diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ProjectionElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ProjectionElementDriver.cs index 68c7efe4de9..8a583c5a481 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ProjectionElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ProjectionElementDriver.cs @@ -19,6 +19,7 @@ using Orchard.Tokens; using Orchard.UI.Navigation; using Orchard.Layouts.Helpers; +using Orchard.Layouts.Services; using DescribeContext = Orchard.Forms.Services.DescribeContext; namespace Orchard.Layouts.Drivers { @@ -32,13 +33,13 @@ public class ProjectionElementDriver : FormsElementDriver { private readonly IDisplayHelperFactory _displayHelperFactory; public ProjectionElementDriver( - IFormManager formManager, + IFormsBasedElementServices formsServices, IProjectionManager projectionManager, IOrchardServices services, IRepository layoutRepository, ITokenizer tokenizer, IDisplayHelperFactory displayHelperFactory) - : base(formManager) { + : base(formsServices) { _projectionManager = projectionManager; _contentManager = services.ContentManager; @@ -54,7 +55,7 @@ protected override IEnumerable FormNames { } } - protected override void OnDisplaying(Projection element, ElementDisplayContext context) { + protected override void OnDisplaying(Projection element, ElementDisplayingContext context) { var queryId = element.QueryId; var layoutId = element.LayoutId; var query = queryId != null ? _contentManager.Get(queryId.Value) : default(QueryPart); @@ -298,7 +299,7 @@ protected override void OnExporting(Projection element, ExportElementContext con } } - protected override void OnImporting(Projection element, ImportElementContext context) { + protected override void OnImportCompleted(Projection element, ImportElementContext context) { var queryIdentity = context.ExportableData.Get("QueryId"); var query = queryIdentity != null ? context.Session.GetItemFromSession(queryIdentity) : default(ContentManagement.ContentItem); diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/RowElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/RowElementDriver.cs index a99ffe37621..cc3069c4e36 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/RowElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/RowElementDriver.cs @@ -1,7 +1,48 @@ -using Orchard.Layouts.Elements; +using System.Collections.Generic; +using System.Linq; +using Orchard.Layouts.Elements; +using Orchard.Layouts.Framework.Display; using Orchard.Layouts.Framework.Drivers; namespace Orchard.Layouts.Drivers { public class RowElementDriver : ElementDriver { + protected override void OnDisplaying(Row element, ElementDisplayingContext context) { + context.ElementShape.Collapsed = false; + } + + protected override void OnDisplayed(Row element, ElementDisplayedContext context) { + var columnShapes = ((IEnumerable)context.ElementShape.Items).ToList(); + var columnIndex = 0; + + foreach (var columnShape in columnShapes) { + var column = (Column)columnShape.Element; + + if (column.Collapsible == true && IsEmpty(columnShape)) { + columnShape.Collapsed = true; + + // Get the first non-collapsed sibling column so we can increase its width with the width of the current column being collapsed. + var sibling = GetNonCollapsedSibling(columnShapes, columnIndex); + if (sibling != null) { + // Increase the width of the sibling by the width of the current column. + sibling.Width += columnShape.Width; + } + else { + // The row has only one column, which is collapsed, so we hide the row entirely. + context.ElementShape.Collapsed = true; + } + } + + ++columnIndex; + } + } + + private dynamic GetNonCollapsedSibling(IList columnShapes, int index) { + var siblings = index == 0 ? columnShapes : columnShapes.Reverse(); + return siblings.FirstOrDefault(x => x.Collapsed == false); + } + + private static bool IsEmpty(dynamic shape) { + return shape.Items.Count == 0; + } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ShapeElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ShapeElementDriver.cs index b2cf2e10f67..1d25f13f2c1 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ShapeElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/ShapeElementDriver.cs @@ -5,13 +5,14 @@ using Orchard.Layouts.Elements; using Orchard.Layouts.Framework.Display; using Orchard.Layouts.Framework.Drivers; +using Orchard.Layouts.Services; namespace Orchard.Layouts.Drivers { public class ShapeElementDriver : FormsElementDriver { private readonly IShapeFactory _shapeFactory; - public ShapeElementDriver(IFormManager formManager, IShapeFactory shapeFactory) - : base(formManager) { + public ShapeElementDriver(IFormsBasedElementServices formsServices, IShapeFactory shapeFactory) + : base(formsServices) { _shapeFactory = shapeFactory; } @@ -19,7 +20,7 @@ protected override IEnumerable FormNames { get { yield return "ShapeElement"; } } - protected override void OnDisplaying(Shape element, ElementDisplayContext context) { + protected override void OnDisplaying(Shape element, ElementDisplayingContext context) { if (String.IsNullOrWhiteSpace(element.ShapeType)) return; diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/TextElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/TextElementDriver.cs index f9f3a9fa2be..e85dad82c9c 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/TextElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/TextElementDriver.cs @@ -27,7 +27,7 @@ protected override EditorResult OnBuildEditor(Text element, ElementEditorContext return Editor(context, editor); } - protected override void OnDisplaying(Text element, ElementDisplayContext context) { + protected override void OnDisplaying(Text element, ElementDisplayingContext context) { context.ElementShape.ProcessedContent = _processor.ProcessContent(element.Content, "textarea", context.GetTokenData()); } } diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/VectorImageElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/VectorImageElementDriver.cs index 8805da7e96a..1d090c8c54e 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/VectorImageElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Drivers/VectorImageElementDriver.cs @@ -39,7 +39,7 @@ protected override EditorResult OnBuildEditor(VectorImage element, ElementEditor return Editor(context, editor); } - protected override void OnDisplaying(VectorImage element, ElementDisplayContext context) { + protected override void OnDisplaying(VectorImage element, ElementDisplayingContext context) { var mediaId = element.MediaId; var vectorImage = mediaId != null ? GetVectorImage(mediaId.Value) : default(VectorImagePart); context.ElementShape.VectorImagePart = vectorImage; diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Elements/Breadcrumbs.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/Breadcrumbs.cs new file mode 100644 index 00000000000..b478b6d3bd5 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/Breadcrumbs.cs @@ -0,0 +1,30 @@ +using Orchard.Layouts.Helpers; + +namespace Orchard.Layouts.Elements { + public class Breadcrumbs : UIElement { + public int StartLevel { + get { return this.Retrieve(x => x.StartLevel); } + set { this.Store(x => x.StartLevel, value); } + } + + public int Levels { + get { return this.Retrieve(x => x.Levels); } + set { this.Store(x => x.Levels, value); } + } + + public bool AddHomePage { + get { return this.Retrieve(x => x.AddHomePage); } + set { this.Store(x => x.AddHomePage, value); } + } + + public bool AddCurrentPage { + get { return this.Retrieve(x => x.AddCurrentPage); } + set { this.Store(x => x.AddCurrentPage, value); } + } + + public int MenuContentItemId { + get { return this.Retrieve(x => x.MenuContentItemId); } + set { this.Store(x => x.MenuContentItemId, value); } + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Elements/Column.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/Column.cs index b17e78a5756..f0b8d3e0ab3 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Elements/Column.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/Column.cs @@ -1,10 +1,9 @@ -using Orchard.Layouts.Framework.Elements; using Orchard.Layouts.Helpers; using Orchard.Localization; namespace Orchard.Layouts.Elements { public class Column : Container { - + public override string Category { get { return "Layout"; } } @@ -34,5 +33,10 @@ public int? Offset { public int Size { get { return Width.GetValueOrDefault() + Offset.GetValueOrDefault(); } } + + public bool? Collapsible { + get { return this.Retrieve(x => x.Collapsible); } + set { this.Store(x => x.Collapsible, value); } + } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Elements/Menu.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/Menu.cs new file mode 100644 index 00000000000..1462ce6bd09 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/Menu.cs @@ -0,0 +1,25 @@ +using Orchard.Layouts.Helpers; + +namespace Orchard.Layouts.Elements { + public class Menu : UIElement { + public int StartLevel { + get { return this.Retrieve(x => x.StartLevel); } + set { this.Store(x => x.StartLevel, value); } + } + + public int Levels { + get { return this.Retrieve(x => x.Levels); } + set { this.Store(x => x.Levels, value); } + } + + public int MenuContentItemId { + get { return this.Retrieve(x => x.MenuContentItemId); } + set { this.Store(x => x.MenuContentItemId, value); } + } + + public bool ShowFullMenu { + get { return this.Retrieve(x => x.ShowFullMenu); } + set { this.Store(x => x.ShowFullMenu, value); } + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Elements/Notifications.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/Notifications.cs new file mode 100644 index 00000000000..47188a3cfcc --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/Notifications.cs @@ -0,0 +1,8 @@ +namespace Orchard.Layouts.Elements { + public class Notifications : UIElement { + + public override bool HasEditor { + get { return false; } + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Elements/PlaceableContentItem.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/PlaceableContentItem.cs new file mode 100644 index 00000000000..441ed697ea7 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/PlaceableContentItem.cs @@ -0,0 +1,23 @@ +using Orchard.Layouts.Framework.Elements; +using Orchard.Layouts.Helpers; + +namespace Orchard.Layouts.Elements { + public class PlaceableContentItem : Element { + public override string Category { + get { return "Content Items"; } + } + + public override bool IsSystemElement { + get { return true; } + } + + public override bool HasEditor { + get { return false; } + } + + public int? ContentItemId { + get { return this.Retrieve(x => x.ContentItemId); } + set { this.Store(x => x.ContentItemId, value); } + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Elements/RecycleBin.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/RecycleBin.cs new file mode 100644 index 00000000000..10b509e2dc5 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/RecycleBin.cs @@ -0,0 +1,8 @@ +using Orchard.Layouts.Framework.Elements; + +namespace Orchard.Layouts.Elements { + public class RecycleBin : Container { + public override string Category { get { return null; } } + public override bool IsSystemElement { get { return true; } } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Elements/UIElement.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/UIElement.cs new file mode 100644 index 00000000000..c98e1860645 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Elements/UIElement.cs @@ -0,0 +1,13 @@ +using Orchard.Layouts.Framework.Elements; + +namespace Orchard.Layouts.Elements { + public abstract class UIElement : Element { + public override string Category { + get { return "UI"; } + } + + public override string ToolboxIcon { + get { return "\uf0c8"; } + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Filters/TokensFilter.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Filters/TokensFilter.cs index ead58641a5c..1dc8a27a5c5 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Filters/TokensFilter.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Filters/TokensFilter.cs @@ -1,8 +1,8 @@ using System; -using System.Collections.Generic; using Orchard.Environment.Extensions; using Orchard.Layouts.Services; using Orchard.Tokens; +using System.Collections.Generic; namespace Orchard.Layouts.Filters { [OrchardFeature("Orchard.Layouts.Tokens")] diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementCreatingDisplayShapeContext.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementCreatingDisplayShapeContext.cs index 22a7af1304d..2b876a8e56f 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementCreatingDisplayShapeContext.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementCreatingDisplayShapeContext.cs @@ -6,5 +6,6 @@ public class ElementCreatingDisplayShapeContext { public IContent Content { get; set; } public Element Element { get; set; } public string DisplayType { get; set; } + public bool Cancel { get; set; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementDisplay.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementDisplay.cs index dd29d974c96..3d88c4f6c77 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementDisplay.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementDisplay.cs @@ -4,7 +4,6 @@ using Orchard.ContentManagement; using Orchard.DisplayManagement; using Orchard.Layouts.Elements; -using Orchard.Layouts.Framework.Drivers; using Orchard.Layouts.Framework.Elements; using Orchard.Layouts.Services; using Orchard.UI.Zones; @@ -12,7 +11,7 @@ using ContentItem = Orchard.ContentManagement.ContentItem; namespace Orchard.Layouts.Framework.Display { - public class ElementDisplay : IElementDisplay { + public class ElementDisplay : Component, IElementDisplay { private readonly IShapeFactory _shapeFactory; private readonly IElementEventHandler _elementEventHandlerHandler; @@ -25,24 +24,27 @@ public dynamic DisplayElement( Element element, IContent content, string displayType = null, - IUpdateModel updater = null, - string renderEventName = null, - string renderEventArgs = null) { + IUpdateModel updater = null) { + var typeName = element.GetType().Name; + var category = element.Category.ToSafeName(); + var drivers = element.Descriptor.GetDrivers().ToList(); var createShapeContext = new ElementCreatingDisplayShapeContext { Element = element, DisplayType = displayType, Content = content, }; - element.Descriptor.CreatingDisplay(createShapeContext); + _elementEventHandlerHandler.CreatingDisplay(createShapeContext); + drivers.Invoke(driver => driver.CreatingDisplay(createShapeContext), Logger); + if (element.Descriptor.CreatingDisplay != null) + element.Descriptor.CreatingDisplay(createShapeContext); + + if (createShapeContext.Cancel) + return null; - var typeName = element.GetType().Name; - var category = element.Category.ToSafeName(); - var drivers = element.Descriptor.GetDrivers(); var elementShapeArguments = CreateArguments(element, content); var elementShape = (dynamic)_shapeFactory.Create("Element", elementShapeArguments, () => new ZoneHolding(() => _shapeFactory.Create("ElementZone"))); - elementShape.Metadata.DisplayType = displayType; elementShape.Metadata.Alternates.Add(String.Format("Elements_{0}", typeName)); @@ -50,41 +52,60 @@ public dynamic DisplayElement( elementShape.Metadata.Alternates.Add(String.Format("Elements_{0}__{1}", typeName, category)); elementShape.Metadata.Alternates.Add(String.Format("Elements_{0}_{1}__{2}", typeName, displayType, category)); - var displayContext = new ElementDisplayContext { + var displayingContext = new ElementDisplayingContext { Element = element, ElementShape = elementShape, DisplayType = displayType, Content = content, - Updater = updater, - RenderEventName = renderEventName, - RenderEventArgs = renderEventArgs + Updater = updater }; - _elementEventHandlerHandler.Displaying(displayContext); - InvokeDrivers(drivers, driver => driver.Displaying(displayContext)); - element.Descriptor.Display(displayContext); + _elementEventHandlerHandler.Displaying(displayingContext); + drivers.Invoke(driver => driver.Displaying(displayingContext), Logger); + + if (element.Descriptor.Displaying != null) + element.Descriptor.Displaying(displayingContext); var container = element as Container; if (container != null) { if (container.Elements.Any()) { + var childIndex = 0; foreach (var child in container.Elements) { var childShape = DisplayElement(child, content, displayType: displayType, updater: updater); - childShape.Parent = elementShape; - elementShape.Add(childShape); + + if (childShape != null) { + childShape.Parent = elementShape; + elementShape.Add(childShape, childIndex++.ToString()); + } } } } + var displayedContext = new ElementDisplayedContext { + Element = element, + ElementShape = elementShape, + DisplayType = displayType, + Content = content, + Updater = updater + }; + + _elementEventHandlerHandler.Displayed(displayedContext); + drivers.Invoke(driver => driver.Displayed(displayedContext), Logger); + + if (element.Descriptor.Displayed != null) + element.Descriptor.Displayed(displayedContext); + return elementShape; } - public dynamic DisplayElements(IEnumerable elements, IContent content, string displayType = null, IUpdateModel updater = null, string renderEventName = null, string renderEventArgs = null) { + public dynamic DisplayElements(IEnumerable elements, IContent content, string displayType = null, IUpdateModel updater = null) { var layoutRoot = (dynamic)_shapeFactory.Create("LayoutRoot"); + var index = 0; foreach (var element in elements) { - var elementShape = DisplayElement(element, content, displayType, updater, renderEventName, renderEventArgs); - layoutRoot.Add(elementShape); + var elementShape = DisplayElement(element, content, displayType, updater); + layoutRoot.Add(elementShape, index++.ToString()); } return layoutRoot; @@ -100,11 +121,5 @@ private static INamedEnumerable CreateArguments(Element element, IConten return Arguments.From(dictionary); } - - private void InvokeDrivers(IEnumerable drivers, Action driverAction) { - foreach (var driver in drivers) { - driverAction(driver); - } - } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementDisplayContext.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementDisplayContext.cs deleted file mode 100644 index 392ce54e1dc..00000000000 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementDisplayContext.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Orchard.ContentManagement; -using Orchard.Layouts.Framework.Elements; - -namespace Orchard.Layouts.Framework.Display { - public class ElementDisplayContext { - public IContent Content { get; set; } - public Element Element { get; set; } - public string DisplayType { get; set; } - public dynamic ElementShape { get; set; } - public IUpdateModel Updater { get; set; } - public string RenderEventName { get; set; } - public string RenderEventArgs { get; set; } - } -} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementDisplayedContext.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementDisplayedContext.cs new file mode 100644 index 00000000000..d8b885625e0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementDisplayedContext.cs @@ -0,0 +1,12 @@ +using Orchard.ContentManagement; +using Orchard.Layouts.Framework.Elements; + +namespace Orchard.Layouts.Framework.Display { + public class ElementDisplayedContext { + public IContent Content { get; set; } + public Element Element { get; set; } + public string DisplayType { get; set; } + public dynamic ElementShape { get; set; } + public IUpdateModel Updater { get; set; } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementDisplayingContext.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementDisplayingContext.cs new file mode 100644 index 00000000000..2bc87380324 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/ElementDisplayingContext.cs @@ -0,0 +1,12 @@ +using Orchard.ContentManagement; +using Orchard.Layouts.Framework.Elements; + +namespace Orchard.Layouts.Framework.Display { + public class ElementDisplayingContext { + public IContent Content { get; set; } + public Element Element { get; set; } + public string DisplayType { get; set; } + public dynamic ElementShape { get; set; } + public IUpdateModel Updater { get; set; } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/IElementDisplay.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/IElementDisplay.cs index 9e14e05071f..a06c66ea548 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/IElementDisplay.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Display/IElementDisplay.cs @@ -4,7 +4,7 @@ namespace Orchard.Layouts.Framework.Display { public interface IElementDisplay : IDependency { - dynamic DisplayElement(Element element, IContent content, string displayType = null, IUpdateModel updater = null, string renderEventName = null, string renderEventArgs = null); - dynamic DisplayElements(IEnumerable elements, IContent content, string displayType = null, IUpdateModel updater = null, string renderEventName = null, string renderEventArgs = null); + dynamic DisplayElement(Element element, IContent content, string displayType = null, IUpdateModel updater = null); + dynamic DisplayElements(IEnumerable elements, IContent content, string displayType = null, IUpdateModel updater = null); } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ElementDriver.cs index 946b21cfafb..ba829b5909e 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ElementDriver.cs @@ -17,10 +17,18 @@ public EditorResult UpdateEditor(ElementEditorContext context) { return OnUpdateEditor((TElement)context.Element, context); } - public void Displaying(ElementDisplayContext context) { + public void CreatingDisplay(ElementCreatingDisplayShapeContext context) { + OnCreatingDisplay((TElement)context.Element, context); + } + + public void Displaying(ElementDisplayingContext context) { OnDisplaying((TElement) context.Element, context); } + public void Displayed(ElementDisplayedContext context) { + OnDisplayed((TElement)context.Element, context); + } + public void LayoutSaving(ElementSavingContext context) { OnLayoutSaving((TElement) context.Element, context); } @@ -33,10 +41,22 @@ public void Exporting(ExportElementContext context) { OnExporting((TElement)context.Element, context); } + public void Exported(ExportElementContext context) { + OnExported((TElement)context.Element, context); + } + public void Importing(ImportElementContext context) { OnImporting((TElement)context.Element, context); } + public void Imported(ImportElementContext context) { + OnImported((TElement)context.Element, context); + } + + public void ImportCompleted(ImportElementContext context) { + OnImportCompleted((TElement)context.Element, context); + } + protected virtual EditorResult OnBuildEditor(TElement element, ElementEditorContext context) { return null; } @@ -45,7 +65,13 @@ protected virtual EditorResult OnUpdateEditor(TElement element, ElementEditorCon return OnBuildEditor(element, context); } - protected virtual void OnDisplaying(TElement element, ElementDisplayContext context) { + protected virtual void OnCreatingDisplay(TElement element, ElementCreatingDisplayShapeContext context) { + } + + protected virtual void OnDisplaying(TElement element, ElementDisplayingContext context) { + } + + protected virtual void OnDisplayed(TElement element, ElementDisplayedContext context) { } protected virtual void OnLayoutSaving(TElement element, ElementSavingContext context) { @@ -57,9 +83,18 @@ protected virtual void OnRemoving(TElement element, ElementRemovingContext conte protected virtual void OnExporting(TElement element, ExportElementContext context) { } + protected virtual void OnExported(TElement element, ExportElementContext context) { + } + protected virtual void OnImporting(TElement element, ImportElementContext context) { } + protected virtual void OnImported(TElement element, ImportElementContext context) { + } + + protected virtual void OnImportCompleted(TElement element, ImportElementContext context) { + } + protected EditorResult Editor(ElementEditorContext context, params dynamic[] editorShapes) { foreach (var editorShape in editorShapes) { if (String.IsNullOrWhiteSpace(editorShape.Metadata.Position)) { diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ExportElementContext.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ExportElementContext.cs index c00032302f3..be60f48e139 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ExportElementContext.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ExportElementContext.cs @@ -3,12 +3,14 @@ namespace Orchard.Layouts.Framework.Drivers { public class ExportElementContext { - public ExportElementContext() { - ExportableData = new ElementDataDictionary(); + public ExportElementContext(Element element, ILayoutAspect layout, ElementDataDictionary exportableData) { + Element = element; + Layout = layout; + ExportableData = exportableData; } - public ILayoutAspect Layout { get; set; } - public Element Element { get; set; } - public ElementDataDictionary ExportableData { get; set; } + public ILayoutAspect Layout { get; private set; } + public Element Element { get; private set; } + public ElementDataDictionary ExportableData { get; private set; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/FormsElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/FormsElementDriver.cs index 4d48a0c4001..92281c0dc16 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/FormsElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/FormsElementDriver.cs @@ -3,18 +3,34 @@ using System.Linq; using Orchard.Forms.Services; using Orchard.Layouts.Framework.Elements; +using Orchard.Layouts.Helpers; +using Orchard.Layouts.Services; namespace Orchard.Layouts.Framework.Drivers { public abstract class FormsElementDriver : ElementDriver, IFormProvider where TElement : Element { private readonly IFormManager _formManager; + private readonly ICultureAccessor _cultureAccessor; - protected FormsElementDriver(IFormManager formManager) { - _formManager = formManager; + protected FormsElementDriver(IFormsBasedElementServices formsServices) { + _formManager = formsServices.FormManager; + _cultureAccessor = formsServices.CultureAccessor; } protected dynamic BuildForm(ElementEditorContext context, string formName, string position = null) { // TODO: Fix Forms API so that it works with prefixes. Right now only binding implements prefix, but building a form ignores the specified prefix. - var form = _formManager.Bind(_formManager.Build(formName), context.ValueProvider); + + // If not a post-back, we need to bind the form with the element's data values. Otherwise, bind the form with the posted values. + var valueProvider = context.Updater == null + ? context.Element.Data.ToValueProvider(_cultureAccessor.CurrentCulture) + : context.ValueProvider; + + var form = _formManager.Bind(_formManager.Build(formName), valueProvider); + + if (context.Updater != null) { + // Update the element's data dictionary with the posted values. + Action process = s => UpdateElementProperty(s, context); + FormNodesProcessor.ProcessForm(form, process); + } if (!String.IsNullOrWhiteSpace(position)) { form.Metadata.Position = position; @@ -34,11 +50,37 @@ protected override EditorResult OnBuildEditor(TElement element, ElementEditorCon protected dynamic BuildForms(ElementEditorContext context) { // TODO: Fix Forms API so that it works with prefixes. Right now only binding implements prefix, but building a form ignores the specified prefix. - var forms = FormNames.Reverse().Select(x => _formManager.Bind(_formManager.Build(x), context.ValueProvider)).ToArray(); + + // If not a post-back, we need to bind the form with the element's data values. Otherwise, bind the form with the posted values. + var valueProvider = context.Updater == null + ? context.Element.Data.ToValueProvider(_cultureAccessor.CurrentCulture) + : context.ValueProvider; + + var forms = FormNames.Reverse().Select(x => { + var shape = _formManager.Bind(_formManager.Build(x), valueProvider); + + if (context.Updater != null) { + // Update the element's data dictionary with the posted values. + Action process = s => UpdateElementProperty(s, context); + FormNodesProcessor.ProcessForm(shape, process); + } + + return shape; + }).ToArray(); var formShape = context.ShapeFactory.ElementEditor__Forms(Forms: forms); return formShape; } + private void UpdateElementProperty(dynamic formElementShape, ElementEditorContext context) { + var name = (string)formElementShape.Name; + if (name != null) { + var value = context.ValueProvider.GetValue(context.Prefix + name); + if (value != null) { + context.Element.Data[name] = value.AttemptedValue; + } + } + } + public void Describe(DescribeContext context) { DescribeForm(context); } diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/IElementDriver.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/IElementDriver.cs index 9101662781a..878225ca384 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/IElementDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/IElementDriver.cs @@ -6,10 +6,15 @@ public interface IElementDriver : IDependency { int Priority { get; } EditorResult BuildEditor(ElementEditorContext context); EditorResult UpdateEditor(ElementEditorContext context); - void Displaying(ElementDisplayContext context); + void CreatingDisplay(ElementCreatingDisplayShapeContext context); + void Displaying(ElementDisplayingContext context); + void Displayed(ElementDisplayedContext context); void LayoutSaving(ElementSavingContext context); void Removing(ElementRemovingContext context); void Exporting(ExportElementContext context); + void Exported(ExportElementContext context); void Importing(ImportElementContext context); + void Imported(ImportElementContext context); + void ImportCompleted(ImportElementContext context); } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ImportContentSessionWrapper.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ImportContentSessionWrapper.cs new file mode 100644 index 00000000000..c1f74bb0606 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ImportContentSessionWrapper.cs @@ -0,0 +1,15 @@ +using Orchard.ContentManagement; + +namespace Orchard.Layouts.Framework.Drivers { + public class ImportContentSessionWrapper : IContentImportSession { + private readonly ImportContentSession _session; + + public ImportContentSessionWrapper(ImportContentSession session) { + _session = session; + } + + public ContentItem GetItemFromSession(string id) { + return _session.Get(id); + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ImportElementContext.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ImportElementContext.cs index 51d5c31466a..7b6e7cb247f 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ImportElementContext.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Drivers/ImportElementContext.cs @@ -3,13 +3,16 @@ namespace Orchard.Layouts.Framework.Drivers { public class ImportElementContext { - public ImportElementContext() { - ExportableData = new ElementDataDictionary(); + public ImportElementContext(Element element, ILayoutAspect layout, ElementDataDictionary exportableData, IContentImportSession session) { + Element = element; + Layout = layout; + ExportableData = exportableData; + Session = session; } - public ILayoutAspect Layout { get; set; } - public Element Element { get; set; } - public ElementDataDictionary ExportableData { get; set; } - public IContentImportSession Session { get; set; } + public ILayoutAspect Layout { get; private set; } + public Element Element { get; private set; } + public ElementDataDictionary ExportableData { get; private set; } + public IContentImportSession Session { get; private set; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/Element.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/Element.cs index 54162341710..16aa590e688 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/Element.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/Element.cs @@ -3,7 +3,7 @@ using Orchard.Utility.Extensions; namespace Orchard.Layouts.Framework.Elements { - public abstract class Element { + public abstract class Element : IElement { protected Element() { T = NullLocalizer.Instance; Data = new ElementDataDictionary(); @@ -41,6 +41,7 @@ public virtual string ToolboxIcon { public string HtmlId { get; set; } public string HtmlClass { get; set; } public string HtmlStyle { get; set; } + public string Rule { get; set; } public ElementDataDictionary ExportableData { get; set; } public ElementDescriptor Descriptor { get; set; } public ElementDataDictionary Data { get; set; } diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/ElementDescriptor.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/ElementDescriptor.cs index bc300d1e5f4..dc8b606f6a9 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/ElementDescriptor.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/ElementDescriptor.cs @@ -15,9 +15,16 @@ public ElementDescriptor(Type elementType, string typeName, LocalizedString disp Category = category; GetDrivers = Enumerable.Empty; CreatingDisplay = context => { }; - Display = context => {}; + Displaying = context => { }; Editor = context => { }; UpdateEditor = context => { }; + LayoutSaving = context => { }; + Removing = context => { }; + Exporting = context => { }; + Exported = context => { }; + Importing = context => { }; + Imported = context => { }; + ImportCompleted = context => { }; StateBag = new Dictionary(); } @@ -29,9 +36,17 @@ public ElementDescriptor(Type elementType, string typeName, LocalizedString disp public string TypeName { get; set; } public Func> GetDrivers { get; set; } public Action CreatingDisplay { get; set; } - public Action Display { get; set; } + public Action Displaying { get; set; } + public Action Displayed { get; set; } public Action Editor { get; set; } public Action UpdateEditor { get; set; } + public Action LayoutSaving { get; set; } + public Action Removing { get; set; } + public Action Exporting { get; set; } + public Action Exported { get; set; } + public Action Importing { get; set; } + public Action Imported { get; set; } + public Action ImportCompleted { get; set; } public bool IsSystemElement { get; set; } public bool EnableEditorDialog { get; set; } public IDictionary StateBag { get; set; } diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/ElementRemovingContext.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/ElementRemovingContext.cs index 753971b5425..a1c6b61f3b6 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/ElementRemovingContext.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/ElementRemovingContext.cs @@ -1,11 +1,20 @@ -namespace Orchard.Layouts.Framework.Elements { - public class ElementRemovingContext : LayoutSavingContext { - public ElementRemovingContext(LayoutSavingContext stub) { - Content = stub.Content; - RemovedElements = stub.RemovedElements; - Updater = stub.Updater; - Elements = stub.Elements; +using System.Collections.Generic; +using Orchard.ContentManagement; + +namespace Orchard.Layouts.Framework.Elements { + public class ElementRemovingContext { + public ElementRemovingContext(Element element, IEnumerable elements, IEnumerable removedElements, IContent content) { + Element = element; + Elements = elements; + RemovedElements = removedElements; + Content = content; } - public Element Element { get; set; } + + public IContent Content { get; private set; } + // All the other elements on the canvas. + public IEnumerable Elements { get; set; } + // All the other removed elements from the canvas (including the current element). + public IEnumerable RemovedElements { get; set; } + public Element Element { get; private set; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/ElementSavingContext.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/ElementSavingContext.cs index 46e31754fc2..d8aeeb13c03 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/ElementSavingContext.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/ElementSavingContext.cs @@ -1,10 +1,11 @@ namespace Orchard.Layouts.Framework.Elements { public class ElementSavingContext : LayoutSavingContext { - public ElementSavingContext(LayoutSavingContext stub) { + public ElementSavingContext(Element element, LayoutSavingContext stub) { + Element = element; Content = stub.Content; Updater = stub.Updater; Elements = stub.Elements; } - public Element Element { get; set; } + public Element Element { get; private set; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/IElement.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/IElement.cs new file mode 100644 index 00000000000..0cf0c8f1f76 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Elements/IElement.cs @@ -0,0 +1,3 @@ +namespace Orchard.Layouts.Framework.Elements { + public interface IElement : ITransientDependency {} +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Harvesters/IElementHarvester.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Harvesters/IElementHarvester.cs index d24962df5e2..dbd1787b042 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Harvesters/IElementHarvester.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Framework/Harvesters/IElementHarvester.cs @@ -2,7 +2,7 @@ using Orchard.Layouts.Framework.Elements; namespace Orchard.Layouts.Framework.Harvesters { - public interface ElementHarvester : ISingletonDependency { + public interface IElementHarvester : ISingletonDependency { IEnumerable HarvestElements(HarvestElementsContext context); } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Handlers/ElementDriversCoordinator.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Handlers/ElementDriversCoordinator.cs index 904dd08c7b2..542f5120750 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Handlers/ElementDriversCoordinator.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Handlers/ElementDriversCoordinator.cs @@ -1,5 +1,6 @@ using System; using Orchard.Layouts.Framework.Drivers; +using Orchard.Layouts.Framework.Elements; using Orchard.Layouts.Services; namespace Orchard.Layouts.Handlers { @@ -17,6 +18,34 @@ public override void UpdateEditor(ElementEditorContext context) { BuildEditorInternal(context, driver => driver.UpdateEditor(context)); } + public override void LayoutSaving(ElementSavingContext context) { + InvokeDrivers(context.Element, driver => driver.LayoutSaving(context)); + } + + public override void Removing(ElementRemovingContext context) { + InvokeDrivers(context.Element, driver => driver.Removing(context)); + } + + public override void Exporting(ExportElementContext context) { + InvokeDrivers(context.Element, driver => driver.Exporting(context)); + } + + public override void Exported(ExportElementContext context) { + InvokeDrivers(context.Element, driver => driver.Exported(context)); + } + + public override void Importing(ImportElementContext context) { + InvokeDrivers(context.Element, driver => driver.Importing(context)); + } + + public override void Imported(ImportElementContext context) { + InvokeDrivers(context.Element, driver => driver.Imported(context)); + } + + public override void ImportCompleted(ImportElementContext context) { + InvokeDrivers(context.Element, driver => driver.ImportCompleted(context)); + } + private void BuildEditorInternal(ElementEditorContext context, Func action) { var descriptor = context.Element.Descriptor; var drivers = _elementManager.GetDrivers(descriptor); @@ -36,5 +65,10 @@ private void BuildEditorInternal(ElementEditorContext context, Func action) { + var drivers = _elementManager.GetDrivers(element.Descriptor); + drivers.Invoke(action, Logger); + } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Handlers/ElementRuleCoordinator.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Handlers/ElementRuleCoordinator.cs new file mode 100644 index 00000000000..ad5fd9989a8 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Handlers/ElementRuleCoordinator.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using Orchard.Conditions.Services; +using Orchard.Layouts.Framework.Display; +using Orchard.Layouts.Services; + +namespace Orchard.Layouts.Handlers { + public class ElementRuleCoordinator : ElementEventHandlerBase { + private readonly IConditionManager _conditionManager; + private readonly Dictionary _evaluations = new Dictionary(); + + public ElementRuleCoordinator(IConditionManager conditionManager) { + _conditionManager = conditionManager; + } + + public override void CreatingDisplay(ElementCreatingDisplayShapeContext context) { + if (context.DisplayType == "Design") + return; + + if (String.IsNullOrWhiteSpace(context.Element.Rule)) + return; + + context.Cancel = !EvaluateRule(context.Element.Rule); + } + + private bool EvaluateRule(string rule) { + if (_evaluations.ContainsKey(rule)) + return _evaluations[rule]; + + var result = _conditionManager.Matches(rule); + _evaluations[rule] = result; + return result; + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Handlers/LayoutPartHandler.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Handlers/LayoutPartHandler.cs index 0e2c3b37ac5..a61e5e3019b 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Handlers/LayoutPartHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Handlers/LayoutPartHandler.cs @@ -1,10 +1,13 @@ using System; +using System.Collections.Generic; +using System.Linq; using Orchard.Alias; using Orchard.Autoroute.Models; using Orchard.ContentManagement; using Orchard.ContentManagement.Handlers; using Orchard.Data; using Orchard.DisplayManagement; +using Orchard.Layouts.Framework.Elements; using Orchard.Layouts.Models; using Orchard.Layouts.Services; using Orchard.Utility.Extensions; @@ -17,13 +20,15 @@ public class LayoutPartHandler : ContentHandler { private readonly IShapeDisplay _shapeDisplay; private readonly ILayoutSerializer _serializer; private readonly IAliasService _aliasService; + private readonly IElementManager _elementManager; public LayoutPartHandler( - IRepository repository, - ILayoutManager layoutManager, - IContentManager contentManager, - IContentPartDisplay contentPartDisplay, - IShapeDisplay shapeDisplay, + IRepository repository, + ILayoutManager layoutManager, + IElementManager elementManager, + IContentManager contentManager, + IContentPartDisplay contentPartDisplay, + IShapeDisplay shapeDisplay, ILayoutSerializer serializer, IAliasService aliasService) { @@ -33,10 +38,12 @@ public LayoutPartHandler( _shapeDisplay = shapeDisplay; _serializer = serializer; _aliasService = aliasService; + _elementManager = elementManager; Filters.Add(StorageFilter.For(repository)); OnPublished(UpdateTemplateClients); OnIndexing(IndexLayout); + OnRemoved(RemoveElements); } private void IndexLayout(IndexContentContext context, LayoutPart part) { @@ -87,6 +94,16 @@ private void UpdateTemplateClients(LayoutPart part) { } } + private void RemoveElements(RemoveContentContext context, LayoutPart part) { + var elements = _layoutManager.LoadElements(part).ToList(); + var savingContext = new LayoutSavingContext { + Content = part, + Elements = new List(), + RemovedElements = elements + }; + _elementManager.Removing(savingContext); + } + private bool IsHomePage(IContent content) { var homepage = _aliasService.Get(String.Empty); var displayRouteValues = _contentManager.GetItemMetadata(content).DisplayRouteValues; diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/ElementDisplayContextHelper.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/ElementDisplayContextHelper.cs index 3181b810765..f4daaf51d55 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/ElementDisplayContextHelper.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/ElementDisplayContextHelper.cs @@ -4,7 +4,7 @@ namespace Orchard.Layouts.Helpers { public static class ElementDisplayContextHelper { - public static IDictionary GetTokenData(this ElementDisplayContext context) { + public static IDictionary GetTokenData(this ElementDisplayingContext context) { var data = new Dictionary(); if (context.Content != null) diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/MetaDataExtensions.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/MetaDataExtensions.cs index 0464c664469..aebdde50e13 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/MetaDataExtensions.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/MetaDataExtensions.cs @@ -5,5 +5,9 @@ public static class MetaDataExtensions { public static ContentPartDefinitionBuilder Placeable(this ContentPartDefinitionBuilder builder, bool placeable = true) { return builder.WithSetting("ContentPartLayoutSettings.Placeable", placeable.ToString()); } + + public static ContentTypeDefinitionBuilder Placeable(this ContentTypeDefinitionBuilder builder, bool placeable = true) { + return builder.WithSetting("ContentTypeLayoutSettings.Placeable", placeable.ToString()); + } } } diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/PlaceableContentExtensions.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/PlaceableContentExtensions.cs new file mode 100644 index 00000000000..498db8c34fd --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/PlaceableContentExtensions.cs @@ -0,0 +1,14 @@ +using Orchard.ContentManagement; +using Orchard.ContentManagement.FieldStorage.InfosetStorage; + +namespace Orchard.Layouts.Helpers { + public static class PlaceableContentExtensions { + public static bool IsPlaceableContent(this IContent content) { + return content.As().Retrieve("PlacedAsElement"); + } + + public static void IsPlaceableContent(this IContent content, bool value) { + content.As().Store("PlacedAsElement", value); + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/SnippetHtmlExtensions.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/SnippetHtmlExtensions.cs new file mode 100644 index 00000000000..d6b40ab2d04 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/SnippetHtmlExtensions.cs @@ -0,0 +1,68 @@ +using System; +using System.Web; +using System.Web.Mvc; +using Orchard.Layouts.Elements; +using Orchard.Layouts.Models; +using Orchard.Localization; + +namespace Orchard.Layouts.Helpers { + public static class SnippetHtmlExtensions { + + public static SnippetFieldDescriptorBuilder SnippetField(this HtmlHelper htmlHelper, string name, string type = null) { + var shape = (dynamic) htmlHelper.ViewData.Model; + + return new SnippetFieldDescriptorBuilder(shape) + .Named(name) + .WithType(type); + } + + public class SnippetFieldDescriptorBuilder : IHtmlString { + private readonly dynamic _shape; + + public SnippetFieldDescriptorBuilder(dynamic shape) { + _shape = shape; + Descriptor = new SnippetFieldDescriptor(); + } + + public SnippetFieldDescriptor Descriptor { get; private set; } + + public SnippetFieldDescriptorBuilder Named(string value) { + Descriptor.Name = value; + return this; + } + + public SnippetFieldDescriptorBuilder WithType(string value) { + Descriptor.Type = value; + return this; + } + + public SnippetFieldDescriptorBuilder DisplayedAs(LocalizedString value) { + Descriptor.DisplayName = value; + return this; + } + + public SnippetFieldDescriptorBuilder WithDescription(LocalizedString value) { + Descriptor.Description = value; + return this; + } + + public override string ToString() { + var registratorCallback = (Action)_shape.DescriptorRegistrationCallback; + + if (registratorCallback != null) + registratorCallback(Descriptor); + + var element = (Snippet)_shape.Element; + + if(element != null) + return element.Data.Get(Descriptor.Name); + + return null; + } + + public string ToHtmlString() { + return ToString(); + } + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/TagBuilderExtensions.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/TagBuilderExtensions.cs index 8b68d9f7e87..e8b8675a0e4 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/TagBuilderExtensions.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Helpers/TagBuilderExtensions.cs @@ -1,5 +1,6 @@ -using System; +using System; using System.Collections.Generic; +using System.Linq; using System.Text.RegularExpressions; using Orchard.DisplayManagement.Shapes; using Orchard.Layouts.Framework.Elements; @@ -37,11 +38,17 @@ public static IDictionary GetCommonElementAttributes(dynamic sha attributes["style"] = Regex.Replace(tokenize(), @"(?:\r\n|[\r\n])", ""); } + IList classes = shape.Classes; + if (!String.IsNullOrWhiteSpace(htmlClass)) { var tokenize = (Func)shape.TokenizeHtmlClass; - attributes["class"] = tokenize(); + var cssClass = tokenize(); + classes.Add(cssClass); } + if(classes.Any()) + attributes["class"] = String.Join(" ", classes); + return attributes; } @@ -51,4 +58,4 @@ public static void AddClientValidationAttributes(this OrchardTagBuilder tagBuild } } } -} \ No newline at end of file +} diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Images/Web.config b/src/Orchard.Web/Modules/Orchard.Layouts/Images/Web.config index 11135c33761..93eab9a7372 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Images/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Images/Web.config @@ -1,16 +1,12 @@ - + - - - - - - - - - - + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Migrations.cs index 74612076306..0261358fc83 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Migrations.cs @@ -29,7 +29,7 @@ public int Create() { .WithSetting("OwnerEditorSettings.ShowOwnerEditor", "false") .WithSetting("DateEditorSettings.ShowDateEditor", "false")) .WithPart("TitlePart") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("LayoutPart", p => p .WithSetting("LayoutTypePartSettings.IsTemplate", "True")) .DisplayedAs("Layout") @@ -39,7 +39,7 @@ public int Create() { .WithPart("CommonPart", p => p .WithSetting("OwnerEditorSettings.ShowOwnerEditor", "false") .WithSetting("DateEditorSettings.ShowDateEditor", "false")) - .WithPart("IdentityPart") + .WithIdentity() .WithPart("WidgetPart") .WithPart("LayoutPart") .WithSetting("Stereotype", "Widget") @@ -72,7 +72,7 @@ public int UpdateFrom1() { public int UpdateFrom2() { ContentDefinitionManager.AlterTypeDefinition("Layout", type => type - .WithPart("IdentityPart")); + .WithIdentity()); return 3; } @@ -83,7 +83,7 @@ private void DefineElementWidget(string widgetTypeName, string widgetDisplayedAs .WithSetting("OwnerEditorSettings.ShowOwnerEditor", "false") .WithSetting("DateEditorSettings.ShowDateEditor", "false")) .WithPart("WidgetPart") - .WithPart("IdentityPart") + .WithIdentity() .WithPart("ElementWrapperPart", p => p .WithSetting("ElementWrapperPartSettings.ElementTypeName", elementTypeName)) .WithSetting("Stereotype", "Widget") diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Models/ILayoutAspect.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Models/ILayoutAspect.cs index 67c116a3fd6..8b703f68d00 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Models/ILayoutAspect.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Models/ILayoutAspect.cs @@ -2,6 +2,7 @@ namespace Orchard.Layouts.Models { public interface ILayoutAspect : IContent { + int? TemplateId { get; set; } string LayoutData { get; set; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Models/SnippetDescriptor.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Models/SnippetDescriptor.cs new file mode 100644 index 00000000000..6a4c4332de5 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Models/SnippetDescriptor.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace Orchard.Layouts.Models { + public class SnippetDescriptor { + public SnippetDescriptor() { + Fields = new List(); + } + + public IList Fields { get; set; } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Models/SnippetFieldDescriptor.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Models/SnippetFieldDescriptor.cs new file mode 100644 index 00000000000..7c5353303c0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Models/SnippetFieldDescriptor.cs @@ -0,0 +1,10 @@ +using Orchard.Localization; + +namespace Orchard.Layouts.Models { + public class SnippetFieldDescriptor { + public string Type { get; set; } + public string Name { get; set; } + public LocalizedString DisplayName { get; set; } + public LocalizedString Description { get; set; } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Module.txt b/src/Orchard.Web/Modules/Orchard.Layouts/Module.txt index 75edd035d2c..cedbb6f07dd 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Module.txt +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Module.txt @@ -10,7 +10,7 @@ Features: Orchard.Layouts: Name: Layouts Description: Provides tools to create layouts. - Dependencies: Common, Orchard.jQuery, Orchard.Forms, Orchard.Tokens, Orchard.MediaLibrary + Dependencies: Common, Orchard.Forms, Orchard.Tokens, Orchard.MediaLibrary, Orchard.Conditions, Orchard.Resources Category: Layout Orchard.Layouts.Snippets: Name: Layout Snippets @@ -32,3 +32,8 @@ Features: Description: Provides an element token provider that enables elements to be rendered using a token and enables tokens to be used inside of various elements such as Html, Text and Paragraph. Category: Layout Dependencies: Orchard.Layouts, Orchard.Tokens + Orchard.Layouts.UI: + Name: UI Elements + Description: Adds UI elements to the system, such as Notifications and Menu. + Category: Layout + Dependencies: Orchard.Layouts diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Notes.txt b/src/Orchard.Web/Modules/Orchard.Layouts/Notes.txt deleted file mode 100644 index 0751f50fe87..00000000000 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Notes.txt +++ /dev/null @@ -1,105 +0,0 @@ - -STATES: - - The following classes are used: - * layout-canvas: the root canvas that hosts layout elements - * layout-container: an element that can contain other elements, such as the canvas, grid, row and column - * layout-child-wrapper: a div used to wrap each one of a containers children - * layout-element: a layout element - * layout-grid: a layout grid element; can contain rows - * layout-row: a layout row element; can contain columns - * layout-column: a layout column element; can contain any other element - * layout-column-span-*: denotes the width of a column element - * layout-panel: a docked UI panel for interacting with an element (invoking its actions) - * layout-panel-item: an item on a UI panel; can be one of the following: - - layout-panel-action: an icon button for invoking an element action such as edit, delete or split; only shown when an element is focused - - layout-panel-label: a label for showing the type of an element (such as "row" or "column"); only shown when an element is active or focused - * layout-popup: a floating UI popup for interacting with an element (invoking its actions) - * layout-popup-item: an item on a UI popup; can be one of the following: - - layout-popup-action: a button for invoking a choice - - layout-popup-label: a static label - - Elements have four states: - * Default: none of the other states apply - * Active: the user hovers over the element; represented by the layout-element-active class - * Selected: either the element itself or one of its descendant elements is focused; represented by the layout-element-selected class - * Focused: the user has clicked on the element and it can now be edited; represented by the layout-element-focused class - - When an element becomes focused, all other elements automatically become unfocused. - Selected elements can never be active, i.e. hovering over them has no additional effect. - - -MANIPULATION MY HANDLE: - - You can always drag an edge. - Right edge to increase/decrease width. - Left edge to increase/decrease offset AND width. - Visually and "mechanically" intuitive. - - If there is an adjacent neighbor on the side being dragged: - The near edge of the neigbor column follows. - Neighbor gets inversely manipulated. - Movement is limited by MIN width of both columns. - - If there is no adjacent neighbor on the side being dragged: - Movement is limited by MIN width of current column AND available space beside it. - Two operations required to a) fill the gap to nearest neighbor and b) grow even further shrinking the nearest neighbor. - -MANIPULATION BY BUTTONS: - - Grow and shrink cannot be done - no buttons for that. - - Split: - Always even parts when possible (divisible by two). - Otherwise left part is bigger by one. - - Offset increase: - Move if space is available to the right. - Otherwise move AND shrink. - - Offset decrease: - Only if space is available to the left. - The corresponding offset is added on the next column to the right (movement appears "independent" of other columns in the row). - - Move left/right (reorder). - -KEYBOARD SHORTCUTS: - - DEL deletes the element. - SPACE invokes properties popup. - ENTER invokes edit element button (content elements only). - INS invokes the add button (containers only). - ALT+DOWN focuses first child (containers only). - ALT+UP focuses parent. - - For columns: - SHIFT+LEFT/RIGHT contracts/expands column using the right edge. - ALT+LEFT/RIGHT expands/contracts column using the left edge. - NOTE: - - SHIFT+ALT can be combined to simultaneously manipulate both edges (i.e. "moving" the column within the row). - - By default when resizing columns any immediately adjacent columns will follow along (and be inversely resized). - - CTRL can be added to NOT inversely manipulate the mirroring edge of an immediately adjacent column. CTRL can also be added while mouse dragging a column edge for the same purpose. - - For children in horizontal containers: - - LEFT/RIGHT moves focus to next/previous sibling (no wrap-around) - - CTRL+LEFT/RIGHT reorders the item among siblings - - For children in vertical containers: - - UP/DOWN moves focus to next/previous sibling (no wrap-around) - - CTRL+UP/DOWN reorders the item among siblings - (No keyboard shortcut for splitting columns) - -OTHER THOUGHTS: - - Adding a new row should show dropdown for number of columns (only evenly divisible numbers). - Adding a new element to a container should show dropdown for selectable element types (not a dialog). - -BUTTONS: - - Edit - Delete - Move up - Move down - Move left - Move right - Split - Increase offset - Decrease offset - diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj b/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj index f5dbe0ef2e1..38987ec6966 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj @@ -12,7 +12,7 @@ Properties Orchard.Layouts Orchard.Layouts - v4.5.1 + v4.5.2 false @@ -49,55 +49,75 @@ - - False - ..\..\..\..\lib\newtonsoft.json\Newtonsoft.Json.dll + + ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + True + + + ..\..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + True 3.5 - - - False - ..\..\..\..\lib\aspnetwebapi\System.Web.Http.dll - - - False - ..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll + + + ..\..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + True + + + ..\..\..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll + True + + + ..\..\..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll + True + - - False - ..\..\..\..\lib\aspnetmvc\System.Web.WebPages.dll + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll + True - + - - - + - - - @@ -111,39 +131,29 @@ - - - - - - - - - - - Designer + + + + - - - @@ -157,7 +167,6 @@ - Code @@ -208,35 +217,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -292,9 +272,14 @@ {66fccd76-2761-47e3-8d11-b45d0001ddaa} Orchard.Autoroute + + {98251eae-a41b-47b2-aa91-e28b8482da70} + Orchard.Conditions + {642a49d7-8752-4177-80d6-bfbbcfad3de0} Orchard.Forms + False {73a7688a-5bd3-4f7e-adfa-ce36c5a10e3b} @@ -317,16 +302,26 @@ + + + + + + + + + + @@ -341,17 +336,35 @@ + + + + + + + + + + + + + + + + + + @@ -375,8 +388,11 @@ + + + @@ -410,9 +426,9 @@ - + - + @@ -420,6 +436,7 @@ + @@ -469,7 +486,6 @@ - @@ -518,36 +534,26 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + @@ -559,7 +565,25 @@ - + + + + + + + + + + + + + + + + + + + 10.0 diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Providers/BlueprintElementHarvester.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Providers/BlueprintElementHarvester.cs index 66847c0184c..3ca89574b24 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Providers/BlueprintElementHarvester.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Providers/BlueprintElementHarvester.cs @@ -10,7 +10,7 @@ using Orchard.Layouts.Services; namespace Orchard.Layouts.Providers { - public class BlueprintElementHarvester : Component, ElementHarvester { + public class BlueprintElementHarvester : Component, IElementHarvester { private readonly Work _elementBlueprintService; private readonly Work _elementManager; private bool _isHarvesting; @@ -41,7 +41,7 @@ from blueprint in blueprints EnableEditorDialog = false, IsSystemElement = false, CreatingDisplay = creatingDisplayContext => CreatingDisplay(creatingDisplayContext, blueprint), - Display = displayContext => Displaying(displayContext, baseElement), + Displaying = displayContext => Displaying(displayContext, baseElement), StateBag = new Dictionary { {"Blueprint", true}, {"ElementTypeName", baseElement.Descriptor.TypeName} @@ -62,7 +62,7 @@ private void CreatingDisplay(ElementCreatingDisplayShapeContext context, Element context.Element.Data = bluePrintState; } - private void Displaying(ElementDisplayContext context, Element element) { + private void Displaying(ElementDisplayingContext context, Element element) { var drivers = _elementManager.Value.GetDrivers(element); foreach (var driver in drivers) { diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Providers/ContentFieldElementHarvester.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Providers/ContentFieldElementHarvester.cs index 0ed555c76e7..57ff7465ccf 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Providers/ContentFieldElementHarvester.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Providers/ContentFieldElementHarvester.cs @@ -13,7 +13,7 @@ using Orchard.Layouts.Services; namespace Orchard.Layouts.Providers { - public class ContentFieldElementHarvester : Component, ElementHarvester { + public class ContentFieldElementHarvester : Component, IElementHarvester { private readonly Work _contentDefinitionManager; private readonly Work _transactionManager; private readonly Work _cultureAccessor; @@ -45,7 +45,7 @@ public IEnumerable HarvestElements(HarvestElementsContext con var name = String.Format("{0}.{1}", part.Name, field.Name); var displayName = field.DisplayName; yield return new ElementDescriptor(elementType, name, T(displayName), T(field.DisplayName), contentFieldElement.Category) { - Display = displayContext => Displaying(displayContext), + Displaying = displayContext => Displaying(displayContext), ToolboxIcon = "\uf1b2" }; } @@ -68,7 +68,7 @@ private IEnumerable> Ge return fields.Where(t => blackList.All(x => t.Item2.FieldDefinition.Name != x)); } - private void Displaying(ElementDisplayContext context) { + private void Displaying(ElementDisplayingContext context) { var contentItem = context.Content.ContentItem; var typeName = context.Element.Descriptor.TypeName; var contentField = contentItem.GetContentField(typeName); diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Providers/ContentPartElementHarvester.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Providers/ContentPartElementHarvester.cs index d84e91d5131..2977ab3982e 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Providers/ContentPartElementHarvester.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Providers/ContentPartElementHarvester.cs @@ -13,7 +13,7 @@ using Orchard.Utility.Extensions; namespace Orchard.Layouts.Providers { - public class ContentPartElementHarvester : Component, ElementHarvester { + public class ContentPartElementHarvester : Component, IElementHarvester { private readonly Work _contentDefinitionManager; private readonly Work _elementFactory; private readonly Work _elementManager; @@ -39,7 +39,7 @@ public IEnumerable HarvestElements(HarvestElementsContext con var partDescription = partSettings != null ? partSettings.Description : null; var description = T(!String.IsNullOrWhiteSpace(partDescription) ? partDescription : contentPart.Name); return new ElementDescriptor(elementType, contentPart.Name, T(contentPart.Name.CamelFriendly()), description, contentPartElement.Category) { - Display = displayContext => Displaying(displayContext), + Displaying = displayContext => Displaying(displayContext), ToolboxIcon = "\uf1b2", StateBag = new Dictionary { {"ElementTypeName", contentPart.Name} @@ -60,7 +60,7 @@ private IEnumerable GetContentParts(HarvestElementsContex return parts.Where(p => p.Settings.GetModel().Placeable); } - private void Displaying(ElementDisplayContext context) { + private void Displaying(ElementDisplayingContext context) { var drivers = _elementManager.Value.GetDrivers(context.Element); foreach (var driver in drivers) { diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Providers/PlaceableContentElementHarvester.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Providers/PlaceableContentElementHarvester.cs new file mode 100644 index 00000000000..3a7d37ab8a9 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Providers/PlaceableContentElementHarvester.cs @@ -0,0 +1,174 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Aspects; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.Core.Contents.Settings; +using Orchard.Environment; +using Orchard.Layouts.Elements; +using Orchard.Layouts.Framework.Display; +using Orchard.Layouts.Framework.Drivers; +using Orchard.Layouts.Framework.Elements; +using Orchard.Layouts.Framework.Harvesters; +using Orchard.Layouts.Helpers; +using Orchard.Layouts.Settings; +using Orchard.Layouts.ViewModels; +using ContentItem = Orchard.ContentManagement.ContentItem; + +namespace Orchard.Layouts.Providers { + public class PlaceableContentElementHarvester : Component, IElementHarvester { + private readonly Work _contentManager; + + public PlaceableContentElementHarvester(Work contentManager) { + _contentManager = contentManager; + } + + public IEnumerable HarvestElements(HarvestElementsContext context) { + var contentTypeDefinitions = GetPlaceableContentTypeDefinitions(); + + return contentTypeDefinitions.Select(contentTypeDefinition => { + var settings = contentTypeDefinition.Settings; + var description = settings.ContainsKey("Description") ? settings["Description"] : contentTypeDefinition.DisplayName; + return new ElementDescriptor(typeof (PlaceableContentItem), contentTypeDefinition.Name, T(contentTypeDefinition.DisplayName), T(description), category: "Content Items") { + Displaying = Displaying, + Editor = Editor, + UpdateEditor = UpdateEditor, + ToolboxIcon = "\uf1b2", + EnableEditorDialog = true, + Removing = RemoveContentItem, + Exporting = ExportElement, + Importing = ImportElement, + StateBag = new Dictionary { + { "ContentTypeName", contentTypeDefinition.Name } + } + }; + }); + } + + private void Displaying(ElementDisplayingContext context) { + var contentTypeName = (string)context.Element.Descriptor.StateBag["ContentTypeName"]; + var element = (PlaceableContentItem)context.Element; + var contentItemId = element.ContentItemId; + var versionOptions = context.DisplayType == "Design" ? VersionOptions.Latest : VersionOptions.Published; + var contentItem = contentItemId != null + ? _contentManager.Value.Get(contentItemId.Value, versionOptions) + : _contentManager.Value.New(contentTypeName); + + var contentShape = contentItem != null ? _contentManager.Value.BuildDisplay(contentItem) : default(dynamic); + context.ElementShape.ContentItem = contentItem; + context.ElementShape.ContentShape = contentShape; + } + + private void Editor(ElementEditorContext context) { + UpdateEditor(context); + } + + private void UpdateEditor(ElementEditorContext context) { + var contentTypeName = (string)context.Element.Descriptor.StateBag["ContentTypeName"]; + var element = (PlaceableContentItem) context.Element; + var elementViewModel = new PlaceableContentItemViewModel { + ContentItemId = element.ContentItemId + }; + + if (context.Updater != null) { + context.Updater.TryUpdateModel(elementViewModel, context.Prefix, null, null); + } + + var contentItemId = elementViewModel.ContentItemId; + var contentItem = contentItemId != null + ? _contentManager.Value.Get(contentItemId.Value, VersionOptions.Latest) + : _contentManager.Value.New(contentTypeName); + + dynamic contentEditorShape; + + if (context.Updater != null) { + if (contentItem.Id == 0) { + _contentManager.Value.Create(contentItem, VersionOptions.Draft); + } + else { + var isDraftable = contentItem.TypeDefinition.Settings.GetModel().Draftable; + var versionOptions = isDraftable ? VersionOptions.DraftRequired : VersionOptions.Latest; + contentItem = _contentManager.Value.Get(contentItem.Id, versionOptions); + } + + element.ContentItemId = contentItem.Id; + + // If the placed content item has the CommonPart attached, set its Container property to the Content (if any). + // This helps preventing widget types from appearing as orphans. + var commonPart = contentItem.As(); + if (commonPart != null) + commonPart.Container = context.Content; + + contentItem.IsPlaceableContent(true); + contentEditorShape = _contentManager.Value.UpdateEditor(contentItem, context.Updater); + + _contentManager.Value.Publish(contentItem); + } + else { + contentEditorShape = _contentManager.Value.BuildEditor(contentItem); + } + + var elementEditorShape = context.ShapeFactory.EditorTemplate(TemplateName: "Elements.PlaceableContentItem", Model: elementViewModel, Prefix: context.Prefix); + + elementEditorShape.Metadata.Position = "Properties:0"; + contentEditorShape.Metadata.Position = "Properties:0"; + context.EditorResult.Add(elementEditorShape); + context.EditorResult.Add(contentEditorShape); + } + + private void RemoveContentItem(ElementRemovingContext context) { + var element = (PlaceableContentItem) context.Element; + var contentItemId = element.ContentItemId; + + // Only remove the content item if no other elements are referencing this one. + // This can happen if the user cut an element and then pasted it back. + // That will delete the initial element and create a copy. + var placeableElements = + from e in context.Elements.Flatten() + let p = e as PlaceableContentItem + where p != null && p.ContentItemId == contentItemId + select p; + + if (placeableElements.Any()) + return; + + var contentItem = contentItemId != null ? _contentManager.Value.Get(contentItemId.Value, VersionOptions.Latest) : default(ContentItem); + + if(contentItem != null) + _contentManager.Value.Remove(contentItem); + } + + private void ExportElement(ExportElementContext context) { + var element = (PlaceableContentItem)context.Element; + var contentItemId = element.ContentItemId; + var contentItem = contentItemId != null ? _contentManager.Value.Get(contentItemId.Value, VersionOptions.Latest) : default(ContentItem); + var contentItemIdentity = contentItem != null ? _contentManager.Value.GetItemMetadata(contentItem).Identity.ToString() : default(string); + + if (contentItemIdentity != null) + context.ExportableData["ContentItemId"] = contentItemIdentity; + } + + private void ImportElement(ImportElementContext context) { + var contentItemIdentity = context.ExportableData.Get("ContentItemId"); + + if (String.IsNullOrWhiteSpace(contentItemIdentity)) + return; + + var contentItem = context.Session.GetItemFromSession(contentItemIdentity); + var element = (PlaceableContentItem)context.Element; + + element.ContentItemId = contentItem != null ? contentItem.Id : default(int?); + } + + private IEnumerable GetPlaceableContentTypeDefinitions() { + // Select all types that have either "Placeable" set to true. + var contentTypeDefinitionsQuery = + from contentTypeDefinition in _contentManager.Value.GetContentTypeDefinitions() + where contentTypeDefinition.Settings.GetModel().Placeable + select contentTypeDefinition; + + return contentTypeDefinitionsQuery.ToList(); + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Providers/SnippetElementHarvester.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Providers/SnippetElementHarvester.cs index 0b1d1f4039c..8cab0b828a1 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Providers/SnippetElementHarvester.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Providers/SnippetElementHarvester.cs @@ -8,56 +8,118 @@ using Orchard.Environment.Extensions; using Orchard.Layouts.Elements; using Orchard.Layouts.Framework.Display; +using Orchard.Layouts.Framework.Drivers; using Orchard.Layouts.Framework.Elements; using Orchard.Layouts.Framework.Harvesters; +using Orchard.Layouts.Helpers; +using Orchard.Layouts.Models; using Orchard.Layouts.Services; +using Orchard.Layouts.Shapes; +using Orchard.Layouts.ViewModels; +using Orchard.Localization; using Orchard.Themes.Services; +using Orchard.Tokens; using Orchard.Utility.Extensions; namespace Orchard.Layouts.Providers { [OrchardFeature("Orchard.Layouts.Snippets")] - public class SnippetElementHarvester : Component, ElementHarvester { + public class SnippetElementHarvester : Component, IElementHarvester { private const string SnippetShapeSuffix = "Snippet"; private readonly Work _shapeFactory; private readonly Work _siteThemeService; private readonly Work _shapeTableLocator; private readonly Work _elementFactory; + private readonly Work _shapeDisplay; + private readonly Work _currentThemeShapeBindingResolver; + private readonly Work _tokenizer; + private readonly IWorkContextAccessor _wca; public SnippetElementHarvester( IWorkContextAccessor workContextAccessor, Work shapeFactory, Work siteThemeService, - Work shapeTableLocator, - Work elementFactory) { + Work shapeTableLocator, + Work elementFactory, + Work shapeDisplay, + Work tokenizer, + Work currentThemeShapeBindingResolver) { _shapeFactory = shapeFactory; _siteThemeService = siteThemeService; _shapeTableLocator = shapeTableLocator; _elementFactory = elementFactory; - workContextAccessor.GetContext(); + _shapeDisplay = shapeDisplay; + _tokenizer = tokenizer; + _currentThemeShapeBindingResolver = currentThemeShapeBindingResolver; + _wca = workContextAccessor; } public IEnumerable HarvestElements(HarvestElementsContext context) { var currentThemeName = _siteThemeService.Value.GetCurrentThemeName(); var shapeTable = _shapeTableLocator.Value.Lookup(currentThemeName); var shapeDescriptors = shapeTable.Bindings.Where(x => !String.Equals(x.Key, "Elements_Snippet", StringComparison.OrdinalIgnoreCase) && x.Key.EndsWith(SnippetShapeSuffix, StringComparison.OrdinalIgnoreCase)).ToDictionary(x => x.Key, x => x.Value.ShapeDescriptor); - var elementType = typeof (Snippet); - var snippetElement = _elementFactory.Value.Activate(elementType); + var elementType = typeof(Snippet); + var snippetElement = (Snippet)_elementFactory.Value.Activate(elementType); foreach (var shapeDescriptor in shapeDescriptors) { var shapeType = shapeDescriptor.Value.ShapeType; var elementName = GetDisplayName(shapeDescriptor.Value.BindingSource); var closureDescriptor = shapeDescriptor; yield return new ElementDescriptor(elementType, shapeType, T(elementName), T("An element that renders the {0} shape.", shapeType), snippetElement.Category) { - Display = displayContext => Displaying(displayContext, closureDescriptor.Value), - ToolboxIcon = "\uf10c" + Displaying = displayContext => Displaying(displayContext, closureDescriptor.Value), + ToolboxIcon = "\uf10c", + EnableEditorDialog = HasSnippetFields(shapeDescriptor.Value), + Editor = ctx => Editor(DescribeSnippet(shapeType, snippetElement), ctx), + UpdateEditor = ctx => UpdateEditor(DescribeSnippet(shapeType, snippetElement), ctx) }; } } - private void Displaying(ElementDisplayContext context, ShapeDescriptor shapeDescriptor) { + private void Editor(SnippetDescriptor descriptor, ElementEditorContext context) { + UpdateEditor(descriptor, context); + } + + private void UpdateEditor(SnippetDescriptor descriptor, ElementEditorContext context) { + var viewModel = new SnippetViewModel { + Descriptor = descriptor + }; + + if (context.Updater != null) { + foreach (var fieldDescriptor in descriptor.Fields) { + var name = fieldDescriptor.Name; + var result = context.ValueProvider.GetValue(name); + + if (result == null) + continue; + + context.Element.Data[name] = result.AttemptedValue; + } + } + + viewModel.FieldEditors = descriptor.Fields.Select(x => { + var fieldEditorTemplateName = String.Format("Elements.Snippet.Field.{0}", x.Type ?? "Text"); + var fieldDescriptorViewModel = new SnippetFieldViewModel { + Descriptor = x, + Value = context.Element.Data.Get(x.Name) + }; + var fieldEditor = context.ShapeFactory.EditorTemplate(TemplateName: fieldEditorTemplateName, Model: fieldDescriptorViewModel, Prefix: context.Prefix); + + return fieldEditor; + }).ToList(); + + var snippetEditorShape = context.ShapeFactory.EditorTemplate(TemplateName: "Elements.Snippet", Model: viewModel, Prefix: context.Prefix); + snippetEditorShape.Metadata.Position = "Fields:0"; + + context.EditorResult.Add(snippetEditorShape); + } + + private void Displaying(ElementDisplayingContext context, ShapeDescriptor shapeDescriptor) { var shapeType = shapeDescriptor.ShapeType; - var shape = _shapeFactory.Value.Create(shapeType); + var shape = (dynamic)_shapeFactory.Value.Create(shapeType); + + shape.Element = context.Element; + + ElementShapes.AddTokenizers(shape, _tokenizer.Value); context.ElementShape.Snippet = shape; } @@ -66,5 +128,43 @@ private string GetDisplayName(string bindingSource) { var lastIndex = fileName.IndexOf(SnippetShapeSuffix, StringComparison.OrdinalIgnoreCase); return fileName.Substring(0, lastIndex).CamelFriendly(); } + + private SnippetDescriptor DescribeSnippet(string shapeType, Snippet element) { + var shape = (dynamic)_shapeFactory.Value.Create(shapeType); + shape.Element = element; + return DescribeSnippet(shape); + } + + private SnippetDescriptor DescribeSnippet(dynamic shape) { + // Execute the shape and intercept calls to the Html.SnippetField method. + var descriptor = new SnippetDescriptor(); + shape.DescriptorRegistrationCallback = (Action)(fieldDescriptor => { + var existingDescriptor = descriptor.Fields.SingleOrDefault(x => x.Name == fieldDescriptor.Name); // Not using Dictionary, as that will break rendering the view for some obscure reason. + + if (existingDescriptor == null) + descriptor.Fields.Add(fieldDescriptor); + + if (fieldDescriptor.DisplayName == null) + fieldDescriptor.DisplayName = new LocalizedString(fieldDescriptor.Name); + }); + + using (_currentThemeShapeBindingResolver.Value.Enable()) { + _shapeDisplay.Value.Display(shape); + } + + shape.SnippetDescriptor = descriptor; + return descriptor; + } + + private bool HasSnippetFields(ShapeDescriptor shapeDescriptor) { + var bindingSource = shapeDescriptor.BindingSource; + var localFileName = _wca.GetContext().HttpContext.Server.MapPath(bindingSource); + + if (!File.Exists(localFileName)) + return false; + + var markup = File.ReadAllText(localFileName); + return markup.Contains("@Html.SnippetField"); + } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Providers/TypedElementHarvester.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Providers/TypedElementHarvester.cs index cc172644c27..6da7188b3ff 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Providers/TypedElementHarvester.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Providers/TypedElementHarvester.cs @@ -6,7 +6,7 @@ using Orchard.Layouts.Services; namespace Orchard.Layouts.Providers { - public class TypedElementHarvester : ElementHarvester { + public class TypedElementHarvester : IElementHarvester { private readonly Work _elementManager; private readonly Work _factory; diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Recipes/Builders/CustomElementsStep.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Recipes/Builders/CustomElementsStep.cs new file mode 100644 index 00000000000..8202934927c --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Recipes/Builders/CustomElementsStep.cs @@ -0,0 +1,71 @@ +using System.Linq; +using System.Xml.Linq; +using Orchard.Data; +using Orchard.Layouts.Models; +using Orchard.Localization; +using Orchard.Recipes.Services; +using Orchard.Layouts.Services; +using Orchard.Layouts.Helpers; +using Orchard.Layouts.Framework.Drivers; + +namespace Orchard.Layouts.Recipes.Builders { + + public class CustomElementsStep : RecipeBuilderStep { + private readonly IRepository _repository; + private readonly IElementManager _elementManager; + + public CustomElementsStep(IRepository repository, IElementManager elementManager) { + _repository = repository; + _elementManager = elementManager; + } + + public override string Name { + get { return "CustomElements"; } + } + + public override LocalizedString DisplayName { + get { return T("Custom Elements"); } + } + + public override LocalizedString Description { + get { return T("Exports custom defined elements."); } + } + + public override void Build(BuildContext context) + { + var blueprints = _repository.Table.OrderBy(x => x.ElementTypeName).ToList(); + + if (!blueprints.Any()) + return; + + var blueprintEntries = blueprints.Select(blueprint => { + + var describeContext = DescribeElementsContext.Empty; + var descriptor = _elementManager.GetElementDescriptorByTypeName(describeContext, blueprint.BaseElementTypeName); + var baseElement = _elementManager.ActivateElement(descriptor); + baseElement.Data = ElementDataHelper.Deserialize(blueprint.BaseElementState); + return new { Blueprint = blueprint, BaseElement = baseElement }; + + }).ToList(); + + var baseElements = blueprintEntries.Select(e => e.BaseElement).ToList(); + var exportLayoutContext = new ExportLayoutContext(); + _elementManager.Exporting(baseElements, exportLayoutContext); + _elementManager.Exported(baseElements, exportLayoutContext); + + var root = new XElement("CustomElements"); + context.RecipeDocument.Element("Orchard").Add(root); + + foreach (var blueprintEntry in blueprintEntries) { + root.Add(new XElement("Element", + new XAttribute("ElementTypeName", blueprintEntry.Blueprint.ElementTypeName), + new XAttribute("BaseElementTypeName", blueprintEntry.Blueprint.BaseElementTypeName), + new XAttribute("ElementDisplayName", blueprintEntry.Blueprint.ElementDisplayName), + new XAttribute("ElementDescription", blueprintEntry.Blueprint.ElementDescription ?? ""), + new XAttribute("ElementCategory", blueprintEntry.Blueprint.ElementCategory ?? ""), + new XAttribute("BaseExportableData", blueprintEntry.BaseElement.ExportableData.Serialize()), + new XElement("BaseElementState", new XCData(blueprintEntry.Blueprint.BaseElementState)))); + } + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Recipes/Executors/CustomElementsStep.cs b/src/Orchard.Web/Modules/Orchard.Layouts/Recipes/Executors/CustomElementsStep.cs new file mode 100644 index 00000000000..753e4e15fe3 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Recipes/Executors/CustomElementsStep.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Orchard.Data; +using Orchard.Layouts.Models; +using Orchard.Logging; +using Orchard.Recipes.Models; +using Orchard.Recipes.Services; +using Orchard.Layouts.Services; +using Orchard.Layouts.Helpers; +using Orchard.ContentManagement; +using Orchard.Layouts.Framework.Drivers; + +namespace Orchard.Layouts.Recipes.Executors { + public class CustomElementsStep : RecipeExecutionStep { + private readonly IRepository _repository; + private readonly IElementManager _elementManager; + private readonly IOrchardServices _orchardServices; + + public CustomElementsStep( + IRepository repository, + IElementManager elementManager, + IOrchardServices orchardServices, + RecipeExecutionLogger logger) : base(logger) { + + _repository = repository; + _elementManager = elementManager; + _orchardServices = orchardServices; + } + + public override string Name { + get { return "CustomElements"; } + } + + public override IEnumerable Names { + get { return new[] { Name, "LayoutElements" }; } + } + + public override void Execute(RecipeExecutionContext context) + { + + var blueprintEntries = context.RecipeStep.Step.Elements().Select(xmlBlueprint => { + + var typeName = xmlBlueprint.Attribute("ElementTypeName").Value; + Logger.Information("Importing custom element '{0}'.", typeName); + + try { + var blueprint = GetOrCreateElement(typeName); + blueprint.BaseElementTypeName = xmlBlueprint.Attribute("BaseElementTypeName").Value; + blueprint.ElementDisplayName = xmlBlueprint.Attribute("ElementDisplayName").Value; + blueprint.ElementDescription = xmlBlueprint.Attribute("ElementDescription").Value; + blueprint.ElementCategory = xmlBlueprint.Attribute("ElementCategory").Value; + blueprint.BaseElementState = xmlBlueprint.Element("BaseElementState").Value; + + var describeContext = DescribeElementsContext.Empty; + var descriptor = _elementManager.GetElementDescriptorByTypeName(describeContext, blueprint.BaseElementTypeName); + var baseElement = _elementManager.ActivateElement(descriptor); + baseElement.Data = ElementDataHelper.Deserialize(blueprint.BaseElementState); + baseElement.ExportableData = ElementDataHelper.Deserialize(xmlBlueprint.Attribute("BaseExportableData").Value); + + return new { Blueprint = blueprint, BaseElement = baseElement }; + } + catch (Exception ex) { + Logger.Error(ex, "Error while importing custom element '{0}'.", typeName); + throw; + } + + }).ToList(); + + + var baseElements = blueprintEntries.Select(e => e.BaseElement).ToList(); + var importContentSession = new ImportContentSession(_orchardServices.ContentManager); + var importLayoutContext = new ImportLayoutContext { + Session = new ImportContentSessionWrapper(importContentSession) + }; + _elementManager.Importing(baseElements, importLayoutContext); + _elementManager.Imported(baseElements, importLayoutContext); + _elementManager.ImportCompleted(baseElements, importLayoutContext); + + foreach (var blueprintEntry in blueprintEntries) + blueprintEntry.Blueprint.BaseElementState = blueprintEntry.BaseElement.Data.Serialize(); + + } + + private ElementBlueprint GetOrCreateElement(string typeName) { + var element = _repository.Get(x => x.ElementTypeName == typeName); + + if (element == null) { + element = new ElementBlueprint { + ElementTypeName = typeName + }; + _repository.Create(element); + } + + return element; + } + } +} diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/ResourceManifest.cs b/src/Orchard.Web/Modules/Orchard.Layouts/ResourceManifest.cs index 3b1350a13a4..1eed61fd542 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/ResourceManifest.cs +++ b/src/Orchard.Web/Modules/Orchard.Layouts/ResourceManifest.cs @@ -4,7 +4,7 @@ namespace Orchard.Layouts { public class ResourceManifest : IResourceManifestProvider { public void BuildManifests(ResourceManifestBuilder builder) { var manifest = builder.Add(); - manifest.DefineScript("Layouts.Lib").SetUrl("Lib.min.js", "Lib.js").SetDependencies("jQuery"); + manifest.DefineScript("Layouts.Lib").SetDependencies("jQuery", "AngularJs_Full", "Underscore"); manifest.DefineScript("Layouts.Models").SetUrl("Models.min.js", "Models.js").SetDependencies("jQuery", "Layouts.Lib"); manifest.DefineScript("Layouts.LayoutEditor").SetUrl("LayoutEditor.min.js", "LayoutEditor.js").SetDependencies("jQuery", "Layouts.Lib", "Layouts.Models"); } diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/DemoConfig.js b/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/DemoConfig.js deleted file mode 100644 index 75b2f50e6b1..00000000000 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/DemoConfig.js +++ /dev/null @@ -1,50 +0,0 @@ -var demoConfig = { - "createContentUrl": "/Modules/Orchard.Layouts/Controller/Create/{contentTypeId}", - "editContentUrl": "/Modules/Orchard.Layouts/Controller/Edit/{contentTypeId}", - "categories": [ - { - "name": "Content", - "contentTypes": [ - { "label": "Content Item", "id": "Orchard.Layouts.Elements.ContentItem" }, - { "label": "Html", "id": "Orchard.Layouts.Elements.Html" }, - { "label": "Paragraph", "id": "Orchard.Layouts.Elements.Paragraph" }, - { "label": "Text", "id": "Orchard.Layouts.Elements.Text" } - ] - }, - { - "name": "Media", - "contentTypes": [ - { "label": "Image", "id": "Orchard.Layouts.Elements.Image" }, - { "label": "Media Item", "id": "Orchard.Layouts.Elements.MediaItem" }, - { "label": "Vector Image", "id": "Orchard.Layouts.Elements.VectorImage" } - ] - }, - { - "name": "Parts", - "contentTypes": [ - { "label": "CommonPart", "id": "CommonPart" }, - { "label": "TitlePart", "id": "TitlePart" } - ] - }, - { - "name": "Forms", - "contentTypes": [ - { "label": "Button", "id": "Orchard.DynamicForms.Elements.Button" }, - { "label": "Check Box", "id": "Orchard.DynamicForms.Elements.CheckBox" }, - { "label": "Email Field", "id": "Orchard.DynamicForms.Elements.EmailField" }, - { "label": "Enumeration", "id": "Orchard.DynamicForms.Elements.Enumeration" }, - { "label": "Form", "id": "Orchard.DynamicForms.Elements.Form" }, - { "label": "Hidden Field", "id": "Orchard.DynamicForms.Elements.HiddenField" }, - { "label": "Ip Address Field", "id": "Orchard.DynamicForms.Elements.IpAddressField" }, - { "label": "Label", "id": "Orchard.DynamicForms.Elements.Label" }, - { "label": "Password Field", "id": "Orchard.DynamicForms.Elements.PasswordField" }, - { "label": "Radio Button", "id": "Orchard.DynamicForms.Elements.RadioButton" }, - { "label": "Text Area", "id": "Orchard.DynamicForms.Elements.TextArea" }, - { "label": "Text Field", "id": "Orchard.DynamicForms.Elements.TextField" }, - { "label": "User Name Field", "id": "Orchard.DynamicForms.Elements.UserNameField" }, - { "label": "Validation Message", "id": "Orchard.DynamicForms.Elements.ValidationMessage" }, - { "label": "Validation Summary", "id": "Orchard.DynamicForms.Elements.ValidationSummary" } - ] - } - ] -}; diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/DemoData.js b/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/DemoData.js deleted file mode 100644 index 27f15d98e53..00000000000 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/DemoData.js +++ /dev/null @@ -1,261 +0,0 @@ -var demoData = { - "type": "Canvas", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "children": [ - { - "type": "Grid", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "children": [ - { - "type": "Row", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "children": [ - { - "type": "Column", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "width": 4, - "offset": 0, - "children": [ - { - "type": "Content", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "contentType": "Image", - "html": "" - } - ] - }, - { - "type": "Column", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "width": 8, - "offset": 0, - "children": [ - { - "type": "Content", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "contentType": "HTML", - "html": "

Who are we?

" - }, - { - "type": "Content", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "contentType": "Vector Image", - "html": "" - }, - { - "type": "Content", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "contentType": "HTML", - "html": "

IDeliverable is a company of like-minded individuals with a true passion for .NET based software development and cloud computing.

" - } - ] - } - ] - }, - { - "type": "Row", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "children": [ - { - "type": "Column", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "width": 12, - "offset": 0, - "children": [ - { - "type": "Content", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "contentType": "HTML", - "html": "

What do we do?

We provide software development, consulting and training within our three areas of focus.

" - } - ] - } - ] - }, - { - "type": "Row", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "children": [ - { - "type": "Column", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "width": 4, - "offset": 0, - "children": [ - { - "type": "Content", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "contentType": "HTML", - "html": "

.NET software development

Microsoft .NET is at the core of everything we do. We have worked with .NET since its inception back in 2000 and are exceptionally proficient in all aspects of the platform, including its languages, frameworks, services and tools. Whether it’s the latest ASP.NET technologies with HTML5, CSS3 and modern JavaScript frameworks, Windows Phone and Windows Store apps with XAML, or more enterprise oriented Windows Forms or WPF rich client apps with WCF based service back ends, we’ve done it all for years and feel right at home.

" - } - ] - }, - { - "type": "Column", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "width": 4, - "offset": 0, - "children": [ - { - "type": "Content", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "contentType": "HTML", - "html": "

Microsoft Azure

We are true believers in cloud computing, and as far as hosting goes, we believe there’s no better home for .NET based applications than Microsoft Azure. And so we have worked hard in the past few years to become experts in every nook and cranny of this platform. Our expertise includes architecting and designing applications for Microsoft Azure, adapting and migrating existing applications to Microsoft Azure, automating Microsoft Azure deployment and building hybrid solutions involving both on-premises components and Microsoft Azure.

" - } - ] - }, - { - "type": "Column", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "width": 4, - "offset": 0, - "children": [ - { - "type": "Content", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "contentType": "HTML", - "html": "

Orchard CMS

" - }, - { - "type": "Grid", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "children": [ - { - "type": "Row", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "children": [ - { - "type": "Column", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "width": 4, - "offset": 0, - "children": [ - { - "type": "Content", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "contentType": "HTML", - "html": "

When it comes to web site development, the Orchard CMS is our framework of choice.

" - } - ] - }, - { - "type": "Column", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "width": 4, - "offset": 0, - "children": [ - { - "type": "Content", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "contentType": "HTML", - "html": "

We have worked with Orchard for almost three years and have built a wide array of web sites, large and small, using it. We have two developers who participate actively in the development of Orchard and who have commit rights in the official Orchard source code repository.

" - } - ] - }, - { - "type": "Column", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "width": 4, - "offset": 0, - "children": [ - { - "type": "Content", - "data": null, - "htmlId": null, - "htmlClass": null, - "htmlStyle": null, - "contentType": "HTML", - "html": "

One of them is even on the Orchard steering committee, so it’s fair to say we have our ears to the ground when it comes to what’s happening in the Orchard community.

" - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] -} diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/Elements/Image.js b/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/Elements/Image.js new file mode 100644 index 00000000000..aded1a84102 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/Elements/Image.js @@ -0,0 +1,11 @@ +(function ($) { + $(function() { + $(".media-library-picker-field").on("opened", function(e) { + window.parent.currentDialog.toggleCommands(false); + }); + + $(".media-library-picker-field").on("closed", function(e) { + window.parent.currentDialog.toggleCommands(true); + }); + }); +})(jQuery); \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutDesignerHost.js b/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutDesignerHost.js index ab347d938ef..4e7fa00e4f7 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutDesignerHost.js +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutDesignerHost.js @@ -4,7 +4,6 @@ this.element = element; this.element.data("layout-designer-host", this); this.editor = layoutEditor; - this.isFormSubmitting = false; this.settings = { antiForgeryToken: self.element.data("anti-forgery-token"), editorDialogTitleFormat: self.element.data("editor-dialog-title-format"), @@ -12,12 +11,7 @@ confirmDeletePrompt: self.element.data("confirm-delete-prompt"), displayType: self.element.data("display-type"), endpoints: { - render: self.element.data("render-url"), edit: self.element.data("edit-url"), - add: self.element.data("add-url"), - addDirect: self.element.data("add-direct-url"), - settings: self.element.data("settings-url"), - browse: self.element.data("element-browser-url"), applyTemplate: self.element.data("apply-template-url") }, domOperations: { @@ -67,6 +61,11 @@ return JSON.stringify(layoutData, null, "\t"); }; + var serializeRecycleBin = function () { + var recycleBinData = self.editor.recycleBin.toObject(); + return JSON.stringify(recycleBinData, null, "\t"); + }; + var applyTemplate = function (templateId) { var layoutData = serializeCanvas(); @@ -84,21 +83,23 @@ }); }; - var monitorForm = function() { - var layoutDesigner = self.element; - var form = layoutDesigner.closest("form"); - + var monitorForm = function () { + var form = $(".zone-content form:first"); + form.on("submit", function (e) { - self.isFormSubmitting = true; + form.attr("isSubmitting", true); serializeLayout(); }); }; var serializeLayout = function () { var layoutDataField = self.element.find(".layout-data-field"); + var recycleBinDataField = self.element.find(".recycle-bin-data-field"); var layoutDataDataJson = serializeCanvas(); + var recycleBinDataJson = serializeRecycleBin(); layoutDataField.val(layoutDataDataJson); + recycleBinDataField.val(recycleBinDataJson); }; this.element.on("change", ".template-picker select", function (e) { @@ -108,7 +109,10 @@ }); $(window).on("beforeunload", function () { - if (!self.isFormSubmitting && self.editor.isDirty()) + + var form = $(".zone-content form:first"); + var isFormSubmitting = form.attr("isSubmitting"); + if (!isFormSubmitting && self.editor.isDirty()) return "You have unsaved changes."; return undefined; diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutEditor.js b/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutEditor.js index f3bfe6dc2ea..0e30fc120f3 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutEditor.js +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutEditor.js @@ -1,3 +1,8 @@ +/* +** NOTE: This file is generated by Gulp and should not be edited directly! +** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. +*/ + angular.module("LayoutEditor", ["ngSanitize", "ngResource", "ui.sortable"]); var LayoutEditor; (function(LayoutEditor) { @@ -197,6 +202,23 @@ angular $scope.delete = function (element) { element.delete(); } + + if ($scope.element.hasEditor) { + $scope.edit = function () { + $scope.$root.editElement($scope.element).then(function (args) { + $scope.$apply(function () { + if (args.cancel) + return; + + $scope.element.data = args.element.data; + $scope.element.applyElementEditorModel(args.elementEditorModel); + + if (!!$scope.element.setHtml) + $scope.element.setHtml(args.element.html); + }); + }); + }; + } }, configureForContainer: function ($scope, $element) { @@ -617,18 +639,7 @@ angular controller: ["$scope", "$element", function ($scope, $element) { scopeConfigurator.configureForElement($scope, $element); - $scope.edit = function () { - $scope.$root.editElement($scope.element).then(function (args) { - $scope.$apply(function () { - if (args.cancel) - return; - - $scope.element.data = args.element.data; - $scope.element.setHtml(args.element.html); - }); - }); - }; - + // Overwrite the setHtml function so that we can use the $sce service to trust the html (and not have the html binding strip certain tags). $scope.element.setHtml = function (html) { $scope.element.html = html; @@ -643,47 +654,6 @@ angular }; } ]); -angular - .module("LayoutEditor") - .directive("orcLayoutHtml", ["$sce", "scopeConfigurator", "environment", - function ($sce, scopeConfigurator, environment) { - return { - restrict: "E", - scope: { element: "=" }, - controller: ["$scope", "$element", - function ($scope, $element) { - scopeConfigurator.configureForElement($scope, $element); - $scope.edit = function () { - $scope.$root.editElement($scope.element).then(function (args) { - $scope.$apply(function () { - if (args.cancel) - return; - - $scope.element.data = args.element.data; - $scope.element.setHtml(args.element.html); - }); - }); - }; - $scope.updateContent = function (e) { - $scope.element.setHtml(e.target.innerHTML); - }; - - // Overwrite the setHtml function so that we can use the $sce service to trust the html (and not have the html binding strip certain tags). - $scope.element.setHtml = function (html) { - $scope.element.html = html; - $scope.element.htmlUnsafe = $sce.trustAsHtml(html); - }; - - $scope.element.setHtml($scope.element.html); - } - ], - templateUrl: environment.templateUrl("Html"), - replace: true, - link: function (scope, element) { - } - }; - } - ]); angular .module("LayoutEditor") .directive("orcLayoutGrid", ["$compile", "scopeConfigurator", "environment", @@ -838,6 +808,15 @@ angular }) ]; + $scope.canvasElements = [ + LayoutEditor.Canvas.from({ + toolboxIcon: "\uf044", + toolboxLabel: "Canvas", + toolboxDescription: "Empty canvas.", + children: [] + }) + ]; + $scope.contentElementCategories = _($scope.element.config.categories).map(function (category) { return { name: category.name, @@ -890,6 +869,10 @@ angular parentClasses = [".layout-canvas", ".layout-column", ".layout-common-holder"]; placeholderClasses = "layout-element layout-content ui-sortable-placeholder"; break; + case "Canvas": + parentClasses = [".layout-canvas", ".layout-column", ".layout-common-holder"]; + placeholderClasses = "layout-element layout-container layout-grid ui-sortable-placeholder"; + break; } return { @@ -981,4 +964,4 @@ angular }; } ]); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIk1vZHVsZS5qcyIsIkNsaXBib2FyZC5qcyIsIlNjb3BlQ29uZmlndXJhdG9yLmpzIiwiRWRpdG9yLmpzIiwiQ2FudmFzLmpzIiwiQ2hpbGQuanMiLCJDb2x1bW4uanMiLCJDb250ZW50LmpzIiwiSHRtbC5qcyIsIkdyaWQuanMiLCJSb3cuanMiLCJQb3B1cC5qcyIsIlRvb2xib3guanMiLCJUb29sYm94R3JvdXAuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUNBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQzdDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQ2pVQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUN6SUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUNsQkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FDZEE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQ25FQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUNuQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQ3hDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQ2xCQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FDbkJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FDdkNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUNqTUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6IkxheW91dEVkaXRvci5qcyIsInNvdXJjZXNDb250ZW50IjpbImFuZ3VsYXIubW9kdWxlKFwiTGF5b3V0RWRpdG9yXCIsIFtcIm5nU2FuaXRpemVcIiwgXCJuZ1Jlc291cmNlXCIsIFwidWkuc29ydGFibGVcIl0pOyIsInZhciBMYXlvdXRFZGl0b3I7XHJcbihmdW5jdGlvbihMYXlvdXRFZGl0b3IpIHtcclxuXHJcbiAgICB2YXIgQ2xpcGJvYXJkID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIHZhciBzZWxmID0gdGhpcztcclxuICAgICAgICB0aGlzLl9jbGlwYm9hcmREYXRhID0ge307XHJcbiAgICAgICAgdGhpcy5faXNEaXNhYmxlZCA9IGZhbHNlO1xyXG4gICAgICAgIHRoaXMuX3dhc0ludm9rZWQgPSBmYWxzZTtcclxuXHJcbiAgICAgICAgdGhpcy5zZXREYXRhID0gZnVuY3Rpb24oY29udGVudFR5cGUsIGRhdGEpIHtcclxuICAgICAgICAgICAgc2VsZi5fY2xpcGJvYXJkRGF0YVtjb250ZW50VHlwZV0gPSBkYXRhO1xyXG4gICAgICAgICAgICBzZWxmLl93YXNJbnZva2VkID0gdHJ1ZTtcclxuICAgICAgICB9O1xyXG4gICAgICAgIHRoaXMuZ2V0RGF0YSA9IGZ1bmN0aW9uIChjb250ZW50VHlwZSkge1xyXG4gICAgICAgICAgICByZXR1cm4gc2VsZi5fY2xpcGJvYXJkRGF0YVtjb250ZW50VHlwZV07XHJcbiAgICAgICAgICAgIHNlbGYuX3dhc0ludm9rZWQgPSB0cnVlO1xyXG4gICAgICAgIH07XHJcbiAgICAgICAgdGhpcy5kaXNhYmxlID0gZnVuY3Rpb24oKSB7XHJcbiAgICAgICAgICAgIHNlbGYuX2lzRGlzYWJsZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICBzZWxmLl93YXNJbnZva2VkID0gZmFsc2U7XHJcbiAgICAgICAgICAgIHNlbGYuX2NsaXBib2FyZERhdGEgPSB7fTtcclxuICAgICAgICB9O1xyXG4gICAgICAgIHRoaXMuaXNEaXNhYmxlZCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHNlbGYuX2lzRGlzYWJsZWQ7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMud2FzSW52b2tlZCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHNlbGYuX3dhc0ludm9rZWQ7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIExheW91dEVkaXRvci5DbGlwYm9hcmQgPSBuZXcgQ2xpcGJvYXJkKCk7XHJcblxyXG4gICAgYW5ndWxhclxyXG4gICAgICAgIC5tb2R1bGUoXCJMYXlvdXRFZGl0b3JcIilcclxuICAgICAgICAuZmFjdG9yeShcImNsaXBib2FyZFwiLCBbXHJcbiAgICAgICAgICAgIGZ1bmN0aW9uKCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgICAgICBzZXREYXRhOiBMYXlvdXRFZGl0b3IuQ2xpcGJvYXJkLnNldERhdGEsXHJcbiAgICAgICAgICAgICAgICAgICAgZ2V0RGF0YTogTGF5b3V0RWRpdG9yLkNsaXBib2FyZC5nZXREYXRhLFxyXG4gICAgICAgICAgICAgICAgICAgIGRpc2FibGU6IExheW91dEVkaXRvci5DbGlwYm9hcmQuZGlzYWJsZSxcclxuICAgICAgICAgICAgICAgICAgICBpc0Rpc2FibGVkOiBMYXlvdXRFZGl0b3IuQ2xpcGJvYXJkLmlzRGlzYWJsZWQsXHJcbiAgICAgICAgICAgICAgICAgICAgd2FzSW52b2tlZDogTGF5b3V0RWRpdG9yLkNsaXBib2FyZC53YXNJbnZva2VkXHJcbiAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgXSk7XHJcbn0pKExheW91dEVkaXRvciB8fCAoTGF5b3V0RWRpdG9yID0ge30pKTsiLCJhbmd1bGFyXHJcbiAgICAubW9kdWxlKFwiTGF5b3V0RWRpdG9yXCIpXHJcbiAgICAuZmFjdG9yeShcInNjb3BlQ29uZmlndXJhdG9yXCIsIFtcIiR0aW1lb3V0XCIsIFwiY2xpcGJvYXJkXCIsXHJcbiAgICAgICAgZnVuY3Rpb24gKCR0aW1lb3V0LCBjbGlwYm9hcmQpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuXHJcbiAgICAgICAgICAgICAgICBjb25maWd1cmVGb3JFbGVtZW50OiBmdW5jdGlvbiAoJHNjb3BlLCAkZWxlbWVudCkge1xyXG4gICAgICAgICAgICAgICAgXHJcbiAgICAgICAgICAgICAgICAgICAgJGVsZW1lbnQuZmluZChcIi5sYXlvdXQtcGFuZWxcIikuY2xpY2soZnVuY3Rpb24gKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgJGVsZW1lbnQucGFyZW50KCkua2V5ZG93bihmdW5jdGlvbiAoZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaGFuZGxlZCA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzZXRGb2N1cyA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZWxlbWVudCA9ICRzY29wZS5lbGVtZW50O1xyXG4gICAgICAgICAgICAgICAgICAgIFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbWVudC5lZGl0b3IuaXNEcmFnZ2luZylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIG5hdGl2ZSBjbGlwYm9hcmQgc3VwcG9ydCBleGlzdHMsIHRoZSBwc2V1ZG8tY2xpcGJvYXJkIHdpbGwgaGF2ZSBiZWVuIGRpc2FibGVkLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNsaXBib2FyZC5pc0Rpc2FibGVkKCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmb2N1c2VkRWxlbWVudCA9IGVsZW1lbnQuZWRpdG9yLmZvY3VzZWRFbGVtZW50O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEhZm9jdXNlZEVsZW1lbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBQc2V1ZG8gY2xpcGJvYXJkIGhhbmRsaW5nIGZvciBicm93c2VycyBub3QgYWxsb3dpbmcgcmVhbCBjbGlwYm9hcmQgb3BlcmF0aW9ucy5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5jdHJsS2V5KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoZS53aGljaCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY3OiAvLyBDXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2N1c2VkRWxlbWVudC5jb3B5KGNsaXBib2FyZCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA4ODogLy8gWFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9jdXNlZEVsZW1lbnQuY3V0KGNsaXBib2FyZCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA4NjogLy8gVlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9jdXNlZEVsZW1lbnQucGFzdGUoY2xpcGJvYXJkKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWUuY3RybEtleSAmJiAhZS5zaGlmdEtleSAmJiAhZS5hbHRLZXkgJiYgZS53aGljaCA9PSA0NikgeyAvLyBEZWxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5kZWxldGUoZWxlbWVudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghZS5jdHJsS2V5ICYmICFlLnNoaWZ0S2V5ICYmICFlLmFsdEtleSAmJiAoZS53aGljaCA9PSAzMiB8fCBlLndoaWNoID09IDI3KSkgeyAvLyBTcGFjZSBvciBFc2NcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlbGVtZW50LmZpbmQoXCIubGF5b3V0LXBhbmVsLWFjdGlvbi1wcm9wZXJ0aWVzXCIpLmZpcnN0KCkuY2xpY2soKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbWVudC50eXBlID09IFwiQ29udGVudFwiKSB7IC8vIFRoaXMgaXMgYSBjb250ZW50IGVsZW1lbnQuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWUuY3RybEtleSAmJiAhZS5zaGlmdEtleSAmJiAhZS5hbHRLZXkgJiYgZS53aGljaCA9PSAxMykgeyAvLyBFbnRlclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRlbGVtZW50LmZpbmQoXCIubGF5b3V0LXBhbmVsLWFjdGlvbi1lZGl0XCIpLmZpcnN0KCkuY2xpY2soKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEhZWxlbWVudC5jaGlsZHJlbikgeyAvLyBUaGlzIGlzIGEgY29udGFpbmVyLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmN0cmxLZXkgJiYgIWUuc2hpZnRLZXkgJiYgZS5hbHRLZXkgJiYgZS53aGljaCA9PSA0MCkgeyAvLyBBbHQrRG93blxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtZW50LmNoaWxkcmVuLmxlbmd0aCA+IDApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuY2hpbGRyZW5bMF0uc2V0SXNGb2N1c2VkKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1lbnQudHlwZSA9PSBcIkNvbHVtblwiKSB7IC8vIFRoaXMgaXMgYSBjb2x1bW4uXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbm5lY3RBZGphY2VudCA9ICFlLmN0cmxLZXk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUud2hpY2ggPT0gMzcpIHsgLy8gTGVmdFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5hbHRLZXkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmV4cGFuZExlZnQoY29ubmVjdEFkamFjZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuc2hpZnRLZXkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmNvbnRyYWN0UmlnaHQoY29ubmVjdEFkamFjZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLndoaWNoID09IDM5KSB7IC8vIFJpZ2h0XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmFsdEtleSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuY29udHJhY3RMZWZ0KGNvbm5lY3RBZGphY2VudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLnNoaWZ0S2V5KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5leHBhbmRSaWdodChjb25uZWN0QWRqYWNlbnQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghIWVsZW1lbnQucGFyZW50KSB7IC8vIFRoaXMgaXMgYSBjaGlsZC5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLmFsdEtleSAmJiBlLndoaWNoID09IDM4KSB7IC8vIEFsdCtVcFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50LnNldElzRm9jdXNlZCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtZW50LnBhcmVudC50eXBlID09IFwiUm93XCIpIHsgLy8gUGFyZW50IGlzIGEgaG9yaXpvbnRhbCBjb250YWluZXIuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmN0cmxLZXkgJiYgIWUuc2hpZnRLZXkgJiYgIWUuYWx0S2V5ICYmIGUud2hpY2ggPT0gMzcpIHsgLy8gTGVmdFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudC5tb3ZlRm9jdXNQcmV2Q2hpbGQoZWxlbWVudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICghZS5jdHJsS2V5ICYmICFlLnNoaWZ0S2V5ICYmICFlLmFsdEtleSAmJiBlLndoaWNoID09IDM5KSB7IC8vIFJpZ2h0XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50Lm1vdmVGb2N1c05leHRDaGlsZChlbGVtZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGUuY3RybEtleSAmJiAhZS5zaGlmdEtleSAmJiAhZS5hbHRLZXkgJiYgZS53aGljaCA9PSAzNykgeyAvLyBDdHJsK0xlZnRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5tb3ZlVXAoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzZXRGb2N1cyA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChlLmN0cmxLZXkgJiYgIWUuc2hpZnRLZXkgJiYgIWUuYWx0S2V5ICYmIGUud2hpY2ggPT0gMzkpIHsgLy8gQ3RybCtSaWdodFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50Lm1vdmVEb3duKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeyAvLyBQYXJlbnQgaXMgYSB2ZXJ0aWNhbCBjb250YWluZXIuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmN0cmxLZXkgJiYgIWUuc2hpZnRLZXkgJiYgIWUuYWx0S2V5ICYmIGUud2hpY2ggPT0gMzgpIHsgLy8gVXBcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQubW92ZUZvY3VzUHJldkNoaWxkKGVsZW1lbnQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWUuY3RybEtleSAmJiAhZS5zaGlmdEtleSAmJiAhZS5hbHRLZXkgJiYgZS53aGljaCA9PSA0MCkgeyAvLyBEb3duXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50Lm1vdmVGb2N1c05leHRDaGlsZChlbGVtZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGUuY3RybEtleSAmJiAhZS5zaGlmdEtleSAmJiAhZS5hbHRLZXkgJiYgZS53aGljaCA9PSAzOCkgeyAvLyBDdHJsK1VwXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQubW92ZVVwKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc2V0Rm9jdXMgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZS5jdHJsS2V5ICYmICFlLnNoaWZ0S2V5ICYmICFlLmFsdEtleSAmJiBlLndoaWNoID09IDQwKSB7IC8vIEN0cmwrRG93blxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50Lm1vdmVEb3duKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhhbmRsZWQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kYXBwbHkoKTsgLy8gRXZlbnQgaXMgbm90IHRyaWdnZXJlZCBieSBBbmd1bGFyIGRpcmVjdGl2ZSBidXQgcmF3IGV2ZW50IGhhbmRsZXIgb24gZWxlbWVudC5cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEhBQ0s6IFdvcmthcm91bmQgYmVjYXVzZSBvZiBob3cgQW5ndWxhciB0cmVhdHMgdGhlIERPTSB3aGVuIGVsZW1lbnRzIGFyZSBzaGlmdGVkIGFyb3VuZCAtIGlucHV0IGZvY3VzIGlzIHNvbWV0aW1lcyBsb3N0LlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzZXRGb2N1cykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LnNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmVkaXRvci5mb2N1c2VkRWxlbWVudC5zZXRJc0ZvY3VzZWQoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEwMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVsZW1lbnQuc2V0SXNGb2N1c2VkRXZlbnRIYW5kbGVycy5wdXNoKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgJGVsZW1lbnQucGFyZW50KCkuZm9jdXMoKTtcclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmRlbGV0ZSA9IGZ1bmN0aW9uIChlbGVtZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuZGVsZXRlKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSxcclxuXHJcbiAgICAgICAgICAgICAgICBjb25maWd1cmVGb3JDb250YWluZXI6IGZ1bmN0aW9uICgkc2NvcGUsICRlbGVtZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVsZW1lbnQgPSAkc2NvcGUuZWxlbWVudDtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgLy8kc2NvcGUuaXNSZWNlaXZpbmcgPSBmYWxzZTsgLy8gVHJ1ZSB3aGVuIGNvbnRhaW5lciBpcyByZWNlaXZpbmcgYW4gZXh0ZXJuYWwgZWxlbWVudCB2aWEgZHJhZy9kcm9wLlxyXG4gICAgICAgICAgICAgICAgICAgICRzY29wZS5nZXRTaG93Q2hpbGRyZW5QbGFjZWhvbGRlciA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRzY29wZS5lbGVtZW50LmNoaWxkcmVuLmxlbmd0aCA9PT0gMCAmJiAhJHNjb3BlLmVsZW1lbnQuZ2V0SXNEcm9wVGFyZ2V0KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNvcnRhYmxlT3B0aW9ucyA9IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY3Vyc29yOiBcIm1vdmVcIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsYXk6IDE1MCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZWQ6IGVsZW1lbnQuZ2V0SXNTZWFsZWQoKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGlzdGFuY2U6IDUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vaGFuZGxlOiBlbGVtZW50LmNoaWxkcmVuLmxlbmd0aCA8IDIgPyBcIi5pbWFnaW5hcnktY2xhc3NcIiA6IGZhbHNlLCAvLyBGb3Igc29tZSByZWFzb24gZG9lc24ndCBnZXQgcmUtZXZhbHVhdGVkIGFmdGVyIGFkZGluZyBtb3JlIGNoaWxkcmVuLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGFydDogZnVuY3Rpb24gKGUsIHVpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnNldElzRHJvcFRhcmdldCh0cnVlKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmVkaXRvci5pc0RyYWdnaW5nID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTWFrZSB0aGUgZHJvcCB0YXJnZXQgcGxhY2Vob2xkZXIgYXMgaGlnaCBhcyB0aGUgaXRlbSBiZWluZyBkcmFnZ2VkLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWkucGxhY2Vob2xkZXIuaGVpZ2h0KHVpLml0ZW0uaGVpZ2h0KCkgLSA0KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpLnBsYWNlaG9sZGVyLmNzcyhcIm1pbi1oZWlnaHRcIiwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3A6IGZ1bmN0aW9uIChlLCB1aSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5lZGl0b3IuaXNEcmFnZ2luZyA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuc2V0SXNEcm9wVGFyZ2V0KGZhbHNlKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBvdmVyOiBmdW5jdGlvbiAoZSwgdWkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghIXVpLnNlbmRlciAmJiAhIXVpLnNlbmRlclswXS5pc1Rvb2xib3gpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISF1aS5zZW5kZXJbMF0uZHJvcFRhcmdldFRpbWVvdXQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQuY2FuY2VsKHVpLnNlbmRlclswXS5kcm9wVGFyZ2V0VGltZW91dCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpLnNlbmRlclswXS5kcm9wVGFyZ2V0VGltZW91dCA9IG51bGw7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1lbnQudHlwZSA9PSBcIlJvd1wiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGVyZSB3YXMgYSBwcmV2aW91cyBkcm9wIHRhcmdldCBhbmQgaXQgd2FzIGEgcm93LCByb2xsIGJhY2sgYW55IHBlbmRpbmcgY29sdW1uIGFkZHMgdG8gaXQuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHJldmlvdXNEcm9wVGFyZ2V0ID0gZWxlbWVudC5lZGl0b3IuZHJvcFRhcmdldEVsZW1lbnQ7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISFwcmV2aW91c0Ryb3BUYXJnZXQgJiYgcHJldmlvdXNEcm9wVGFyZ2V0LnR5cGUgPT0gXCJSb3dcIilcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmV2aW91c0Ryb3BUYXJnZXQucm9sbGJhY2tBZGRDb2x1bW4oKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnNldElzRHJvcFRhcmdldChmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWkuc2VuZGVyWzBdLmRyb3BUYXJnZXRUaW1lb3V0ID0gJHRpbWVvdXQoZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbWVudC50eXBlID09IFwiUm93XCIpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZWNlaXZlZENvbHVtbiA9IHVpLml0ZW0uc29ydGFibGUubW9kZWw7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVjZWl2ZWRDb2x1bW5XaWR0aCA9IE1hdGguZmxvb3IoMTIgLyAoZWxlbWVudC5jaGlsZHJlbi5sZW5ndGggKyAxKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNlaXZlZENvbHVtbi53aWR0aCA9IHJlY2VpdmVkQ29sdW1uV2lkdGg7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNlaXZlZENvbHVtbi5vZmZzZXQgPSAwO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iZWdpbkFkZENvbHVtbihyZWNlaXZlZENvbHVtbldpZHRoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1ha2UgdGhlIGRyb3AgdGFyZ2V0IHBsYWNlaG9sZGVyIHRoZSBjb3JyZWN0IHdpZHRoIGFuZCBhcyBoaWdoIGFzIHRoZSBoaWdoZXN0IGV4aXN0aW5nIGNvbHVtbiBpbiB0aGUgcm93LlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1heEhlaWdodCA9IF8ubWF4KF8oJGVsZW1lbnQuZmluZChcIj4gLmxheW91dC1jaGlsZHJlbiA+IC5sYXlvdXQtY29sdW1uOm5vdCgudWktc29ydGFibGUtcGxhY2Vob2xkZXIpXCIpKS5tYXAoZnVuY3Rpb24gKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChlKS5oZWlnaHQoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDE7IGkgPD0gMTI7IGkrKylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aS5wbGFjZWhvbGRlci5yZW1vdmVDbGFzcyhcImNvbC14cy1cIiArIGkpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWkucGxhY2Vob2xkZXIuYWRkQ2xhc3MoXCJjb2wteHMtXCIgKyByZWNlaXZlZENvbHVtbi53aWR0aCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF4SGVpZ2h0ID4gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpLnBsYWNlaG9sZGVyLmhlaWdodChtYXhIZWlnaHQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpLnBsYWNlaG9sZGVyLmNzcyhcIm1pbi1oZWlnaHRcIiwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aS5wbGFjZWhvbGRlci5oZWlnaHQoMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWkucGxhY2Vob2xkZXIuY3NzKFwibWluLWhlaWdodFwiLCBcIlwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnNldElzRHJvcFRhcmdldCh0cnVlKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxNTApO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICByZWNlaXZlOiBmdW5jdGlvbiAoZSwgdWkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghIXVpLnNlbmRlciAmJiAhIXVpLnNlbmRlclswXS5pc1Rvb2xib3gpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlY2VpdmVkRWxlbWVudCA9IHVpLml0ZW0uc29ydGFibGUubW9kZWw7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghIXJlY2VpdmVkRWxlbWVudCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1lbnQudHlwZSA9PSBcIlJvd1wiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuY29tbWl0QWRkQ29sdW1uKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTaG91bGQgaWRlYWxseSBjYWxsIExheW91dEVkaXRvci5Db250YWluZXIuYWRkQ2hpbGQoKSBpbnN0ZWFkLCBidXQgc2luY2UgdGhpcyBoYW5kbGVyXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpcyBydW4gKmJlZm9yZSogdGhlIHVpLXNvcnRhYmxlIGRpcmVjdGl2ZSdzIGhhbmRsZXIsIGlmIHdlIHRyeSB0byBhZGQgdGhlIGNoaWxkIHRvIHRoZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYXJyYXkgdGhhdCBoYW5kbGVyIHdpbGwgZ2V0IGFuIGV4Y2VwdGlvbiB3aGVuIHRyeWluZyB0byBkbyB0aGUgc2FtZS5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEJlY2F1c2Ugb2YgdGhpcywgd2UgbmVlZCB0byBpbnZva2UgXCJzZXRQYXJlbnRcIiBzbyB0aGF0IHNwZWNpZmljIGNvbnRhaW5lciB0eXBlcyBjYW4gcGVyZm9ybSBlbGVtZW50IHNwZWZpY2ljIGluaXRpYWxpemF0aW9uLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZWRFbGVtZW50LnNldEVkaXRvcihlbGVtZW50LmVkaXRvcik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNlaXZlZEVsZW1lbnQuc2V0UGFyZW50KGVsZW1lbnQpO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghIXJlY2VpdmVkRWxlbWVudC5oYXNFZGl0b3IpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJHJvb3QuZWRpdEVsZW1lbnQocmVjZWl2ZWRFbGVtZW50KS50aGVuKGZ1bmN0aW9uIChhcmdzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYXJncy5jYW5jZWwpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY2VpdmVkRWxlbWVudC5kYXRhID0gYXJncy5lbGVtZW50LmRhdGE7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNlaXZlZEVsZW1lbnQuYXBwbHlFbGVtZW50RWRpdG9yTW9kZWwoYXJncy5lbGVtZW50RWRpdG9yTW9kZWwpO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghIXJlY2VpdmVkRWxlbWVudC5zZXRIdG1sKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY2VpdmVkRWxlbWVudC5zZXRIdG1sKGFyZ3MuZWxlbWVudC5odG1sKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISFhcmdzLmNhbmNlbClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNlaXZlZEVsZW1lbnQuZGVsZXRlKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZWRFbGVtZW50LnNldElzRm9jdXNlZCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8kc2NvcGUuaXNSZWNlaXZpbmcgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuc2V0SXNEcm9wVGFyZ2V0KGZhbHNlKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8kc2NvcGUuaXNSZWNlaXZpbmcgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuc2V0SXNEcm9wVGFyZ2V0KGZhbHNlKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghIXJlY2VpdmVkRWxlbWVudClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNlaXZlZEVsZW1lbnQuc2V0SXNGb2N1c2VkKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmNsaWNrID0gZnVuY3Rpb24gKGNoaWxkLCBlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY2hpbGQuZWRpdG9yLmlzRHJhZ2dpbmcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZC5zZXRJc0ZvY3VzZWQoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcclxuICAgICAgICAgICAgICAgICAgICB9O1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZ2V0Q2xhc3NlcyA9IGZ1bmN0aW9uIChjaGlsZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzdWx0ID0gW1wibGF5b3V0LWVsZW1lbnRcIl07XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoISFjaGlsZC5jaGlsZHJlbikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJsYXlvdXQtY29udGFpbmVyXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkLmdldElzU2VhbGVkKCkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJsYXlvdXQtY29udGFpbmVyLXNlYWxlZFwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJsYXlvdXQtXCIgKyBjaGlsZC50eXBlLnRvTG93ZXJDYXNlKCkpO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEhY2hpbGQuZHJvcFRhcmdldENsYXNzKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goY2hpbGQuZHJvcFRhcmdldENsYXNzKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IE1vdmUgdGhlc2UgdG8gZWl0aGVyIHRoZSBDb2x1bW4gZGlyZWN0aXZlIG9yIHRoZSBDb2x1bW4gbW9kZWwgY2xhc3MuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaGlsZC50eXBlID09IFwiUm93XCIpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKFwicm93XCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjaGlsZC5jYW5BZGRDb2x1bW4oKSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcImxheW91dC1yb3ctZnVsbFwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGQudHlwZSA9PSBcIkNvbHVtblwiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcImNvbC14cy1cIiArIGNoaWxkLndpZHRoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKFwiY29sLXhzLW9mZnNldC1cIiArIGNoaWxkLm9mZnNldCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkLnR5cGUgPT0gXCJDb250ZW50XCIpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcImxheW91dC1jb250ZW50LVwiICsgY2hpbGQuY29udGVudFR5cGVDbGFzcyk7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGQuZ2V0SXNBY3RpdmUoKSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKFwibGF5b3V0LWVsZW1lbnQtYWN0aXZlXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGQuZ2V0SXNGb2N1c2VkKCkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcImxheW91dC1lbGVtZW50LWZvY3VzZWRcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaGlsZC5nZXRJc1NlbGVjdGVkKCkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcImxheW91dC1lbGVtZW50LXNlbGVjdGVkXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGQuZ2V0SXNEcm9wVGFyZ2V0KCkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcImxheW91dC1lbGVtZW50LWRyb3B0YXJnZXRcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaGlsZC5pc1RlbXBsYXRlZClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKFwibGF5b3V0LWVsZW1lbnQtdGVtcGxhdGVkXCIpO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcclxuICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgIH1cclxuICAgIF0pOyIsImFuZ3VsYXJcclxuICAgIC5tb2R1bGUoXCJMYXlvdXRFZGl0b3JcIilcclxuICAgIC5kaXJlY3RpdmUoXCJvcmNMYXlvdXRFZGl0b3JcIiwgW1wiZW52aXJvbm1lbnRcIixcclxuICAgICAgICBmdW5jdGlvbiAoZW52aXJvbm1lbnQpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIHJlc3RyaWN0OiBcIkVcIixcclxuICAgICAgICAgICAgICAgIHNjb3BlOiB7fSxcclxuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFtcIiRzY29wZVwiLCBcIiRlbGVtZW50XCIsIFwiJGF0dHJzXCIsIFwiJGNvbXBpbGVcIiwgXCJjbGlwYm9hcmRcIixcclxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoJHNjb3BlLCAkZWxlbWVudCwgJGF0dHJzLCAkY29tcGlsZSwgY2xpcGJvYXJkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghISRhdHRycy5tb2RlbClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5lbGVtZW50ID0gZXZhbCgkYXR0cnMubW9kZWwpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJUaGUgJ21vZGVsJyBhdHRyaWJ1dGUgbXVzdCBldmFsdWF0ZSB0byBhIExheW91dEVkaXRvci5FZGl0b3Igb2JqZWN0LlwiKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5jbGljayA9IGZ1bmN0aW9uIChjYW52YXMsIGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY2FudmFzLmVkaXRvci5pc0RyYWdnaW5nKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5zZXRJc0ZvY3VzZWQoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZ2V0Q2xhc3NlcyA9IGZ1bmN0aW9uIChjYW52YXMpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSBbXCJsYXlvdXQtZWxlbWVudFwiLCBcImxheW91dC1jb250YWluZXJcIiwgXCJsYXlvdXQtY2FudmFzXCJdO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYW52YXMuZ2V0SXNBY3RpdmUoKSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcImxheW91dC1lbGVtZW50LWFjdGl2ZVwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYW52YXMuZ2V0SXNGb2N1c2VkKCkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJsYXlvdXQtZWxlbWVudC1mb2N1c2VkXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNhbnZhcy5nZXRJc1NlbGVjdGVkKCkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJsYXlvdXQtZWxlbWVudC1zZWxlY3RlZFwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYW52YXMuZ2V0SXNEcm9wVGFyZ2V0KCkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJsYXlvdXQtZWxlbWVudC1kcm9wdGFyZ2V0XCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNhbnZhcy5pc1RlbXBsYXRlZClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcImxheW91dC1lbGVtZW50LXRlbXBsYXRlZFwiKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gQW4gdW5mb3J0dW5hdGUgc2lkZS1lZmZlY3Qgb2YgdGhlIG5leHQgaGFjayBvbiBsaW5lIDU0IGlzIHRoYXQgdGhlIGNyZWF0ZWQgZWxlbWVudHMgYXJlbid0IGFkZGVkIHRvIHRoZSBET00geWV0LCBzbyB3ZSBjYW4ndCB1c2UgaXQgdG8gZ2V0IHRvIHRoZSBwYXJlbnQgXCIubGF5b3V0LWRlc2lnZXJcIiBlbGVtZW50LlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBXb3JrIGFyb3VuZDogYWNjZXNzIHRoYXQgZWxlbWVudCBkaXJlY3RseSAod2hpY2ggZWZlY3RpdmVseSB0dXJucyBtdWx0aXBsZSBsYXlvdXQgZWRpdG9ycyBvbiBhIHNpbmdsZSBwYWdlIGltcG9zc2libGUpLiBcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gLy92YXIgbGF5b3V0RGVzaWduZXJIb3N0ID0gJGVsZW1lbnQuY2xvc2VzdChcIi5sYXlvdXQtZGVzaWduZXJcIikuZGF0YShcImxheW91dC1kZXNpZ25lci1ob3N0XCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGF5b3V0RGVzaWduZXJIb3N0ID0gJChcIi5sYXlvdXQtZGVzaWduZXJcIikuZGF0YShcImxheW91dC1kZXNpZ25lci1ob3N0XCIpO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRyb290LmxheW91dERlc2lnbmVySG9zdCA9IGxheW91dERlc2lnbmVySG9zdDtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxheW91dERlc2lnbmVySG9zdC5lbGVtZW50Lm9uKFwicmVwbGFjZWNhbnZhc1wiLCBmdW5jdGlvbiAoZSwgYXJncykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVkaXRvciA9ICRzY29wZS5lbGVtZW50O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNhbnZhc0RhdGEgPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogYXJncy5jYW52YXMuZGF0YSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBodG1sSWQ6IGFyZ3MuY2FudmFzLmh0bWxJZCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBodG1sQ2xhc3M6IGFyZ3MuY2FudmFzLmh0bWxDbGFzcyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBodG1sU3R5bGU6IGFyZ3MuY2FudmFzLmh0bWxTdHlsZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1RlbXBsYXRlZDogYXJncy5jYW52YXMuaXNUZW1wbGF0ZWQsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGRyZW46IGFyZ3MuY2FudmFzLmNoaWxkcmVuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEhBQ0s6IEluc3RlYWQgb2Ygc2ltcGx5IHVwZGF0aW5nIHRoZSAkc2NvcGUuZWxlbWVudCB3aXRoIGEgbmV3IGluc3RhbmNlLCB3ZSBuZWVkIHRvIHJlcGxhY2UgdGhlIGVudGlyZSBvcmMtbGF5b3V0LWVkaXRvciBtYXJrdXBcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGluIG9yZGVyIGZvciBhbmd1bGFyIHRvIHJlYmluZCBzdGFydGluZyB3aXRoIHRoZSBDYW52YXMgZWxlbWVudC4gT3RoZXJ3aXNlLCBmb3Igc29tZSByZWFzb24sIGl0IHdpbGwgcmViaW5kIHN0YXJ0aW5nIHdpdGggdGhlIGZpcnN0IGNoaWxkIG9mIENhbnZhcy5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFlvdSBjYW4gc2VlIHRoaXMgaGFwcGVuaW5nIHdoZW4gc2V0dGluZyBhIGJyZWFrcG9pbnQgaW4gU2NvcGVDb25maWd1cmF0b3Igd2hlcmUgY29udGFpbmVycyBhcmUgaW5pdGlhbGl6ZWQgd2l0aCBkcmFnICYgZHJvcDogb24gcGFnZSBsb2FkLCB0aGUgZmlyc3QgZWxlbWVudFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXMgYSBDYW52YXMgKGdvb2QpLCBidXQgYWZ0ZXIgaGF2aW5nIHNlbGVjdGVkIGFub3RoZXIgdGVtcGxhdGUsIHRoZSBmaXJzdCBlbGVtZW50IGlzICh0eXBpY2FsbHkpIGEgR3JpZCAoYmFkKS5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNpbXBseSByZWNvbXBpbGluZyB0aGUgb3JjLWxheW91dC1lZGl0b3IgZGlyZWN0aXZlIHdpbGwgY2F1c2UgdGhlIGVudGlyZSB0aGluZyB0byBiZSBnZW5lcmF0ZWQsIHdoaWNoIHdvcmtzIGp1c3QgZmluZSBhcyB3ZWxsIChldmVuIHRob3VnaCBub3QgaXMgbmljZSBhcyBzaW1wbHkgbGV2ZXJhZ2luZyBtb2RlbCBiaW5kaW5nKS5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxheW91dERlc2lnbmVySG9zdC5lZGl0b3IgPSB3aW5kb3cubGF5b3V0RWRpdG9yID0gbmV3IExheW91dEVkaXRvci5FZGl0b3IoZWRpdG9yLmNvbmZpZywgY2FudmFzRGF0YSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGVtcGxhdGUgPSBcIjxvcmMtbGF5b3V0LWVkaXRvclwiICsgXCIgbW9kZWw9J3dpbmRvdy5sYXlvdXRFZGl0b3InIC8+XCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9ICRjb21waWxlKHRlbXBsYXRlKSgkc2NvcGUpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJChcIi5sYXlvdXQtZWRpdG9yLWhvbGRlclwiKS5odG1sKGh0bWwpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kcm9vdC5lZGl0RWxlbWVudCA9IGZ1bmN0aW9uIChlbGVtZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaG9zdCA9ICRzY29wZS4kcm9vdC5sYXlvdXREZXNpZ25lckhvc3Q7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaG9zdC5lZGl0RWxlbWVudChlbGVtZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kcm9vdC5hZGRFbGVtZW50ID0gZnVuY3Rpb24gKGNvbnRlbnRUeXBlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaG9zdCA9ICRzY29wZS4kcm9vdC5sYXlvdXREZXNpZ25lckhvc3Q7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaG9zdC5hZGRFbGVtZW50KGNvbnRlbnRUeXBlKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICQoZG9jdW1lbnQpLm9uKFwiY3V0IGNvcHkgcGFzdGVcIiwgZnVuY3Rpb24gKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBwc2V1ZG8gY2xpcGJvYXJkIHdhcyBhbHJlYWR5IGludm9rZWQgKHdoaWNoIGhhcHBlbnMgb24gdGhlIGZpcnN0IGNsaXBib2FyZFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb3BlcmF0aW9uIGFmdGVyIHBhZ2UgbG9hZCBldmVuIGlmIG5hdGl2ZSBjbGlwYm9hcmQgc3VwcG9ydCBleGlzdHMpIHRoZW4gc2l0IHRoaXNcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9uZSBvcGVyYXRpb24gb3V0LCBidXQgbWFrZSBzdXJlIHdoYXRldmVyIGlzIG9uIHRoZSBwc2V1ZG8gY2xpcGJvYXJkIGdldHMgbWlncmF0ZWRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRvIHRoZSBuYXRpdmUgY2xpcGJvYXJkIGZvciBzdWJzZXF1ZW50IG9wZXJhdGlvbnMuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2xpcGJvYXJkLndhc0ludm9rZWQoKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUub3JpZ2luYWxFdmVudC5jbGlwYm9hcmREYXRhLnNldERhdGEoXCJ0ZXh0L3BsYWluXCIsIGNsaXBib2FyZC5nZXREYXRhKFwidGV4dC9wbGFpblwiKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5vcmlnaW5hbEV2ZW50LmNsaXBib2FyZERhdGEuc2V0RGF0YShcInRleHQvanNvblwiLCBjbGlwYm9hcmQuZ2V0RGF0YShcInRleHQvanNvblwiKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZvY3VzZWRFbGVtZW50ID0gJHNjb3BlLmVsZW1lbnQuZm9jdXNlZEVsZW1lbnQ7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEhZm9jdXNlZEVsZW1lbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGUudHlwZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJjb3B5XCI6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvY3VzZWRFbGVtZW50LmNvcHkoZS5vcmlnaW5hbEV2ZW50LmNsaXBib2FyZERhdGEpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwiY3V0XCI6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvY3VzZWRFbGVtZW50LmN1dChlLm9yaWdpbmFsRXZlbnQuY2xpcGJvYXJkRGF0YSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJwYXN0ZVwiOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2N1c2VkRWxlbWVudC5wYXN0ZShlLm9yaWdpbmFsRXZlbnQuY2xpcGJvYXJkRGF0YSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEhBQ0s6IFdvcmthcm91bmQgYmVjYXVzZSBvZiBob3cgQW5ndWxhciB0cmVhdHMgdGhlIERPTSB3aGVuIGVsZW1lbnRzIGFyZSBzaGlmdGVkIGFyb3VuZCAtIGlucHV0IGZvY3VzIGlzIHNvbWV0aW1lcyBsb3N0LlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuc2V0VGltZW91dChmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISEkc2NvcGUuZWxlbWVudC5mb2N1c2VkRWxlbWVudClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVsZW1lbnQuZm9jdXNlZEVsZW1lbnQuc2V0SXNGb2N1c2VkKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAwKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTmF0aXZlIGNsaXBib2FyZCBzdXBwb3J0IG9idmlvdXNseSBleGlzdHMsIHNvIGRpc2FibGUgdGhlIHBldWRvIGNsaXBib2FyZCBmcm9tIG5vdyBvbi5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsaXBib2FyZC5kaXNhYmxlKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogZW52aXJvbm1lbnQudGVtcGxhdGVVcmwoXCJFZGl0b3JcIiksXHJcbiAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gTm8gY2xpY2tzIHNob3VsZCBwcm9wYWdhdGUgZnJvbSB0aGUgVGlueU1DRSB0b29sYmFycy5cclxuICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmZpbmQoXCIubGF5b3V0LXRvb2xiYXItY29udGFpbmVyXCIpLmNsaWNrKGZ1bmN0aW9uIChlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gVW5mb2N1cyBhbmQgdW5zZWxlY3QgZXZlcnl0aGluZyBvbiBjbGljayBvdXRzaWRlIG9mIGNhbnZhcy5cclxuICAgICAgICAgICAgICAgICAgICAkKHdpbmRvdykuY2xpY2soZnVuY3Rpb24gKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmVsZW1lbnQuYWN0aXZlRWxlbWVudCA9IG51bGw7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbGVtZW50LmZvY3VzZWRFbGVtZW50ID0gbnVsbDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgfVxyXG4gICAgXSk7IiwiYW5ndWxhclxyXG4gICAgLm1vZHVsZShcIkxheW91dEVkaXRvclwiKVxyXG4gICAgLmRpcmVjdGl2ZShcIm9yY0xheW91dENhbnZhc1wiLCBbXCJzY29wZUNvbmZpZ3VyYXRvclwiLCBcImVudmlyb25tZW50XCIsXHJcbiAgICAgICAgZnVuY3Rpb24gKHNjb3BlQ29uZmlndXJhdG9yLCBlbnZpcm9ubWVudCkge1xyXG4gICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgICAgcmVzdHJpY3Q6IFwiRVwiLFxyXG4gICAgICAgICAgICAgICAgc2NvcGU6IHsgZWxlbWVudDogXCI9XCIgfSxcclxuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFtcIiRzY29wZVwiLCBcIiRlbGVtZW50XCIsIFwiJGF0dHJzXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKCRzY29wZSwgJGVsZW1lbnQsICRhdHRycykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBzY29wZUNvbmZpZ3VyYXRvci5jb25maWd1cmVGb3JFbGVtZW50KCRzY29wZSwgJGVsZW1lbnQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBzY29wZUNvbmZpZ3VyYXRvci5jb25maWd1cmVGb3JDb250YWluZXIoJHNjb3BlLCAkZWxlbWVudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5zb3J0YWJsZU9wdGlvbnNbXCJheGlzXCJdID0gXCJ5XCI7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgXSxcclxuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiBlbnZpcm9ubWVudC50ZW1wbGF0ZVVybChcIkNhbnZhc1wiKSxcclxuICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWVcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICB9XHJcbiAgICBdKTsiLCJhbmd1bGFyXHJcbiAgICAubW9kdWxlKFwiTGF5b3V0RWRpdG9yXCIpXHJcbiAgICAuZGlyZWN0aXZlKFwib3JjTGF5b3V0Q2hpbGRcIiwgW1wiJGNvbXBpbGVcIixcclxuICAgICAgICBmdW5jdGlvbiAoJGNvbXBpbGUpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIHJlc3RyaWN0OiBcIkVcIixcclxuICAgICAgICAgICAgICAgIHNjb3BlOiB7IGVsZW1lbnQ6IFwiPVwiIH0sXHJcbiAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgdGVtcGxhdGUgPSBcIjxvcmMtbGF5b3V0LVwiICsgc2NvcGUuZWxlbWVudC50eXBlLnRvTG93ZXJDYXNlKCkgKyBcIiBlbGVtZW50PSdlbGVtZW50JyAvPlwiO1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gJGNvbXBpbGUodGVtcGxhdGUpKHNjb3BlKTtcclxuICAgICAgICAgICAgICAgICAgICAkKGVsZW1lbnQpLnJlcGxhY2VXaXRoKGh0bWwpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgIH1cclxuICAgIF0pOyIsImFuZ3VsYXJcclxuICAgIC5tb2R1bGUoXCJMYXlvdXRFZGl0b3JcIilcclxuICAgIC5kaXJlY3RpdmUoXCJvcmNMYXlvdXRDb2x1bW5cIiwgW1wiJGNvbXBpbGVcIiwgXCJzY29wZUNvbmZpZ3VyYXRvclwiLCBcImVudmlyb25tZW50XCIsXHJcbiAgICAgICAgZnVuY3Rpb24gKCRjb21waWxlLCBzY29wZUNvbmZpZ3VyYXRvciwgZW52aXJvbm1lbnQpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIHJlc3RyaWN0OiBcIkVcIixcclxuICAgICAgICAgICAgICAgIHNjb3BlOiB7IGVsZW1lbnQ6IFwiPVwiIH0sXHJcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbXCIkc2NvcGVcIiwgXCIkZWxlbWVudFwiLFxyXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uICgkc2NvcGUsICRlbGVtZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlQ29uZmlndXJhdG9yLmNvbmZpZ3VyZUZvckVsZW1lbnQoJHNjb3BlLCAkZWxlbWVudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlQ29uZmlndXJhdG9yLmNvbmZpZ3VyZUZvckNvbnRhaW5lcigkc2NvcGUsICRlbGVtZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNvcnRhYmxlT3B0aW9uc1tcImF4aXNcIl0gPSBcInlcIjtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6IGVudmlyb25tZW50LnRlbXBsYXRlVXJsKFwiQ29sdW1uXCIpLFxyXG4gICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSxcclxuICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0cnMpIHtcclxuICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmZpbmQoXCIubGF5b3V0LWNvbHVtbi1yZXNpemUtYmFyXCIpLmRyYWdnYWJsZSh7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGF4aXM6IFwieFwiLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWxwZXI6IFwiY2xvbmVcIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV2ZXJ0OiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGFydDogZnVuY3Rpb24gKGUsIHVpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmVsZW1lbnQuZWRpdG9yLmlzUmVzaXppbmcgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRyYWc6IGZ1bmN0aW9uIChlLCB1aSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbHVtbkVsZW1lbnQgPSBlbGVtZW50LnBhcmVudCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbHVtblNpemUgPSBjb2x1bW5FbGVtZW50LndpZHRoKCkgLyBzY29wZS5lbGVtZW50LndpZHRoO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbm5lY3RBZGphY2VudCA9ICFlLmN0cmxLZXk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJChlLnRhcmdldCkuaGFzQ2xhc3MoXCJsYXlvdXQtY29sdW1uLXJlc2l6ZS1iYXItbGVmdFwiKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWx0YSA9IHVpLm9mZnNldC5sZWZ0IC0gY29sdW1uRWxlbWVudC5vZmZzZXQoKS5sZWZ0O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YSA8IC1jb2x1bW5TaXplICYmIHNjb3BlLmVsZW1lbnQuY2FuRXhwYW5kTGVmdChjb25uZWN0QWRqYWNlbnQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbGVtZW50LmV4cGFuZExlZnQoY29ubmVjdEFkamFjZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlbHRhID4gY29sdW1uU2l6ZSAmJiBzY29wZS5lbGVtZW50LmNhbkNvbnRyYWN0TGVmdChjb25uZWN0QWRqYWNlbnQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbGVtZW50LmNvbnRyYWN0TGVmdChjb25uZWN0QWRqYWNlbnQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICgkKGUudGFyZ2V0KS5oYXNDbGFzcyhcImxheW91dC1jb2x1bW4tcmVzaXplLWJhci1yaWdodFwiKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWx0YSA9IHVpLm9mZnNldC5sZWZ0IC0gY29sdW1uRWxlbWVudC53aWR0aCgpIC0gY29sdW1uRWxlbWVudC5vZmZzZXQoKS5sZWZ0O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YSA+IGNvbHVtblNpemUgJiYgc2NvcGUuZWxlbWVudC5jYW5FeHBhbmRSaWdodChjb25uZWN0QWRqYWNlbnQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbGVtZW50LmV4cGFuZFJpZ2h0KGNvbm5lY3RBZGphY2VudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChkZWx0YSA8IC1jb2x1bW5TaXplICYmIHNjb3BlLmVsZW1lbnQuY2FuQ29udHJhY3RSaWdodChjb25uZWN0QWRqYWNlbnQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbGVtZW50LmNvbnRyYWN0UmlnaHQoY29ubmVjdEFkamFjZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcDogZnVuY3Rpb24gKGUsIHVpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbGVtZW50LmVkaXRvci5pc1Jlc2l6aW5nID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgIH1cclxuICAgIF0pOyIsImFuZ3VsYXJcclxuICAgIC5tb2R1bGUoXCJMYXlvdXRFZGl0b3JcIilcclxuICAgIC5kaXJlY3RpdmUoXCJvcmNMYXlvdXRDb250ZW50XCIsIFtcIiRzY2VcIiwgXCJzY29wZUNvbmZpZ3VyYXRvclwiLCBcImVudmlyb25tZW50XCIsXHJcbiAgICAgICAgZnVuY3Rpb24gKCRzY2UsIHNjb3BlQ29uZmlndXJhdG9yLCBlbnZpcm9ubWVudCkge1xyXG4gICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgICAgcmVzdHJpY3Q6IFwiRVwiLFxyXG4gICAgICAgICAgICAgICAgc2NvcGU6IHsgZWxlbWVudDogXCI9XCIgfSxcclxuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFtcIiRzY29wZVwiLCBcIiRlbGVtZW50XCIsXHJcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKCRzY29wZSwgJGVsZW1lbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGVDb25maWd1cmF0b3IuY29uZmlndXJlRm9yRWxlbWVudCgkc2NvcGUsICRlbGVtZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVkaXQgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJHJvb3QuZWRpdEVsZW1lbnQoJHNjb3BlLmVsZW1lbnQpLnRoZW4oZnVuY3Rpb24gKGFyZ3MpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZ3MuY2FuY2VsKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVsZW1lbnQuZGF0YSA9IGFyZ3MuZWxlbWVudC5kYXRhO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZWxlbWVudC5zZXRIdG1sKGFyZ3MuZWxlbWVudC5odG1sKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gT3ZlcndyaXRlIHRoZSBzZXRIdG1sIGZ1bmN0aW9uIHNvIHRoYXQgd2UgY2FuIHVzZSB0aGUgJHNjZSBzZXJ2aWNlIHRvIHRydXN0IHRoZSBodG1sIChhbmQgbm90IGhhdmUgdGhlIGh0bWwgYmluZGluZyBzdHJpcCBjZXJ0YWluIHRhZ3MpLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZWxlbWVudC5zZXRIdG1sID0gZnVuY3Rpb24gKGh0bWwpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5lbGVtZW50Lmh0bWwgPSBodG1sO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVsZW1lbnQuaHRtbFVuc2FmZSA9ICRzY2UudHJ1c3RBc0h0bWwoaHRtbCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZWxlbWVudC5zZXRIdG1sKCRzY29wZS5lbGVtZW50Lmh0bWwpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogZW52aXJvbm1lbnQudGVtcGxhdGVVcmwoXCJDb250ZW50XCIpLFxyXG4gICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZVxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgIH1cclxuICAgIF0pOyIsImFuZ3VsYXJcclxuICAgIC5tb2R1bGUoXCJMYXlvdXRFZGl0b3JcIilcclxuICAgIC5kaXJlY3RpdmUoXCJvcmNMYXlvdXRIdG1sXCIsIFtcIiRzY2VcIiwgXCJzY29wZUNvbmZpZ3VyYXRvclwiLCBcImVudmlyb25tZW50XCIsXHJcbiAgICAgICAgZnVuY3Rpb24gKCRzY2UsIHNjb3BlQ29uZmlndXJhdG9yLCBlbnZpcm9ubWVudCkge1xyXG4gICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgICAgcmVzdHJpY3Q6IFwiRVwiLFxyXG4gICAgICAgICAgICAgICAgc2NvcGU6IHsgZWxlbWVudDogXCI9XCIgfSxcclxuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFtcIiRzY29wZVwiLCBcIiRlbGVtZW50XCIsXHJcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKCRzY29wZSwgJGVsZW1lbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGVDb25maWd1cmF0b3IuY29uZmlndXJlRm9yRWxlbWVudCgkc2NvcGUsICRlbGVtZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVkaXQgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJHJvb3QuZWRpdEVsZW1lbnQoJHNjb3BlLmVsZW1lbnQpLnRoZW4oZnVuY3Rpb24gKGFyZ3MpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZ3MuY2FuY2VsKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVsZW1lbnQuZGF0YSA9IGFyZ3MuZWxlbWVudC5kYXRhO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZWxlbWVudC5zZXRIdG1sKGFyZ3MuZWxlbWVudC5odG1sKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUudXBkYXRlQ29udGVudCA9IGZ1bmN0aW9uIChlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZWxlbWVudC5zZXRIdG1sKGUudGFyZ2V0LmlubmVySFRNTCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBPdmVyd3JpdGUgdGhlIHNldEh0bWwgZnVuY3Rpb24gc28gdGhhdCB3ZSBjYW4gdXNlIHRoZSAkc2NlIHNlcnZpY2UgdG8gdHJ1c3QgdGhlIGh0bWwgKGFuZCBub3QgaGF2ZSB0aGUgaHRtbCBiaW5kaW5nIHN0cmlwIGNlcnRhaW4gdGFncykuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5lbGVtZW50LnNldEh0bWwgPSBmdW5jdGlvbiAoaHRtbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVsZW1lbnQuaHRtbCA9IGh0bWw7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZWxlbWVudC5odG1sVW5zYWZlID0gJHNjZS50cnVzdEFzSHRtbChodG1sKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5lbGVtZW50LnNldEh0bWwoJHNjb3BlLmVsZW1lbnQuaHRtbCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgXSxcclxuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiBlbnZpcm9ubWVudC50ZW1wbGF0ZVVybChcIkh0bWxcIiksXHJcbiAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50KSB7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgfVxyXG4gICAgXSk7IiwiYW5ndWxhclxyXG4gICAgLm1vZHVsZShcIkxheW91dEVkaXRvclwiKVxyXG4gICAgLmRpcmVjdGl2ZShcIm9yY0xheW91dEdyaWRcIiwgW1wiJGNvbXBpbGVcIiwgXCJzY29wZUNvbmZpZ3VyYXRvclwiLCBcImVudmlyb25tZW50XCIsXHJcbiAgICAgICAgZnVuY3Rpb24gKCRjb21waWxlLCBzY29wZUNvbmZpZ3VyYXRvciwgZW52aXJvbm1lbnQpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIHJlc3RyaWN0OiBcIkVcIixcclxuICAgICAgICAgICAgICAgIHNjb3BlOiB7IGVsZW1lbnQ6IFwiPVwiIH0sXHJcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbXCIkc2NvcGVcIiwgXCIkZWxlbWVudFwiLFxyXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uICgkc2NvcGUsICRlbGVtZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlQ29uZmlndXJhdG9yLmNvbmZpZ3VyZUZvckVsZW1lbnQoJHNjb3BlLCAkZWxlbWVudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlQ29uZmlndXJhdG9yLmNvbmZpZ3VyZUZvckNvbnRhaW5lcigkc2NvcGUsICRlbGVtZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNvcnRhYmxlT3B0aW9uc1tcImF4aXNcIl0gPSBcInlcIjtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6IGVudmlyb25tZW50LnRlbXBsYXRlVXJsKFwiR3JpZFwiKSxcclxuICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWVcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICB9XHJcbiAgICBdKTsiLCJhbmd1bGFyXHJcbiAgICAubW9kdWxlKFwiTGF5b3V0RWRpdG9yXCIpXHJcbiAgICAuZGlyZWN0aXZlKFwib3JjTGF5b3V0Um93XCIsIFtcIiRjb21waWxlXCIsIFwic2NvcGVDb25maWd1cmF0b3JcIiwgXCJlbnZpcm9ubWVudFwiLFxyXG4gICAgICAgIGZ1bmN0aW9uICgkY29tcGlsZSwgc2NvcGVDb25maWd1cmF0b3IsIGVudmlyb25tZW50KSB7XHJcbiAgICAgICAgICAgIHJldHVybiB7XHJcbiAgICAgICAgICAgICAgICByZXN0cmljdDogXCJFXCIsXHJcbiAgICAgICAgICAgICAgICBzY29wZTogeyBlbGVtZW50OiBcIj1cIiB9LFxyXG4gICAgICAgICAgICAgICAgY29udHJvbGxlcjogW1wiJHNjb3BlXCIsIFwiJGVsZW1lbnRcIixcclxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoJHNjb3BlLCAkZWxlbWVudCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBzY29wZUNvbmZpZ3VyYXRvci5jb25maWd1cmVGb3JFbGVtZW50KCRzY29wZSwgJGVsZW1lbnQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBzY29wZUNvbmZpZ3VyYXRvci5jb25maWd1cmVGb3JDb250YWluZXIoJHNjb3BlLCAkZWxlbWVudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5zb3J0YWJsZU9wdGlvbnNbXCJheGlzXCJdID0gXCJ4XCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5zb3J0YWJsZU9wdGlvbnNbXCJ1aS1mbG9hdGluZ1wiXSA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgXSxcclxuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiBlbnZpcm9ubWVudC50ZW1wbGF0ZVVybChcIlJvd1wiKSxcclxuICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWVcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICB9XHJcbiAgICBdKTsiLCJhbmd1bGFyXHJcbiAgICAubW9kdWxlKFwiTGF5b3V0RWRpdG9yXCIpXHJcbiAgICAuZGlyZWN0aXZlKFwib3JjTGF5b3V0UG9wdXBcIiwgW1xyXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIHJlc3RyaWN0OiBcIkFcIixcclxuICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0cnMpIHtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgcG9wdXAgPSAkKGVsZW1lbnQpO1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciB0cmlnZ2VyID0gcG9wdXAuY2xvc2VzdChcIi5sYXlvdXQtcG9wdXAtdHJpZ2dlclwiKTtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgcGFyZW50RWxlbWVudCA9IHBvcHVwLmNsb3Nlc3QoXCIubGF5b3V0LWVsZW1lbnRcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgdHJpZ2dlci5jbGljayhmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvcHVwLnRvZ2dsZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocG9wdXAuaXMoXCI6dmlzaWJsZVwiKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9wdXAucG9zaXRpb24oe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG15OiBhdHRycy5vcmNMYXlvdXRQb3B1cE15IHx8IFwibGVmdCB0b3BcIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdDogYXR0cnMub3JjTGF5b3V0UG9wdXBBdCB8fCBcImxlZnQgYm90dG9tKzRweFwiLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mOiB0cmlnZ2VyXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcHVwLmZpbmQoXCJpbnB1dFwiKS5maXJzdCgpLmZvY3VzKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICBwb3B1cC5jbGljayhmdW5jdGlvbiAoZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpO1xyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIHBhcmVudEVsZW1lbnQuY2xpY2soZnVuY3Rpb24gKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcG9wdXAuaGlkZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIHBvcHVwLmtleWRvd24oZnVuY3Rpb24gKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmN0cmxLZXkgJiYgIWUuc2hpZnRLZXkgJiYgIWUuYWx0S2V5ICYmIGUud2hpY2ggPT0gMjcpIC8vIEVzY1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9wdXAuaGlkZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpO1xyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIHBvcHVwLm9uKFwiY3V0IGNvcHkgcGFzdGVcIiwgZnVuY3Rpb24gKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWxsb3cgY2xpcGJvYXJkIG9wZXJhdGlvbnMgaW4gcG9wdXAgd2l0aG91dCBpbnZva2luZyBjbGlwYm9hcmQgZXZlbnQgaGFuZGxlcnMgb24gcGFyZW50IGVsZW1lbnQuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgfVxyXG4gICAgXSk7IiwiYW5ndWxhclxyXG4gICAgLm1vZHVsZShcIkxheW91dEVkaXRvclwiKVxyXG4gICAgLmRpcmVjdGl2ZShcIm9yY0xheW91dFRvb2xib3hcIiwgW1wiJGNvbXBpbGVcIiwgXCJlbnZpcm9ubWVudFwiLFxyXG4gICAgICAgIGZ1bmN0aW9uICgkY29tcGlsZSwgZW52aXJvbm1lbnQpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIHJlc3RyaWN0OiBcIkVcIixcclxuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFtcIiRzY29wZVwiLCBcIiRlbGVtZW50XCIsXHJcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKCRzY29wZSwgJGVsZW1lbnQpIHtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5yZXNldEVsZW1lbnRzID0gZnVuY3Rpb24gKCkge1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5ncmlkRWxlbWVudHMgPSBbXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0RWRpdG9yLkdyaWQuZnJvbSh7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hJY29uOiBcIlxcdWYwMGFcIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveExhYmVsOiBcIkdyaWRcIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveERlc2NyaXB0aW9uOiBcIkVtcHR5IGdyaWQuXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBbXVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5yb3dFbGVtZW50cyA9IFtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMYXlvdXRFZGl0b3IuUm93LmZyb20oe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94SWNvbjogXCJcXHVmMGM5XCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hMYWJlbDogXCJSb3cgKDEgY29sdW1uKVwiLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94RGVzY3JpcHRpb246IFwiUm93IHdpdGggMSBjb2x1bW4uXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBMYXlvdXRFZGl0b3IuQ29sdW1uLnRpbWVzKDEpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0RWRpdG9yLlJvdy5mcm9tKHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveEljb246IFwiXFx1ZjBjOVwiLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94TGFiZWw6IFwiUm93ICgyIGNvbHVtbnMpXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hEZXNjcmlwdGlvbjogXCJSb3cgd2l0aCAyIGNvbHVtbnMuXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBMYXlvdXRFZGl0b3IuQ29sdW1uLnRpbWVzKDIpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0RWRpdG9yLlJvdy5mcm9tKHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveEljb246IFwiXFx1ZjBjOVwiLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94TGFiZWw6IFwiUm93ICgzIGNvbHVtbnMpXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hEZXNjcmlwdGlvbjogXCJSb3cgd2l0aCAzIGNvbHVtbnMuXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBMYXlvdXRFZGl0b3IuQ29sdW1uLnRpbWVzKDMpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0RWRpdG9yLlJvdy5mcm9tKHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveEljb246IFwiXFx1ZjBjOVwiLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94TGFiZWw6IFwiUm93ICg0IGNvbHVtbnMpXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hEZXNjcmlwdGlvbjogXCJSb3cgd2l0aCA0IGNvbHVtbnMuXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBMYXlvdXRFZGl0b3IuQ29sdW1uLnRpbWVzKDQpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0RWRpdG9yLlJvdy5mcm9tKHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveEljb246IFwiXFx1ZjBjOVwiLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94TGFiZWw6IFwiUm93ICg2IGNvbHVtbnMpXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hEZXNjcmlwdGlvbjogXCJSb3cgd2l0aCA2IGNvbHVtbnMuXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBMYXlvdXRFZGl0b3IuQ29sdW1uLnRpbWVzKDYpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0RWRpdG9yLlJvdy5mcm9tKHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveEljb246IFwiXFx1ZjBjOVwiLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94TGFiZWw6IFwiUm93ICgxMiBjb2x1bW5zKVwiLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94RGVzY3JpcHRpb246IFwiUm93IHdpdGggMTIgY29sdW1ucy5cIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGRyZW46IExheW91dEVkaXRvci5Db2x1bW4udGltZXMoMTIpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksIExheW91dEVkaXRvci5Sb3cuZnJvbSh7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hJY29uOiBcIlxcdWYwYzlcIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveExhYmVsOiBcIlJvdyAoZW1wdHkpXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hEZXNjcmlwdGlvbjogXCJFbXB0eSByb3cuXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBbXVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5jb2x1bW5FbGVtZW50cyA9IFtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMYXlvdXRFZGl0b3IuQ29sdW1uLmZyb20oe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94SWNvbjogXCJcXHVmMGRiXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hMYWJlbDogXCJDb2x1bW5cIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveERlc2NyaXB0aW9uOiBcIkVtcHR5IGNvbHVtbi5cIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDEsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldDogMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGRyZW46IFtdXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF07XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmNvbnRlbnRFbGVtZW50Q2F0ZWdvcmllcyA9IF8oJHNjb3BlLmVsZW1lbnQuY29uZmlnLmNhdGVnb3JpZXMpLm1hcChmdW5jdGlvbiAoY2F0ZWdvcnkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBjYXRlZ29yeS5uYW1lLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50czogXyhjYXRlZ29yeS5jb250ZW50VHlwZXMpLm1hcChmdW5jdGlvbiAoY29udGVudFR5cGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0eXBlID0gY29udGVudFR5cGUudHlwZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmYWN0b3J5ID0gTGF5b3V0RWRpdG9yLmZhY3Rvcmllc1t0eXBlXSB8fCBMYXlvdXRFZGl0b3IuZmFjdG9yaWVzW1wiQ29udGVudFwiXTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpdGVtID0ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVGVtcGxhdGVkOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50VHlwZTogY29udGVudFR5cGUuaWQsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFR5cGVMYWJlbDogY29udGVudFR5cGUubGFiZWwsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFR5cGVDbGFzczogY29udGVudFR5cGUudHlwZUNsYXNzLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IG51bGwsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzRWRpdG9yOiBjb250ZW50VHlwZS5oYXNFZGl0b3IsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHRtbDogY29udGVudFR5cGUuaHRtbFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbGVtZW50ID0gZmFjdG9yeShpdGVtKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQudG9vbGJveEljb24gPSBjb250ZW50VHlwZS5pY29uIHx8IFwiXFx1ZjFjOVwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC50b29sYm94TGFiZWwgPSBjb250ZW50VHlwZS5sYWJlbDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQudG9vbGJveERlc2NyaXB0aW9uID0gY29udGVudFR5cGUuZGVzY3JpcHRpb247XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZWxlbWVudDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnJlc2V0RWxlbWVudHMoKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5nZXRTb3J0YWJsZU9wdGlvbnMgPSBmdW5jdGlvbiAodHlwZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVkaXRvcklkID0gJGVsZW1lbnQuY2xvc2VzdChcIi5sYXlvdXQtZWRpdG9yXCIpLmF0dHIoXCJpZFwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwYXJlbnRDbGFzc2VzO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBsYWNlaG9sZGVyQ2xhc3NlcztcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmbG9hdGluZyA9IGZhbHNlO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAodHlwZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJHcmlkXCI6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudENsYXNzZXMgPSBbXCIubGF5b3V0LWNhbnZhc1wiLCBcIi5sYXlvdXQtY29sdW1uXCIsIFwiLmxheW91dC1jb21tb24taG9sZGVyXCJdO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlckNsYXNzZXMgPSBcImxheW91dC1lbGVtZW50IGxheW91dC1jb250YWluZXIgbGF5b3V0LWdyaWQgdWktc29ydGFibGUtcGxhY2Vob2xkZXJcIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcIlJvd1wiOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRDbGFzc2VzID0gW1wiLmxheW91dC1ncmlkXCJdO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlckNsYXNzZXMgPSBcImxheW91dC1lbGVtZW50IGxheW91dC1jb250YWluZXIgbGF5b3V0LXJvdyByb3cgdWktc29ydGFibGUtcGxhY2Vob2xkZXJcIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcIkNvbHVtblwiOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRDbGFzc2VzID0gW1wiLmxheW91dC1yb3c6bm90KC5sYXlvdXQtcm93LWZ1bGwpXCJdO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlckNsYXNzZXMgPSBcImxheW91dC1lbGVtZW50IGxheW91dC1jb250YWluZXIgbGF5b3V0LWNvbHVtbiB1aS1zb3J0YWJsZS1wbGFjZWhvbGRlclwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdGluZyA9IHRydWU7IC8vIFRvIGVuc3VyZSBhIHNtb290aCBob3Jpem9udGFsLWxpc3QgcmVvcmRlcmluZy4gaHR0cHM6Ly9naXRodWIuY29tL2FuZ3VsYXItdWkvdWktc29ydGFibGUjZmxvYXRpbmdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcIkNvbnRlbnRcIjpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50Q2xhc3NlcyA9IFtcIi5sYXlvdXQtY2FudmFzXCIsIFwiLmxheW91dC1jb2x1bW5cIiwgXCIubGF5b3V0LWNvbW1vbi1ob2xkZXJcIl07XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyQ2xhc3NlcyA9IFwibGF5b3V0LWVsZW1lbnQgbGF5b3V0LWNvbnRlbnQgdWktc29ydGFibGUtcGxhY2Vob2xkZXJcIjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3I6IFwibW92ZVwiLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3RXaXRoOiBfKHBhcmVudENsYXNzZXMpLm1hcChmdW5jdGlvbiAoZSkgeyByZXR1cm4gXCIjXCIgKyBlZGl0b3JJZCArIFwiIFwiICsgZSArIFwiOm5vdCgubGF5b3V0LWNvbnRhaW5lci1zZWFsZWQpID4gLmxheW91dC1lbGVtZW50LXdyYXBwZXIgPiAubGF5b3V0LWNoaWxkcmVuXCI7IH0pLmpvaW4oXCIsIFwiKSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcjogcGxhY2Vob2xkZXJDbGFzc2VzLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwidWktZmxvYXRpbmdcIjogZmxvYXRpbmcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3JlYXRlOiBmdW5jdGlvbiAoZSwgdWkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS50YXJnZXQuaXNUb29sYm94ID0gdHJ1ZTsgLy8gV2lsbCBpbmRpY2F0ZSB0byBjb25uZWN0ZWQgc29ydGFibGVzIHRoYXQgZHJvcHBlZCBpdGVtcyB3ZXJlIHNlbnQgZnJvbSB0b29sYm94LlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IGZ1bmN0aW9uIChlLCB1aSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5lbGVtZW50LmlzRHJhZ2dpbmcgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3A6IGZ1bmN0aW9uIChlLCB1aSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5lbGVtZW50LmlzRHJhZ2dpbmcgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5yZXNldEVsZW1lbnRzKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcjogZnVuY3Rpb24gKGUsIHVpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVsZW1lbnQuY2FudmFzLnNldElzRHJvcFRhcmdldChmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGF5b3V0SXNDb2xsYXBzZWRDb29raWVOYW1lID0gXCJsYXlvdXRUb29sYm94Q2F0ZWdvcnlfTGF5b3V0X0lzQ29sbGFwc2VkXCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5sYXlvdXRJc0NvbGxhcHNlZCA9ICQuY29va2llKGxheW91dElzQ29sbGFwc2VkQ29va2llTmFtZSkgPT09IFwidHJ1ZVwiO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnRvZ2dsZUxheW91dElzQ29sbGFwc2VkID0gZnVuY3Rpb24gKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5sYXlvdXRJc0NvbGxhcHNlZCA9ICEkc2NvcGUubGF5b3V0SXNDb2xsYXBzZWQ7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkLmNvb2tpZShsYXlvdXRJc0NvbGxhcHNlZENvb2tpZU5hbWUsICRzY29wZS5sYXlvdXRJc0NvbGxhcHNlZCwgeyBleHBpcmVzOiAzNjUgfSk7IC8vIFJlbWVtYmVyIGNvbGxhcHNlZCBzdGF0ZSBmb3IgYSB5ZWFyLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6IGVudmlyb25tZW50LnRlbXBsYXRlVXJsKFwiVG9vbGJveFwiKSxcclxuICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsXHJcbiAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgdG9vbGJveCA9IGVsZW1lbnQuZmluZChcIi5sYXlvdXQtdG9vbGJveFwiKTtcclxuICAgICAgICAgICAgICAgICAgICAkKHdpbmRvdykub24oXCJyZXNpemUgc2Nyb2xsXCIsIGZ1bmN0aW9uIChlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjYW52YXMgPSBlbGVtZW50LnBhcmVudCgpLmZpbmQoXCIubGF5b3V0LWNhbnZhc1wiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIGNhbnZhcyBpcyB0YWxsZXIgdGhhbiB0aGUgdG9vbGJveCwgbWFrZSB0aGUgdG9vbGJveCBzdGlja3ktcG9zaXRpb25lZCB3aXRoaW4gdGhlIGVkaXRvclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB0byBoZWxwIHRoZSB1c2VyIGF2b2lkIGV4Y2Vzc2l2ZSB2ZXJ0aWNhbCBzY3JvbGxpbmcuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjYW52YXNJc1RhbGxlciA9ICEhY2FudmFzICYmIGNhbnZhcy5oZWlnaHQoKSA+IHRvb2xib3guaGVpZ2h0KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB3aW5kb3dQb3MgPSAkKHdpbmRvdykuc2Nyb2xsVG9wKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYW52YXNJc1RhbGxlciAmJiB3aW5kb3dQb3MgPiBlbGVtZW50Lm9mZnNldCgpLnRvcCArIGVsZW1lbnQuaGVpZ2h0KCkgLSB0b29sYm94LmhlaWdodCgpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94LmFkZENsYXNzKFwic3RpY2t5LWJvdHRvbVwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3gucmVtb3ZlQ2xhc3MoXCJzdGlja3ktdG9wXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGNhbnZhc0lzVGFsbGVyICYmIHdpbmRvd1BvcyA+IGVsZW1lbnQub2Zmc2V0KCkudG9wKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94LmFkZENsYXNzKFwic3RpY2t5LXRvcFwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3gucmVtb3ZlQ2xhc3MoXCJzdGlja3ktYm90dG9tXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveC5yZW1vdmVDbGFzcyhcInN0aWNreS10b3BcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94LnJlbW92ZUNsYXNzKFwic3RpY2t5LWJvdHRvbVwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgIH1cclxuICAgIF0pOyIsImFuZ3VsYXJcclxuICAgIC5tb2R1bGUoXCJMYXlvdXRFZGl0b3JcIilcclxuICAgIC5kaXJlY3RpdmUoXCJvcmNMYXlvdXRUb29sYm94R3JvdXBcIiwgW1wiJGNvbXBpbGVcIiwgXCJlbnZpcm9ubWVudFwiLFxyXG4gICAgICAgIGZ1bmN0aW9uICgkY29tcGlsZSwgZW52aXJvbm1lbnQpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIHJlc3RyaWN0OiBcIkVcIixcclxuICAgICAgICAgICAgICAgIHNjb3BlOiB7IGNhdGVnb3J5OiBcIj1cIiB9LFxyXG4gICAgICAgICAgICAgICAgY29udHJvbGxlcjogW1wiJHNjb3BlXCIsIFwiJGVsZW1lbnRcIixcclxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoJHNjb3BlLCAkZWxlbWVudCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXNDb2xsYXBzZWRDb29raWVOYW1lID0gXCJsYXlvdXRUb29sYm94Q2F0ZWdvcnlfXCIgKyAkc2NvcGUuY2F0ZWdvcnkubmFtZSArIFwiX0lzQ29sbGFwc2VkXCI7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5pc0NvbGxhcHNlZCA9ICQuY29va2llKGlzQ29sbGFwc2VkQ29va2llTmFtZSkgPT09IFwidHJ1ZVwiO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUudG9nZ2xlSXNDb2xsYXBzZWQgPSBmdW5jdGlvbiAoZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmlzQ29sbGFwc2VkID0gISRzY29wZS5pc0NvbGxhcHNlZDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQuY29va2llKGlzQ29sbGFwc2VkQ29va2llTmFtZSwgJHNjb3BlLmlzQ29sbGFwc2VkLCB7IGV4cGlyZXM6IDM2NSB9KTsgLy8gUmVtZW1iZXIgY29sbGFwc2VkIHN0YXRlIGZvciBhIHllYXIuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogZW52aXJvbm1lbnQudGVtcGxhdGVVcmwoXCJUb29sYm94R3JvdXBcIiksXHJcbiAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgfVxyXG4gICAgXSk7Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkxheW91dEVkaXRvci5qcyIsIk1vZHVsZS5qcyIsIkNsaXBib2FyZC5qcyIsIlNjb3BlQ29uZmlndXJhdG9yLmpzIiwiRWRpdG9yLmpzIiwiQ2FudmFzLmpzIiwiQ2hpbGQuanMiLCJDb2x1bW4uanMiLCJDb250ZW50LmpzIiwiR3JpZC5qcyIsIlJvdy5qcyIsIlBvcHVwLmpzIiwiVG9vbGJveC5qcyIsIlRvb2xib3hHcm91cC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsQUNMQTtBQ0FBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FDN0NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQ2xWQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUN6SUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUNsQkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FDZEE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQ25FQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQ3hCQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQ2xCQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FDbkJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FDdkNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQzlNQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJmaWxlIjoiTGF5b3V0RWRpdG9yLmpzIiwic291cmNlc0NvbnRlbnQiOltudWxsLCJhbmd1bGFyLm1vZHVsZShcIkxheW91dEVkaXRvclwiLCBbXCJuZ1Nhbml0aXplXCIsIFwibmdSZXNvdXJjZVwiLCBcInVpLnNvcnRhYmxlXCJdKTsiLCJ2YXIgTGF5b3V0RWRpdG9yO1xuKGZ1bmN0aW9uKExheW91dEVkaXRvcikge1xuXG4gICAgdmFyIENsaXBib2FyZCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICB0aGlzLl9jbGlwYm9hcmREYXRhID0ge307XG4gICAgICAgIHRoaXMuX2lzRGlzYWJsZWQgPSBmYWxzZTtcbiAgICAgICAgdGhpcy5fd2FzSW52b2tlZCA9IGZhbHNlO1xuXG4gICAgICAgIHRoaXMuc2V0RGF0YSA9IGZ1bmN0aW9uKGNvbnRlbnRUeXBlLCBkYXRhKSB7XG4gICAgICAgICAgICBzZWxmLl9jbGlwYm9hcmREYXRhW2NvbnRlbnRUeXBlXSA9IGRhdGE7XG4gICAgICAgICAgICBzZWxmLl93YXNJbnZva2VkID0gdHJ1ZTtcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5nZXREYXRhID0gZnVuY3Rpb24gKGNvbnRlbnRUeXBlKSB7XG4gICAgICAgICAgICByZXR1cm4gc2VsZi5fY2xpcGJvYXJkRGF0YVtjb250ZW50VHlwZV07XG4gICAgICAgICAgICBzZWxmLl93YXNJbnZva2VkID0gdHJ1ZTtcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5kaXNhYmxlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBzZWxmLl9pc0Rpc2FibGVkID0gdHJ1ZTtcbiAgICAgICAgICAgIHNlbGYuX3dhc0ludm9rZWQgPSBmYWxzZTtcbiAgICAgICAgICAgIHNlbGYuX2NsaXBib2FyZERhdGEgPSB7fTtcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5pc0Rpc2FibGVkID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHNlbGYuX2lzRGlzYWJsZWQ7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy53YXNJbnZva2VkID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHNlbGYuX3dhc0ludm9rZWQ7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBMYXlvdXRFZGl0b3IuQ2xpcGJvYXJkID0gbmV3IENsaXBib2FyZCgpO1xuXG4gICAgYW5ndWxhclxuICAgICAgICAubW9kdWxlKFwiTGF5b3V0RWRpdG9yXCIpXG4gICAgICAgIC5mYWN0b3J5KFwiY2xpcGJvYXJkXCIsIFtcbiAgICAgICAgICAgIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIHNldERhdGE6IExheW91dEVkaXRvci5DbGlwYm9hcmQuc2V0RGF0YSxcbiAgICAgICAgICAgICAgICAgICAgZ2V0RGF0YTogTGF5b3V0RWRpdG9yLkNsaXBib2FyZC5nZXREYXRhLFxuICAgICAgICAgICAgICAgICAgICBkaXNhYmxlOiBMYXlvdXRFZGl0b3IuQ2xpcGJvYXJkLmRpc2FibGUsXG4gICAgICAgICAgICAgICAgICAgIGlzRGlzYWJsZWQ6IExheW91dEVkaXRvci5DbGlwYm9hcmQuaXNEaXNhYmxlZCxcbiAgICAgICAgICAgICAgICAgICAgd2FzSW52b2tlZDogTGF5b3V0RWRpdG9yLkNsaXBib2FyZC53YXNJbnZva2VkXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgXSk7XG59KShMYXlvdXRFZGl0b3IgfHwgKExheW91dEVkaXRvciA9IHt9KSk7IiwiYW5ndWxhclxyXG4gICAgLm1vZHVsZShcIkxheW91dEVkaXRvclwiKVxyXG4gICAgLmZhY3RvcnkoXCJzY29wZUNvbmZpZ3VyYXRvclwiLCBbXCIkdGltZW91dFwiLCBcImNsaXBib2FyZFwiLFxyXG4gICAgICAgIGZ1bmN0aW9uICgkdGltZW91dCwgY2xpcGJvYXJkKSB7XHJcbiAgICAgICAgICAgIHJldHVybiB7XHJcblxyXG4gICAgICAgICAgICAgICAgY29uZmlndXJlRm9yRWxlbWVudDogZnVuY3Rpb24gKCRzY29wZSwgJGVsZW1lbnQpIHtcclxuICAgICAgICAgICAgICAgIFxyXG4gICAgICAgICAgICAgICAgICAgICRlbGVtZW50LmZpbmQoXCIubGF5b3V0LXBhbmVsXCIpLmNsaWNrKGZ1bmN0aW9uIChlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICRlbGVtZW50LnBhcmVudCgpLmtleWRvd24oZnVuY3Rpb24gKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhhbmRsZWQgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlc2V0Rm9jdXMgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsZW1lbnQgPSAkc2NvcGUuZWxlbWVudDtcclxuICAgICAgICAgICAgICAgICAgICBcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1lbnQuZWRpdG9yLmlzRHJhZ2dpbmcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiBuYXRpdmUgY2xpcGJvYXJkIHN1cHBvcnQgZXhpc3RzLCB0aGUgcHNldWRvLWNsaXBib2FyZCB3aWxsIGhhdmUgYmVlbiBkaXNhYmxlZC5cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjbGlwYm9hcmQuaXNEaXNhYmxlZCgpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZm9jdXNlZEVsZW1lbnQgPSBlbGVtZW50LmVkaXRvci5mb2N1c2VkRWxlbWVudDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghIWZvY3VzZWRFbGVtZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUHNldWRvIGNsaXBib2FyZCBoYW5kbGluZyBmb3IgYnJvd3NlcnMgbm90IGFsbG93aW5nIHJlYWwgY2xpcGJvYXJkIG9wZXJhdGlvbnMuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuY3RybEtleSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGUud2hpY2gpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA2NzogLy8gQ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9jdXNlZEVsZW1lbnQuY29weShjbGlwYm9hcmQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgODg6IC8vIFhcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvY3VzZWRFbGVtZW50LmN1dChjbGlwYm9hcmQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgODY6IC8vIFZcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvY3VzZWRFbGVtZW50LnBhc3RlKGNsaXBib2FyZCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmN0cmxLZXkgJiYgIWUuc2hpZnRLZXkgJiYgIWUuYWx0S2V5ICYmIGUud2hpY2ggPT0gNDYpIHsgLy8gRGVsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZGVsZXRlKGVsZW1lbnQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIWUuY3RybEtleSAmJiAhZS5zaGlmdEtleSAmJiAhZS5hbHRLZXkgJiYgKGUud2hpY2ggPT0gMzIgfHwgZS53aGljaCA9PSAyNykpIHsgLy8gU3BhY2Ugb3IgRXNjXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZWxlbWVudC5maW5kKFwiLmxheW91dC1wYW5lbC1hY3Rpb24tcHJvcGVydGllc1wiKS5maXJzdCgpLmNsaWNrKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1lbnQudHlwZSA9PSBcIkNvbnRlbnRcIikgeyAvLyBUaGlzIGlzIGEgY29udGVudCBlbGVtZW50LlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlLmN0cmxLZXkgJiYgIWUuc2hpZnRLZXkgJiYgIWUuYWx0S2V5ICYmIGUud2hpY2ggPT0gMTMpIHsgLy8gRW50ZXJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZWxlbWVudC5maW5kKFwiLmxheW91dC1wYW5lbC1hY3Rpb24tZWRpdFwiKS5maXJzdCgpLmNsaWNrKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghIWVsZW1lbnQuY2hpbGRyZW4pIHsgLy8gVGhpcyBpcyBhIGNvbnRhaW5lci5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZS5jdHJsS2V5ICYmICFlLnNoaWZ0S2V5ICYmIGUuYWx0S2V5ICYmIGUud2hpY2ggPT0gNDApIHsgLy8gQWx0K0Rvd25cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbWVudC5jaGlsZHJlbi5sZW5ndGggPiAwKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmNoaWxkcmVuWzBdLnNldElzRm9jdXNlZCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtZW50LnR5cGUgPT0gXCJDb2x1bW5cIikgeyAvLyBUaGlzIGlzIGEgY29sdW1uLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb25uZWN0QWRqYWNlbnQgPSAhZS5jdHJsS2V5O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLndoaWNoID09IDM3KSB7IC8vIExlZnRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuYWx0S2V5KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5leHBhbmRMZWZ0KGNvbm5lY3RBZGphY2VudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLnNoaWZ0S2V5KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5jb250cmFjdFJpZ2h0KGNvbm5lY3RBZGphY2VudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS53aGljaCA9PSAzOSkgeyAvLyBSaWdodFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5hbHRLZXkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmNvbnRyYWN0TGVmdChjb25uZWN0QWRqYWNlbnQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5zaGlmdEtleSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuZXhwYW5kUmlnaHQoY29ubmVjdEFkamFjZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoISFlbGVtZW50LnBhcmVudCkgeyAvLyBUaGlzIGlzIGEgY2hpbGQuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5hbHRLZXkgJiYgZS53aGljaCA9PSAzOCkgeyAvLyBBbHQrVXBcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudC5zZXRJc0ZvY3VzZWQoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbWVudC5wYXJlbnQudHlwZSA9PSBcIlJvd1wiKSB7IC8vIFBhcmVudCBpcyBhIGhvcml6b250YWwgY29udGFpbmVyLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZS5jdHJsS2V5ICYmICFlLnNoaWZ0S2V5ICYmICFlLmFsdEtleSAmJiBlLndoaWNoID09IDM3KSB7IC8vIExlZnRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQubW92ZUZvY3VzUHJldkNoaWxkKGVsZW1lbnQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIWUuY3RybEtleSAmJiAhZS5zaGlmdEtleSAmJiAhZS5hbHRLZXkgJiYgZS53aGljaCA9PSAzOSkgeyAvLyBSaWdodFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudC5tb3ZlRm9jdXNOZXh0Q2hpbGQoZWxlbWVudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChlLmN0cmxLZXkgJiYgIWUuc2hpZnRLZXkgJiYgIWUuYWx0S2V5ICYmIGUud2hpY2ggPT0gMzcpIHsgLy8gQ3RybCtMZWZ0XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQubW92ZVVwKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc2V0Rm9jdXMgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZS5jdHJsS2V5ICYmICFlLnNoaWZ0S2V5ICYmICFlLmFsdEtleSAmJiBlLndoaWNoID09IDM5KSB7IC8vIEN0cmwrUmlnaHRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5tb3ZlRG93bigpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsgLy8gUGFyZW50IGlzIGEgdmVydGljYWwgY29udGFpbmVyLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZS5jdHJsS2V5ICYmICFlLnNoaWZ0S2V5ICYmICFlLmFsdEtleSAmJiBlLndoaWNoID09IDM4KSB7IC8vIFVwXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50Lm1vdmVGb2N1c1ByZXZDaGlsZChlbGVtZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFlLmN0cmxLZXkgJiYgIWUuc2hpZnRLZXkgJiYgIWUuYWx0S2V5ICYmIGUud2hpY2ggPT0gNDApIHsgLy8gRG93blxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudC5tb3ZlRm9jdXNOZXh0Q2hpbGQoZWxlbWVudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChlLmN0cmxLZXkgJiYgIWUuc2hpZnRLZXkgJiYgIWUuYWx0S2V5ICYmIGUud2hpY2ggPT0gMzgpIHsgLy8gQ3RybCtVcFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50Lm1vdmVVcCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNldEZvY3VzID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGUuY3RybEtleSAmJiAhZS5zaGlmdEtleSAmJiAhZS5hbHRLZXkgJiYgZS53aGljaCA9PSA0MCkgeyAvLyBDdHJsK0Rvd25cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5tb3ZlRG93bigpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoYW5kbGVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KCk7IC8vIEV2ZW50IGlzIG5vdCB0cmlnZ2VyZWQgYnkgQW5ndWxhciBkaXJlY3RpdmUgYnV0IHJhdyBldmVudCBoYW5kbGVyIG9uIGVsZW1lbnQuXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBIQUNLOiBXb3JrYXJvdW5kIGJlY2F1c2Ugb2YgaG93IEFuZ3VsYXIgdHJlYXRzIHRoZSBET00gd2hlbiBlbGVtZW50cyBhcmUgc2hpZnRlZCBhcm91bmQgLSBpbnB1dCBmb2N1cyBpcyBzb21ldGltZXMgbG9zdC5cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc2V0Rm9jdXMpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5zZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5lZGl0b3IuZm9jdXNlZEVsZW1lbnQuc2V0SXNGb2N1c2VkKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDApO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICRzY29wZS5lbGVtZW50LnNldElzRm9jdXNlZEV2ZW50SGFuZGxlcnMucHVzaChmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICRlbGVtZW50LnBhcmVudCgpLmZvY3VzKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICRzY29wZS5kZWxldGUgPSBmdW5jdGlvbiAoZWxlbWVudCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmRlbGV0ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCRzY29wZS5lbGVtZW50Lmhhc0VkaXRvcikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZWRpdCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kcm9vdC5lZGl0RWxlbWVudCgkc2NvcGUuZWxlbWVudCkudGhlbihmdW5jdGlvbiAoYXJncykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJncy5jYW5jZWwpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZWxlbWVudC5kYXRhID0gYXJncy5lbGVtZW50LmRhdGE7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5lbGVtZW50LmFwcGx5RWxlbWVudEVkaXRvck1vZGVsKGFyZ3MuZWxlbWVudEVkaXRvck1vZGVsKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghISRzY29wZS5lbGVtZW50LnNldEh0bWwpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZWxlbWVudC5zZXRIdG1sKGFyZ3MuZWxlbWVudC5odG1sKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0sXHJcblxyXG4gICAgICAgICAgICAgICAgY29uZmlndXJlRm9yQ29udGFpbmVyOiBmdW5jdGlvbiAoJHNjb3BlLCAkZWxlbWVudCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciBlbGVtZW50ID0gJHNjb3BlLmVsZW1lbnQ7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgIC8vJHNjb3BlLmlzUmVjZWl2aW5nID0gZmFsc2U7IC8vIFRydWUgd2hlbiBjb250YWluZXIgaXMgcmVjZWl2aW5nIGFuIGV4dGVybmFsIGVsZW1lbnQgdmlhIGRyYWcvZHJvcC5cclxuICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZ2V0U2hvd0NoaWxkcmVuUGxhY2Vob2xkZXIgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkc2NvcGUuZWxlbWVudC5jaGlsZHJlbi5sZW5ndGggPT09IDAgJiYgISRzY29wZS5lbGVtZW50LmdldElzRHJvcFRhcmdldCgpO1xyXG4gICAgICAgICAgICAgICAgICAgIH07XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICRzY29wZS5zb3J0YWJsZU9wdGlvbnMgPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcjogXCJtb3ZlXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGF5OiAxNTAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkOiBlbGVtZW50LmdldElzU2VhbGVkKCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3RhbmNlOiA1LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2hhbmRsZTogZWxlbWVudC5jaGlsZHJlbi5sZW5ndGggPCAyID8gXCIuaW1hZ2luYXJ5LWNsYXNzXCIgOiBmYWxzZSwgLy8gRm9yIHNvbWUgcmVhc29uIGRvZXNuJ3QgZ2V0IHJlLWV2YWx1YXRlZCBhZnRlciBhZGRpbmcgbW9yZSBjaGlsZHJlbi5cclxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IGZ1bmN0aW9uIChlLCB1aSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5zZXRJc0Ryb3BUYXJnZXQodHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5lZGl0b3IuaXNEcmFnZ2luZyA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1ha2UgdGhlIGRyb3AgdGFyZ2V0IHBsYWNlaG9sZGVyIGFzIGhpZ2ggYXMgdGhlIGl0ZW0gYmVpbmcgZHJhZ2dlZC5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpLnBsYWNlaG9sZGVyLmhlaWdodCh1aS5pdGVtLmhlaWdodCgpIC0gNCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aS5wbGFjZWhvbGRlci5jc3MoXCJtaW4taGVpZ2h0XCIsIDApO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9wOiBmdW5jdGlvbiAoZSwgdWkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuZWRpdG9yLmlzRHJhZ2dpbmcgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnNldElzRHJvcFRhcmdldChmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcjogZnVuY3Rpb24gKGUsIHVpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISF1aS5zZW5kZXIgJiYgISF1aS5zZW5kZXJbMF0uaXNUb29sYm94KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEhdWkuc2VuZGVyWzBdLmRyb3BUYXJnZXRUaW1lb3V0KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbCh1aS5zZW5kZXJbMF0uZHJvcFRhcmdldFRpbWVvdXQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aS5zZW5kZXJbMF0uZHJvcFRhcmdldFRpbWVvdXQgPSBudWxsO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtZW50LnR5cGUgPT0gXCJSb3dcIikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlcmUgd2FzIGEgcHJldmlvdXMgZHJvcCB0YXJnZXQgYW5kIGl0IHdhcyBhIHJvdywgcm9sbCBiYWNrIGFueSBwZW5kaW5nIGNvbHVtbiBhZGRzIHRvIGl0LlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByZXZpb3VzRHJvcFRhcmdldCA9IGVsZW1lbnQuZWRpdG9yLmRyb3BUYXJnZXRFbGVtZW50O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEhcHJldmlvdXNEcm9wVGFyZ2V0ICYmIHByZXZpb3VzRHJvcFRhcmdldC50eXBlID09IFwiUm93XCIpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNEcm9wVGFyZ2V0LnJvbGxiYWNrQWRkQ29sdW1uKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5zZXRJc0Ryb3BUYXJnZXQoZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpLnNlbmRlclswXS5kcm9wVGFyZ2V0VGltZW91dCA9ICR0aW1lb3V0KGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1lbnQudHlwZSA9PSBcIlJvd1wiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVjZWl2ZWRDb2x1bW4gPSB1aS5pdGVtLnNvcnRhYmxlLm1vZGVsO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlY2VpdmVkQ29sdW1uV2lkdGggPSBNYXRoLmZsb29yKDEyIC8gKGVsZW1lbnQuY2hpbGRyZW4ubGVuZ3RoICsgMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZWRDb2x1bW4ud2lkdGggPSByZWNlaXZlZENvbHVtbldpZHRoO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZWRDb2x1bW4ub2Zmc2V0ID0gMDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmVnaW5BZGRDb2x1bW4ocmVjZWl2ZWRDb2x1bW5XaWR0aCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBNYWtlIHRoZSBkcm9wIHRhcmdldCBwbGFjZWhvbGRlciB0aGUgY29ycmVjdCB3aWR0aCBhbmQgYXMgaGlnaCBhcyB0aGUgaGlnaGVzdCBleGlzdGluZyBjb2x1bW4gaW4gdGhlIHJvdy5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtYXhIZWlnaHQgPSBfLm1heChfKCRlbGVtZW50LmZpbmQoXCI+IC5sYXlvdXQtY2hpbGRyZW4gPiAubGF5b3V0LWNvbHVtbjpub3QoLnVpLXNvcnRhYmxlLXBsYWNlaG9sZGVyKVwiKSkubWFwKGZ1bmN0aW9uIChlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoZSkuaGVpZ2h0KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAxOyBpIDw9IDEyOyBpKyspXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWkucGxhY2Vob2xkZXIucmVtb3ZlQ2xhc3MoXCJjb2wteHMtXCIgKyBpKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpLnBsYWNlaG9sZGVyLmFkZENsYXNzKFwiY29sLXhzLVwiICsgcmVjZWl2ZWRDb2x1bW4ud2lkdGgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1heEhlaWdodCA+IDApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aS5wbGFjZWhvbGRlci5oZWlnaHQobWF4SGVpZ2h0KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aS5wbGFjZWhvbGRlci5jc3MoXCJtaW4taGVpZ2h0XCIsIDApO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWkucGxhY2Vob2xkZXIuaGVpZ2h0KDApO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpLnBsYWNlaG9sZGVyLmNzcyhcIm1pbi1oZWlnaHRcIiwgXCJcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5zZXRJc0Ryb3BUYXJnZXQodHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTUwKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZTogZnVuY3Rpb24gKGUsIHVpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISF1aS5zZW5kZXIgJiYgISF1aS5zZW5kZXJbMF0uaXNUb29sYm94KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZWNlaXZlZEVsZW1lbnQgPSB1aS5pdGVtLnNvcnRhYmxlLm1vZGVsO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISFyZWNlaXZlZEVsZW1lbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtZW50LnR5cGUgPT0gXCJSb3dcIilcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmNvbW1pdEFkZENvbHVtbigpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2hvdWxkIGlkZWFsbHkgY2FsbCBMYXlvdXRFZGl0b3IuQ29udGFpbmVyLmFkZENoaWxkKCkgaW5zdGVhZCwgYnV0IHNpbmNlIHRoaXMgaGFuZGxlclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaXMgcnVuICpiZWZvcmUqIHRoZSB1aS1zb3J0YWJsZSBkaXJlY3RpdmUncyBoYW5kbGVyLCBpZiB3ZSB0cnkgdG8gYWRkIHRoZSBjaGlsZCB0byB0aGVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFycmF5IHRoYXQgaGFuZGxlciB3aWxsIGdldCBhbiBleGNlcHRpb24gd2hlbiB0cnlpbmcgdG8gZG8gdGhlIHNhbWUuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBCZWNhdXNlIG9mIHRoaXMsIHdlIG5lZWQgdG8gaW52b2tlIFwic2V0UGFyZW50XCIgc28gdGhhdCBzcGVjaWZpYyBjb250YWluZXIgdHlwZXMgY2FuIHBlcmZvcm0gZWxlbWVudCBzcGVmaWNpYyBpbml0aWFsaXphdGlvbi5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY2VpdmVkRWxlbWVudC5zZXRFZGl0b3IoZWxlbWVudC5lZGl0b3IpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZWRFbGVtZW50LnNldFBhcmVudChlbGVtZW50KTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISFyZWNlaXZlZEVsZW1lbnQuaGFzRWRpdG9yKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRyb290LmVkaXRFbGVtZW50KHJlY2VpdmVkRWxlbWVudCkudGhlbihmdW5jdGlvbiAoYXJncykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWFyZ3MuY2FuY2VsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNlaXZlZEVsZW1lbnQuZGF0YSA9IGFyZ3MuZWxlbWVudC5kYXRhO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZWRFbGVtZW50LmFwcGx5RWxlbWVudEVkaXRvck1vZGVsKGFyZ3MuZWxlbWVudEVkaXRvck1vZGVsKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISFyZWNlaXZlZEVsZW1lbnQuc2V0SHRtbClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNlaXZlZEVsZW1lbnQuc2V0SHRtbChhcmdzLmVsZW1lbnQuaHRtbCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEhYXJncy5jYW5jZWwpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZWRFbGVtZW50LmRlbGV0ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY2VpdmVkRWxlbWVudC5zZXRJc0ZvY3VzZWQoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vJHNjb3BlLmlzUmVjZWl2aW5nID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnNldElzRHJvcFRhcmdldChmYWxzZSk7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vJHNjb3BlLmlzUmVjZWl2aW5nID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnNldElzRHJvcFRhcmdldChmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISFyZWNlaXZlZEVsZW1lbnQpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjZWl2ZWRFbGVtZW50LnNldElzRm9jdXNlZCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH07XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICRzY29wZS5jbGljayA9IGZ1bmN0aW9uIChjaGlsZCwgZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNoaWxkLmVkaXRvci5pc0RyYWdnaW5nKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGQuc2V0SXNGb2N1c2VkKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmdldENsYXNzZXMgPSBmdW5jdGlvbiAoY2hpbGQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdCA9IFtcImxheW91dC1lbGVtZW50XCJdO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEhY2hpbGQuY2hpbGRyZW4pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKFwibGF5b3V0LWNvbnRhaW5lclwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaGlsZC5nZXRJc1NlYWxlZCgpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKFwibGF5b3V0LWNvbnRhaW5lci1zZWFsZWRcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKFwibGF5b3V0LVwiICsgY2hpbGQudHlwZS50b0xvd2VyQ2FzZSgpKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghIWNoaWxkLmRyb3BUYXJnZXRDbGFzcylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKGNoaWxkLmRyb3BUYXJnZXRDbGFzcyk7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBNb3ZlIHRoZXNlIHRvIGVpdGhlciB0aGUgQ29sdW1uIGRpcmVjdGl2ZSBvciB0aGUgQ29sdW1uIG1vZGVsIGNsYXNzLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGQudHlwZSA9PSBcIlJvd1wiKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcInJvd1wiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY2hpbGQuY2FuQWRkQ29sdW1uKCkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJsYXlvdXQtcm93LWZ1bGxcIik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkLnR5cGUgPT0gXCJDb2x1bW5cIikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJjb2wteHMtXCIgKyBjaGlsZC53aWR0aCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcImNvbC14cy1vZmZzZXQtXCIgKyBjaGlsZC5vZmZzZXQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaGlsZC50eXBlID09IFwiQ29udGVudFwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJsYXlvdXQtY29udGVudC1cIiArIGNoaWxkLmNvbnRlbnRUeXBlQ2xhc3MpO1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkLmdldElzQWN0aXZlKCkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcImxheW91dC1lbGVtZW50LWFjdGl2ZVwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkLmdldElzRm9jdXNlZCgpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJsYXlvdXQtZWxlbWVudC1mb2N1c2VkXCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGQuZ2V0SXNTZWxlY3RlZCgpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJsYXlvdXQtZWxlbWVudC1zZWxlY3RlZFwiKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkLmdldElzRHJvcFRhcmdldCgpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJsYXlvdXQtZWxlbWVudC1kcm9wdGFyZ2V0XCIpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGQuaXNUZW1wbGF0ZWQpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcImxheW91dC1lbGVtZW50LXRlbXBsYXRlZFwiKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XHJcbiAgICAgICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfTtcclxuICAgICAgICB9XHJcbiAgICBdKTsiLCJhbmd1bGFyXG4gICAgLm1vZHVsZShcIkxheW91dEVkaXRvclwiKVxuICAgIC5kaXJlY3RpdmUoXCJvcmNMYXlvdXRFZGl0b3JcIiwgW1wiZW52aXJvbm1lbnRcIixcbiAgICAgICAgZnVuY3Rpb24gKGVudmlyb25tZW50KSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHJlc3RyaWN0OiBcIkVcIixcbiAgICAgICAgICAgICAgICBzY29wZToge30sXG4gICAgICAgICAgICAgICAgY29udHJvbGxlcjogW1wiJHNjb3BlXCIsIFwiJGVsZW1lbnRcIiwgXCIkYXR0cnNcIiwgXCIkY29tcGlsZVwiLCBcImNsaXBib2FyZFwiLFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoJHNjb3BlLCAkZWxlbWVudCwgJGF0dHJzLCAkY29tcGlsZSwgY2xpcGJvYXJkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoISEkYXR0cnMubW9kZWwpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVsZW1lbnQgPSBldmFsKCRhdHRycy5tb2RlbCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiVGhlICdtb2RlbCcgYXR0cmlidXRlIG11c3QgZXZhbHVhdGUgdG8gYSBMYXlvdXRFZGl0b3IuRWRpdG9yIG9iamVjdC5cIik7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5jbGljayA9IGZ1bmN0aW9uIChjYW52YXMsIGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNhbnZhcy5lZGl0b3IuaXNEcmFnZ2luZylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FudmFzLnNldElzRm9jdXNlZCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZ2V0Q2xhc3NlcyA9IGZ1bmN0aW9uIChjYW52YXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzdWx0ID0gW1wibGF5b3V0LWVsZW1lbnRcIiwgXCJsYXlvdXQtY29udGFpbmVyXCIsIFwibGF5b3V0LWNhbnZhc1wiXTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYW52YXMuZ2V0SXNBY3RpdmUoKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJsYXlvdXQtZWxlbWVudC1hY3RpdmVcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNhbnZhcy5nZXRJc0ZvY3VzZWQoKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goXCJsYXlvdXQtZWxlbWVudC1mb2N1c2VkXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYW52YXMuZ2V0SXNTZWxlY3RlZCgpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcImxheW91dC1lbGVtZW50LXNlbGVjdGVkXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYW52YXMuZ2V0SXNEcm9wVGFyZ2V0KCkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKFwibGF5b3V0LWVsZW1lbnQtZHJvcHRhcmdldFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2FudmFzLmlzVGVtcGxhdGVkKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcImxheW91dC1lbGVtZW50LXRlbXBsYXRlZFwiKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBBbiB1bmZvcnR1bmF0ZSBzaWRlLWVmZmVjdCBvZiB0aGUgbmV4dCBoYWNrIG9uIGxpbmUgNTQgaXMgdGhhdCB0aGUgY3JlYXRlZCBlbGVtZW50cyBhcmVuJ3QgYWRkZWQgdG8gdGhlIERPTSB5ZXQsIHNvIHdlIGNhbid0IHVzZSBpdCB0byBnZXQgdG8gdGhlIHBhcmVudCBcIi5sYXlvdXQtZGVzaWdlclwiIGVsZW1lbnQuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBXb3JrIGFyb3VuZDogYWNjZXNzIHRoYXQgZWxlbWVudCBkaXJlY3RseSAod2hpY2ggZWZlY3RpdmVseSB0dXJucyBtdWx0aXBsZSBsYXlvdXQgZWRpdG9ycyBvbiBhIHNpbmdsZSBwYWdlIGltcG9zc2libGUpLiBcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIC8vdmFyIGxheW91dERlc2lnbmVySG9zdCA9ICRlbGVtZW50LmNsb3Nlc3QoXCIubGF5b3V0LWRlc2lnbmVyXCIpLmRhdGEoXCJsYXlvdXQtZGVzaWduZXItaG9zdFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsYXlvdXREZXNpZ25lckhvc3QgPSAkKFwiLmxheW91dC1kZXNpZ25lclwiKS5kYXRhKFwibGF5b3V0LWRlc2lnbmVyLWhvc3RcIik7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kcm9vdC5sYXlvdXREZXNpZ25lckhvc3QgPSBsYXlvdXREZXNpZ25lckhvc3Q7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGxheW91dERlc2lnbmVySG9zdC5lbGVtZW50Lm9uKFwicmVwbGFjZWNhbnZhc1wiLCBmdW5jdGlvbiAoZSwgYXJncykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlZGl0b3IgPSAkc2NvcGUuZWxlbWVudDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2FudmFzRGF0YSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogYXJncy5jYW52YXMuZGF0YSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHRtbElkOiBhcmdzLmNhbnZhcy5odG1sSWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGh0bWxDbGFzczogYXJncy5jYW52YXMuaHRtbENsYXNzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBodG1sU3R5bGU6IGFyZ3MuY2FudmFzLmh0bWxTdHlsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNUZW1wbGF0ZWQ6IGFyZ3MuY2FudmFzLmlzVGVtcGxhdGVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZHJlbjogYXJncy5jYW52YXMuY2hpbGRyZW5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSEFDSzogSW5zdGVhZCBvZiBzaW1wbHkgdXBkYXRpbmcgdGhlICRzY29wZS5lbGVtZW50IHdpdGggYSBuZXcgaW5zdGFuY2UsIHdlIG5lZWQgdG8gcmVwbGFjZSB0aGUgZW50aXJlIG9yYy1sYXlvdXQtZWRpdG9yIG1hcmt1cFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGluIG9yZGVyIGZvciBhbmd1bGFyIHRvIHJlYmluZCBzdGFydGluZyB3aXRoIHRoZSBDYW52YXMgZWxlbWVudC4gT3RoZXJ3aXNlLCBmb3Igc29tZSByZWFzb24sIGl0IHdpbGwgcmViaW5kIHN0YXJ0aW5nIHdpdGggdGhlIGZpcnN0IGNoaWxkIG9mIENhbnZhcy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBZb3UgY2FuIHNlZSB0aGlzIGhhcHBlbmluZyB3aGVuIHNldHRpbmcgYSBicmVha3BvaW50IGluIFNjb3BlQ29uZmlndXJhdG9yIHdoZXJlIGNvbnRhaW5lcnMgYXJlIGluaXRpYWxpemVkIHdpdGggZHJhZyAmIGRyb3A6IG9uIHBhZ2UgbG9hZCwgdGhlIGZpcnN0IGVsZW1lbnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpcyBhIENhbnZhcyAoZ29vZCksIGJ1dCBhZnRlciBoYXZpbmcgc2VsZWN0ZWQgYW5vdGhlciB0ZW1wbGF0ZSwgdGhlIGZpcnN0IGVsZW1lbnQgaXMgKHR5cGljYWxseSkgYSBHcmlkIChiYWQpLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNpbXBseSByZWNvbXBpbGluZyB0aGUgb3JjLWxheW91dC1lZGl0b3IgZGlyZWN0aXZlIHdpbGwgY2F1c2UgdGhlIGVudGlyZSB0aGluZyB0byBiZSBnZW5lcmF0ZWQsIHdoaWNoIHdvcmtzIGp1c3QgZmluZSBhcyB3ZWxsIChldmVuIHRob3VnaCBub3QgaXMgbmljZSBhcyBzaW1wbHkgbGV2ZXJhZ2luZyBtb2RlbCBiaW5kaW5nKS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXlvdXREZXNpZ25lckhvc3QuZWRpdG9yID0gd2luZG93LmxheW91dEVkaXRvciA9IG5ldyBMYXlvdXRFZGl0b3IuRWRpdG9yKGVkaXRvci5jb25maWcsIGNhbnZhc0RhdGEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ZW1wbGF0ZSA9IFwiPG9yYy1sYXlvdXQtZWRpdG9yXCIgKyBcIiBtb2RlbD0nd2luZG93LmxheW91dEVkaXRvcicgLz5cIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9ICRjb21waWxlKHRlbXBsYXRlKSgkc2NvcGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQoXCIubGF5b3V0LWVkaXRvci1ob2xkZXJcIikuaHRtbChodG1sKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJHJvb3QuZWRpdEVsZW1lbnQgPSBmdW5jdGlvbiAoZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBob3N0ID0gJHNjb3BlLiRyb290LmxheW91dERlc2lnbmVySG9zdDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaG9zdC5lZGl0RWxlbWVudChlbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kcm9vdC5hZGRFbGVtZW50ID0gZnVuY3Rpb24gKGNvbnRlbnRUeXBlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhvc3QgPSAkc2NvcGUuJHJvb3QubGF5b3V0RGVzaWduZXJIb3N0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBob3N0LmFkZEVsZW1lbnQoY29udGVudFR5cGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgJChkb2N1bWVudCkub24oXCJjdXQgY29weSBwYXN0ZVwiLCBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBwc2V1ZG8gY2xpcGJvYXJkIHdhcyBhbHJlYWR5IGludm9rZWQgKHdoaWNoIGhhcHBlbnMgb24gdGhlIGZpcnN0IGNsaXBib2FyZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9wZXJhdGlvbiBhZnRlciBwYWdlIGxvYWQgZXZlbiBpZiBuYXRpdmUgY2xpcGJvYXJkIHN1cHBvcnQgZXhpc3RzKSB0aGVuIHNpdCB0aGlzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb25lIG9wZXJhdGlvbiBvdXQsIGJ1dCBtYWtlIHN1cmUgd2hhdGV2ZXIgaXMgb24gdGhlIHBzZXVkbyBjbGlwYm9hcmQgZ2V0cyBtaWdyYXRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRvIHRoZSBuYXRpdmUgY2xpcGJvYXJkIGZvciBzdWJzZXF1ZW50IG9wZXJhdGlvbnMuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNsaXBib2FyZC53YXNJbnZva2VkKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5vcmlnaW5hbEV2ZW50LmNsaXBib2FyZERhdGEuc2V0RGF0YShcInRleHQvcGxhaW5cIiwgY2xpcGJvYXJkLmdldERhdGEoXCJ0ZXh0L3BsYWluXCIpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5vcmlnaW5hbEV2ZW50LmNsaXBib2FyZERhdGEuc2V0RGF0YShcInRleHQvanNvblwiLCBjbGlwYm9hcmQuZ2V0RGF0YShcInRleHQvanNvblwiKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmb2N1c2VkRWxlbWVudCA9ICRzY29wZS5lbGVtZW50LmZvY3VzZWRFbGVtZW50O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISFmb2N1c2VkRWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChlLnR5cGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcImNvcHlcIjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvY3VzZWRFbGVtZW50LmNvcHkoZS5vcmlnaW5hbEV2ZW50LmNsaXBib2FyZERhdGEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXCJjdXRcIjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvY3VzZWRFbGVtZW50LmN1dChlLm9yaWdpbmFsRXZlbnQuY2xpcGJvYXJkRGF0YSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcInBhc3RlXCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2N1c2VkRWxlbWVudC5wYXN0ZShlLm9yaWdpbmFsRXZlbnQuY2xpcGJvYXJkRGF0YSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSEFDSzogV29ya2Fyb3VuZCBiZWNhdXNlIG9mIGhvdyBBbmd1bGFyIHRyZWF0cyB0aGUgRE9NIHdoZW4gZWxlbWVudHMgYXJlIHNoaWZ0ZWQgYXJvdW5kIC0gaW5wdXQgZm9jdXMgaXMgc29tZXRpbWVzIGxvc3QuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuc2V0VGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghISRzY29wZS5lbGVtZW50LmZvY3VzZWRFbGVtZW50KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVsZW1lbnQuZm9jdXNlZEVsZW1lbnQuc2V0SXNGb2N1c2VkKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDApO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBOYXRpdmUgY2xpcGJvYXJkIHN1cHBvcnQgb2J2aW91c2x5IGV4aXN0cywgc28gZGlzYWJsZSB0aGUgcGV1ZG8gY2xpcGJvYXJkIGZyb20gbm93IG9uLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsaXBib2FyZC5kaXNhYmxlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6IGVudmlyb25tZW50LnRlbXBsYXRlVXJsKFwiRWRpdG9yXCIpLFxuICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsXG4gICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIE5vIGNsaWNrcyBzaG91bGQgcHJvcGFnYXRlIGZyb20gdGhlIFRpbnlNQ0UgdG9vbGJhcnMuXG4gICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuZmluZChcIi5sYXlvdXQtdG9vbGJhci1jb250YWluZXJcIikuY2xpY2soZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAvLyBVbmZvY3VzIGFuZCB1bnNlbGVjdCBldmVyeXRoaW5nIG9uIGNsaWNrIG91dHNpZGUgb2YgY2FudmFzLlxuICAgICAgICAgICAgICAgICAgICAkKHdpbmRvdykuY2xpY2soZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZWxlbWVudC5hY3RpdmVFbGVtZW50ID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbGVtZW50LmZvY3VzZWRFbGVtZW50ID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgXSk7IiwiYW5ndWxhclxuICAgIC5tb2R1bGUoXCJMYXlvdXRFZGl0b3JcIilcbiAgICAuZGlyZWN0aXZlKFwib3JjTGF5b3V0Q2FudmFzXCIsIFtcInNjb3BlQ29uZmlndXJhdG9yXCIsIFwiZW52aXJvbm1lbnRcIixcbiAgICAgICAgZnVuY3Rpb24gKHNjb3BlQ29uZmlndXJhdG9yLCBlbnZpcm9ubWVudCkge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICByZXN0cmljdDogXCJFXCIsXG4gICAgICAgICAgICAgICAgc2NvcGU6IHsgZWxlbWVudDogXCI9XCIgfSxcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbXCIkc2NvcGVcIiwgXCIkZWxlbWVudFwiLCBcIiRhdHRyc1wiLFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoJHNjb3BlLCAkZWxlbWVudCwgJGF0dHJzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzY29wZUNvbmZpZ3VyYXRvci5jb25maWd1cmVGb3JFbGVtZW50KCRzY29wZSwgJGVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGVDb25maWd1cmF0b3IuY29uZmlndXJlRm9yQ29udGFpbmVyKCRzY29wZSwgJGVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNvcnRhYmxlT3B0aW9uc1tcImF4aXNcIl0gPSBcInlcIjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6IGVudmlyb25tZW50LnRlbXBsYXRlVXJsKFwiQ2FudmFzXCIpLFxuICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWVcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICBdKTsiLCJhbmd1bGFyXG4gICAgLm1vZHVsZShcIkxheW91dEVkaXRvclwiKVxuICAgIC5kaXJlY3RpdmUoXCJvcmNMYXlvdXRDaGlsZFwiLCBbXCIkY29tcGlsZVwiLFxuICAgICAgICBmdW5jdGlvbiAoJGNvbXBpbGUpIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgcmVzdHJpY3Q6IFwiRVwiLFxuICAgICAgICAgICAgICAgIHNjb3BlOiB7IGVsZW1lbnQ6IFwiPVwiIH0sXG4gICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0ZW1wbGF0ZSA9IFwiPG9yYy1sYXlvdXQtXCIgKyBzY29wZS5lbGVtZW50LnR5cGUudG9Mb3dlckNhc2UoKSArIFwiIGVsZW1lbnQ9J2VsZW1lbnQnIC8+XCI7XG4gICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gJGNvbXBpbGUodGVtcGxhdGUpKHNjb3BlKTtcbiAgICAgICAgICAgICAgICAgICAgJChlbGVtZW50KS5yZXBsYWNlV2l0aChodG1sKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgXSk7IiwiYW5ndWxhclxuICAgIC5tb2R1bGUoXCJMYXlvdXRFZGl0b3JcIilcbiAgICAuZGlyZWN0aXZlKFwib3JjTGF5b3V0Q29sdW1uXCIsIFtcIiRjb21waWxlXCIsIFwic2NvcGVDb25maWd1cmF0b3JcIiwgXCJlbnZpcm9ubWVudFwiLFxuICAgICAgICBmdW5jdGlvbiAoJGNvbXBpbGUsIHNjb3BlQ29uZmlndXJhdG9yLCBlbnZpcm9ubWVudCkge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICByZXN0cmljdDogXCJFXCIsXG4gICAgICAgICAgICAgICAgc2NvcGU6IHsgZWxlbWVudDogXCI9XCIgfSxcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbXCIkc2NvcGVcIiwgXCIkZWxlbWVudFwiLFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoJHNjb3BlLCAkZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGVDb25maWd1cmF0b3IuY29uZmlndXJlRm9yRWxlbWVudCgkc2NvcGUsICRlbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlQ29uZmlndXJhdG9yLmNvbmZpZ3VyZUZvckNvbnRhaW5lcigkc2NvcGUsICRlbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5zb3J0YWJsZU9wdGlvbnNbXCJheGlzXCJdID0gXCJ5XCI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiBlbnZpcm9ubWVudC50ZW1wbGF0ZVVybChcIkNvbHVtblwiKSxcbiAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLFxuICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0cnMpIHtcbiAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5maW5kKFwiLmxheW91dC1jb2x1bW4tcmVzaXplLWJhclwiKS5kcmFnZ2FibGUoe1xuICAgICAgICAgICAgICAgICAgICAgICAgYXhpczogXCJ4XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWxwZXI6IFwiY2xvbmVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldmVydDogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0OiBmdW5jdGlvbiAoZSwgdWkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbGVtZW50LmVkaXRvci5pc1Jlc2l6aW5nID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBkcmFnOiBmdW5jdGlvbiAoZSwgdWkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29sdW1uRWxlbWVudCA9IGVsZW1lbnQucGFyZW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbHVtblNpemUgPSBjb2x1bW5FbGVtZW50LndpZHRoKCkgLyBzY29wZS5lbGVtZW50LndpZHRoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb25uZWN0QWRqYWNlbnQgPSAhZS5jdHJsS2V5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkKGUudGFyZ2V0KS5oYXNDbGFzcyhcImxheW91dC1jb2x1bW4tcmVzaXplLWJhci1sZWZ0XCIpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWx0YSA9IHVpLm9mZnNldC5sZWZ0IC0gY29sdW1uRWxlbWVudC5vZmZzZXQoKS5sZWZ0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVsdGEgPCAtY29sdW1uU2l6ZSAmJiBzY29wZS5lbGVtZW50LmNhbkV4cGFuZExlZnQoY29ubmVjdEFkamFjZW50KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbGVtZW50LmV4cGFuZExlZnQoY29ubmVjdEFkamFjZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRlbHRhID4gY29sdW1uU2l6ZSAmJiBzY29wZS5lbGVtZW50LmNhbkNvbnRyYWN0TGVmdChjb25uZWN0QWRqYWNlbnQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmVsZW1lbnQuY29udHJhY3RMZWZ0KGNvbm5lY3RBZGphY2VudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICgkKGUudGFyZ2V0KS5oYXNDbGFzcyhcImxheW91dC1jb2x1bW4tcmVzaXplLWJhci1yaWdodFwiKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGVsdGEgPSB1aS5vZmZzZXQubGVmdCAtIGNvbHVtbkVsZW1lbnQud2lkdGgoKSAtIGNvbHVtbkVsZW1lbnQub2Zmc2V0KCkubGVmdDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRlbHRhID4gY29sdW1uU2l6ZSAmJiBzY29wZS5lbGVtZW50LmNhbkV4cGFuZFJpZ2h0KGNvbm5lY3RBZGphY2VudCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZWxlbWVudC5leHBhbmRSaWdodChjb25uZWN0QWRqYWNlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZGVsdGEgPCAtY29sdW1uU2l6ZSAmJiBzY29wZS5lbGVtZW50LmNhbkNvbnRyYWN0UmlnaHQoY29ubmVjdEFkamFjZW50KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbGVtZW50LmNvbnRyYWN0UmlnaHQoY29ubmVjdEFkamFjZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcDogZnVuY3Rpb24gKGUsIHVpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmVsZW1lbnQuZWRpdG9yLmlzUmVzaXppbmcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIF0pOyIsImFuZ3VsYXJcclxuICAgIC5tb2R1bGUoXCJMYXlvdXRFZGl0b3JcIilcclxuICAgIC5kaXJlY3RpdmUoXCJvcmNMYXlvdXRDb250ZW50XCIsIFtcIiRzY2VcIiwgXCJzY29wZUNvbmZpZ3VyYXRvclwiLCBcImVudmlyb25tZW50XCIsXHJcbiAgICAgICAgZnVuY3Rpb24gKCRzY2UsIHNjb3BlQ29uZmlndXJhdG9yLCBlbnZpcm9ubWVudCkge1xyXG4gICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgICAgcmVzdHJpY3Q6IFwiRVwiLFxyXG4gICAgICAgICAgICAgICAgc2NvcGU6IHsgZWxlbWVudDogXCI9XCIgfSxcclxuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFtcIiRzY29wZVwiLCBcIiRlbGVtZW50XCIsXHJcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKCRzY29wZSwgJGVsZW1lbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGVDb25maWd1cmF0b3IuY29uZmlndXJlRm9yRWxlbWVudCgkc2NvcGUsICRlbGVtZW50KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIE92ZXJ3cml0ZSB0aGUgc2V0SHRtbCBmdW5jdGlvbiBzbyB0aGF0IHdlIGNhbiB1c2UgdGhlICRzY2Ugc2VydmljZSB0byB0cnVzdCB0aGUgaHRtbCAoYW5kIG5vdCBoYXZlIHRoZSBodG1sIGJpbmRpbmcgc3RyaXAgY2VydGFpbiB0YWdzKS5cclxuICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVsZW1lbnQuc2V0SHRtbCA9IGZ1bmN0aW9uIChodG1sKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZWxlbWVudC5odG1sID0gaHRtbDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5lbGVtZW50Lmh0bWxVbnNhZmUgPSAkc2NlLnRydXN0QXNIdG1sKGh0bWwpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVsZW1lbnQuc2V0SHRtbCgkc2NvcGUuZWxlbWVudC5odG1sKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6IGVudmlyb25tZW50LnRlbXBsYXRlVXJsKFwiQ29udGVudFwiKSxcclxuICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWVcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICB9XHJcbiAgICBdKTsiLCJhbmd1bGFyXG4gICAgLm1vZHVsZShcIkxheW91dEVkaXRvclwiKVxuICAgIC5kaXJlY3RpdmUoXCJvcmNMYXlvdXRHcmlkXCIsIFtcIiRjb21waWxlXCIsIFwic2NvcGVDb25maWd1cmF0b3JcIiwgXCJlbnZpcm9ubWVudFwiLFxuICAgICAgICBmdW5jdGlvbiAoJGNvbXBpbGUsIHNjb3BlQ29uZmlndXJhdG9yLCBlbnZpcm9ubWVudCkge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICByZXN0cmljdDogXCJFXCIsXG4gICAgICAgICAgICAgICAgc2NvcGU6IHsgZWxlbWVudDogXCI9XCIgfSxcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbXCIkc2NvcGVcIiwgXCIkZWxlbWVudFwiLFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoJHNjb3BlLCAkZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGVDb25maWd1cmF0b3IuY29uZmlndXJlRm9yRWxlbWVudCgkc2NvcGUsICRlbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlQ29uZmlndXJhdG9yLmNvbmZpZ3VyZUZvckNvbnRhaW5lcigkc2NvcGUsICRlbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5zb3J0YWJsZU9wdGlvbnNbXCJheGlzXCJdID0gXCJ5XCI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiBlbnZpcm9ubWVudC50ZW1wbGF0ZVVybChcIkdyaWRcIiksXG4gICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIF0pOyIsImFuZ3VsYXJcbiAgICAubW9kdWxlKFwiTGF5b3V0RWRpdG9yXCIpXG4gICAgLmRpcmVjdGl2ZShcIm9yY0xheW91dFJvd1wiLCBbXCIkY29tcGlsZVwiLCBcInNjb3BlQ29uZmlndXJhdG9yXCIsIFwiZW52aXJvbm1lbnRcIixcbiAgICAgICAgZnVuY3Rpb24gKCRjb21waWxlLCBzY29wZUNvbmZpZ3VyYXRvciwgZW52aXJvbm1lbnQpIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgcmVzdHJpY3Q6IFwiRVwiLFxuICAgICAgICAgICAgICAgIHNjb3BlOiB7IGVsZW1lbnQ6IFwiPVwiIH0sXG4gICAgICAgICAgICAgICAgY29udHJvbGxlcjogW1wiJHNjb3BlXCIsIFwiJGVsZW1lbnRcIixcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKCRzY29wZSwgJGVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlQ29uZmlndXJhdG9yLmNvbmZpZ3VyZUZvckVsZW1lbnQoJHNjb3BlLCAkZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzY29wZUNvbmZpZ3VyYXRvci5jb25maWd1cmVGb3JDb250YWluZXIoJHNjb3BlLCAkZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuc29ydGFibGVPcHRpb25zW1wiYXhpc1wiXSA9IFwieFwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNvcnRhYmxlT3B0aW9uc1tcInVpLWZsb2F0aW5nXCJdID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6IGVudmlyb25tZW50LnRlbXBsYXRlVXJsKFwiUm93XCIpLFxuICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWVcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICBdKTsiLCJhbmd1bGFyXG4gICAgLm1vZHVsZShcIkxheW91dEVkaXRvclwiKVxuICAgIC5kaXJlY3RpdmUoXCJvcmNMYXlvdXRQb3B1cFwiLCBbXG4gICAgICAgIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgcmVzdHJpY3Q6IFwiQVwiLFxuICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0cnMpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBvcHVwID0gJChlbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRyaWdnZXIgPSBwb3B1cC5jbG9zZXN0KFwiLmxheW91dC1wb3B1cC10cmlnZ2VyXCIpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgcGFyZW50RWxlbWVudCA9IHBvcHVwLmNsb3Nlc3QoXCIubGF5b3V0LWVsZW1lbnRcIik7XG4gICAgICAgICAgICAgICAgICAgIHRyaWdnZXIuY2xpY2soZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcG9wdXAudG9nZ2xlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocG9wdXAuaXMoXCI6dmlzaWJsZVwiKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcHVwLnBvc2l0aW9uKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXk6IGF0dHJzLm9yY0xheW91dFBvcHVwTXkgfHwgXCJsZWZ0IHRvcFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdDogYXR0cnMub3JjTGF5b3V0UG9wdXBBdCB8fCBcImxlZnQgYm90dG9tKzRweFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZjogdHJpZ2dlclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcHVwLmZpbmQoXCJpbnB1dFwiKS5maXJzdCgpLmZvY3VzKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBwb3B1cC5jbGljayhmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIHBhcmVudEVsZW1lbnQuY2xpY2soZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvcHVwLmhpZGUoKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIHBvcHVwLmtleWRvd24oZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZS5jdHJsS2V5ICYmICFlLnNoaWZ0S2V5ICYmICFlLmFsdEtleSAmJiBlLndoaWNoID09IDI3KSAvLyBFc2NcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3B1cC5oaWRlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcG9wdXAub24oXCJjdXQgY29weSBwYXN0ZVwiLCBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWxsb3cgY2xpcGJvYXJkIG9wZXJhdGlvbnMgaW4gcG9wdXAgd2l0aG91dCBpbnZva2luZyBjbGlwYm9hcmQgZXZlbnQgaGFuZGxlcnMgb24gcGFyZW50IGVsZW1lbnQuXG4gICAgICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgXSk7IiwiYW5ndWxhclxuICAgIC5tb2R1bGUoXCJMYXlvdXRFZGl0b3JcIilcbiAgICAuZGlyZWN0aXZlKFwib3JjTGF5b3V0VG9vbGJveFwiLCBbXCIkY29tcGlsZVwiLCBcImVudmlyb25tZW50XCIsXG4gICAgICAgIGZ1bmN0aW9uICgkY29tcGlsZSwgZW52aXJvbm1lbnQpIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgcmVzdHJpY3Q6IFwiRVwiLFxuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFtcIiRzY29wZVwiLCBcIiRlbGVtZW50XCIsXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uICgkc2NvcGUsICRlbGVtZW50KSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5yZXNldEVsZW1lbnRzID0gZnVuY3Rpb24gKCkge1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmdyaWRFbGVtZW50cyA9IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0RWRpdG9yLkdyaWQuZnJvbSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94SWNvbjogXCJcXHVmMDBhXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94TGFiZWw6IFwiR3JpZFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveERlc2NyaXB0aW9uOiBcIkVtcHR5IGdyaWQuXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZHJlbjogW11cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnJvd0VsZW1lbnRzID0gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMYXlvdXRFZGl0b3IuUm93LmZyb20oe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveEljb246IFwiXFx1ZjBjOVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveExhYmVsOiBcIlJvdyAoMSBjb2x1bW4pXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94RGVzY3JpcHRpb246IFwiUm93IHdpdGggMSBjb2x1bW4uXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZHJlbjogTGF5b3V0RWRpdG9yLkNvbHVtbi50aW1lcygxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0RWRpdG9yLlJvdy5mcm9tKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hJY29uOiBcIlxcdWYwYzlcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hMYWJlbDogXCJSb3cgKDIgY29sdW1ucylcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hEZXNjcmlwdGlvbjogXCJSb3cgd2l0aCAyIGNvbHVtbnMuXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZHJlbjogTGF5b3V0RWRpdG9yLkNvbHVtbi50aW1lcygyKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0RWRpdG9yLlJvdy5mcm9tKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hJY29uOiBcIlxcdWYwYzlcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hMYWJlbDogXCJSb3cgKDMgY29sdW1ucylcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hEZXNjcmlwdGlvbjogXCJSb3cgd2l0aCAzIGNvbHVtbnMuXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZHJlbjogTGF5b3V0RWRpdG9yLkNvbHVtbi50aW1lcygzKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0RWRpdG9yLlJvdy5mcm9tKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hJY29uOiBcIlxcdWYwYzlcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hMYWJlbDogXCJSb3cgKDQgY29sdW1ucylcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hEZXNjcmlwdGlvbjogXCJSb3cgd2l0aCA0IGNvbHVtbnMuXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZHJlbjogTGF5b3V0RWRpdG9yLkNvbHVtbi50aW1lcyg0KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0RWRpdG9yLlJvdy5mcm9tKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hJY29uOiBcIlxcdWYwYzlcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hMYWJlbDogXCJSb3cgKDYgY29sdW1ucylcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hEZXNjcmlwdGlvbjogXCJSb3cgd2l0aCA2IGNvbHVtbnMuXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZHJlbjogTGF5b3V0RWRpdG9yLkNvbHVtbi50aW1lcyg2KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGF5b3V0RWRpdG9yLlJvdy5mcm9tKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hJY29uOiBcIlxcdWYwYzlcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hMYWJlbDogXCJSb3cgKDEyIGNvbHVtbnMpXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94RGVzY3JpcHRpb246IFwiUm93IHdpdGggMTIgY29sdW1ucy5cIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBMYXlvdXRFZGl0b3IuQ29sdW1uLnRpbWVzKDEyKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSwgTGF5b3V0RWRpdG9yLlJvdy5mcm9tKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hJY29uOiBcIlxcdWYwYzlcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3hMYWJlbDogXCJSb3cgKGVtcHR5KVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveERlc2NyaXB0aW9uOiBcIkVtcHR5IHJvdy5cIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBbXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuY29sdW1uRWxlbWVudHMgPSBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExheW91dEVkaXRvci5Db2x1bW4uZnJvbSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94SWNvbjogXCJcXHVmMGRiXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94TGFiZWw6IFwiQ29sdW1uXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94RGVzY3JpcHRpb246IFwiRW1wdHkgY29sdW1uLlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQ6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZHJlbjogW11cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmNhbnZhc0VsZW1lbnRzID0gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMYXlvdXRFZGl0b3IuQ2FudmFzLmZyb20oe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveEljb246IFwiXFx1ZjA0NFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveExhYmVsOiBcIkNhbnZhc1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbGJveERlc2NyaXB0aW9uOiBcIkVtcHR5IGNhbnZhcy5cIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBbXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuY29udGVudEVsZW1lbnRDYXRlZ29yaWVzID0gXygkc2NvcGUuZWxlbWVudC5jb25maWcuY2F0ZWdvcmllcykubWFwKGZ1bmN0aW9uIChjYXRlZ29yeSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogY2F0ZWdvcnkubmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnRzOiBfKGNhdGVnb3J5LmNvbnRlbnRUeXBlcykubWFwKGZ1bmN0aW9uIChjb250ZW50VHlwZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0eXBlID0gY29udGVudFR5cGUudHlwZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZmFjdG9yeSA9IExheW91dEVkaXRvci5mYWN0b3JpZXNbdHlwZV0gfHwgTGF5b3V0RWRpdG9yLmZhY3Rvcmllc1tcIkNvbnRlbnRcIl07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGl0ZW0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVGVtcGxhdGVkOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFR5cGU6IGNvbnRlbnRUeXBlLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50VHlwZUxhYmVsOiBjb250ZW50VHlwZS5sYWJlbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFR5cGVDbGFzczogY29udGVudFR5cGUudHlwZUNsYXNzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNFZGl0b3I6IGNvbnRlbnRUeXBlLmhhc0VkaXRvcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHRtbDogY29udGVudFR5cGUuaHRtbFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsZW1lbnQgPSBmYWN0b3J5KGl0ZW0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQudG9vbGJveEljb24gPSBjb250ZW50VHlwZS5pY29uIHx8IFwiXFx1ZjFjOVwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQudG9vbGJveExhYmVsID0gY29udGVudFR5cGUubGFiZWw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC50b29sYm94RGVzY3JpcHRpb24gPSBjb250ZW50VHlwZS5kZXNjcmlwdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZWxlbWVudDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5yZXNldEVsZW1lbnRzKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5nZXRTb3J0YWJsZU9wdGlvbnMgPSBmdW5jdGlvbiAodHlwZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlZGl0b3JJZCA9ICRlbGVtZW50LmNsb3Nlc3QoXCIubGF5b3V0LWVkaXRvclwiKS5hdHRyKFwiaWRcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBhcmVudENsYXNzZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBsYWNlaG9sZGVyQ2xhc3NlcztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZmxvYXRpbmcgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAodHlwZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwiR3JpZFwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50Q2xhc3NlcyA9IFtcIi5sYXlvdXQtY2FudmFzXCIsIFwiLmxheW91dC1jb2x1bW5cIiwgXCIubGF5b3V0LWNvbW1vbi1ob2xkZXJcIl07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlckNsYXNzZXMgPSBcImxheW91dC1lbGVtZW50IGxheW91dC1jb250YWluZXIgbGF5b3V0LWdyaWQgdWktc29ydGFibGUtcGxhY2Vob2xkZXJcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwiUm93XCI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRDbGFzc2VzID0gW1wiLmxheW91dC1ncmlkXCJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxhY2Vob2xkZXJDbGFzc2VzID0gXCJsYXlvdXQtZWxlbWVudCBsYXlvdXQtY29udGFpbmVyIGxheW91dC1yb3cgcm93IHVpLXNvcnRhYmxlLXBsYWNlaG9sZGVyXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcIkNvbHVtblwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50Q2xhc3NlcyA9IFtcIi5sYXlvdXQtcm93Om5vdCgubGF5b3V0LXJvdy1mdWxsKVwiXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyQ2xhc3NlcyA9IFwibGF5b3V0LWVsZW1lbnQgbGF5b3V0LWNvbnRhaW5lciBsYXlvdXQtY29sdW1uIHVpLXNvcnRhYmxlLXBsYWNlaG9sZGVyXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdGluZyA9IHRydWU7IC8vIFRvIGVuc3VyZSBhIHNtb290aCBob3Jpem9udGFsLWxpc3QgcmVvcmRlcmluZy4gaHR0cHM6Ly9naXRodWIuY29tL2FuZ3VsYXItdWkvdWktc29ydGFibGUjZmxvYXRpbmdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFwiQ29udGVudFwiOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50Q2xhc3NlcyA9IFtcIi5sYXlvdXQtY2FudmFzXCIsIFwiLmxheW91dC1jb2x1bW5cIiwgXCIubGF5b3V0LWNvbW1vbi1ob2xkZXJcIl07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlckNsYXNzZXMgPSBcImxheW91dC1lbGVtZW50IGxheW91dC1jb250ZW50IHVpLXNvcnRhYmxlLXBsYWNlaG9sZGVyXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcIkNhbnZhc1wiOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50Q2xhc3NlcyA9IFtcIi5sYXlvdXQtY2FudmFzXCIsIFwiLmxheW91dC1jb2x1bW5cIiwgXCIubGF5b3V0LWNvbW1vbi1ob2xkZXJcIl07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlckNsYXNzZXMgPSBcImxheW91dC1lbGVtZW50IGxheW91dC1jb250YWluZXIgbGF5b3V0LWdyaWQgdWktc29ydGFibGUtcGxhY2Vob2xkZXJcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcjogXCJtb3ZlXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3RXaXRoOiBfKHBhcmVudENsYXNzZXMpLm1hcChmdW5jdGlvbiAoZSkgeyByZXR1cm4gXCIjXCIgKyBlZGl0b3JJZCArIFwiIFwiICsgZSArIFwiOm5vdCgubGF5b3V0LWNvbnRhaW5lci1zZWFsZWQpID4gLmxheW91dC1lbGVtZW50LXdyYXBwZXIgPiAubGF5b3V0LWNoaWxkcmVuXCI7IH0pLmpvaW4oXCIsIFwiKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxhY2Vob2xkZXI6IHBsYWNlaG9sZGVyQ2xhc3NlcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJ1aS1mbG9hdGluZ1wiOiBmbG9hdGluZyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3JlYXRlOiBmdW5jdGlvbiAoZSwgdWkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUudGFyZ2V0LmlzVG9vbGJveCA9IHRydWU7IC8vIFdpbGwgaW5kaWNhdGUgdG8gY29ubmVjdGVkIHNvcnRhYmxlcyB0aGF0IGRyb3BwZWQgaXRlbXMgd2VyZSBzZW50IGZyb20gdG9vbGJveC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IGZ1bmN0aW9uIChlLCB1aSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVsZW1lbnQuaXNEcmFnZ2luZyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcDogZnVuY3Rpb24gKGUsIHVpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZWxlbWVudC5pc0RyYWdnaW5nID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnJlc2V0RWxlbWVudHMoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdmVyOiBmdW5jdGlvbiAoZSwgdWkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5lbGVtZW50LmNhbnZhcy5zZXRJc0Ryb3BUYXJnZXQoZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxheW91dElzQ29sbGFwc2VkQ29va2llTmFtZSA9IFwibGF5b3V0VG9vbGJveENhdGVnb3J5X0xheW91dF9Jc0NvbGxhcHNlZFwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmxheW91dElzQ29sbGFwc2VkID0gJC5jb29raWUobGF5b3V0SXNDb2xsYXBzZWRDb29raWVOYW1lKSA9PT0gXCJ0cnVlXCI7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS50b2dnbGVMYXlvdXRJc0NvbGxhcHNlZCA9IGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmxheW91dElzQ29sbGFwc2VkID0gISRzY29wZS5sYXlvdXRJc0NvbGxhcHNlZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkLmNvb2tpZShsYXlvdXRJc0NvbGxhcHNlZENvb2tpZU5hbWUsICRzY29wZS5sYXlvdXRJc0NvbGxhcHNlZCwgeyBleHBpcmVzOiAzNjUgfSk7IC8vIFJlbWVtYmVyIGNvbGxhcHNlZCBzdGF0ZSBmb3IgYSB5ZWFyLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6IGVudmlyb25tZW50LnRlbXBsYXRlVXJsKFwiVG9vbGJveFwiKSxcbiAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLFxuICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdG9vbGJveCA9IGVsZW1lbnQuZmluZChcIi5sYXlvdXQtdG9vbGJveFwiKTtcbiAgICAgICAgICAgICAgICAgICAgJCh3aW5kb3cpLm9uKFwicmVzaXplIHNjcm9sbFwiLCBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNhbnZhcyA9IGVsZW1lbnQucGFyZW50KCkuZmluZChcIi5sYXlvdXQtY2FudmFzXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIGNhbnZhcyBpcyB0YWxsZXIgdGhhbiB0aGUgdG9vbGJveCwgbWFrZSB0aGUgdG9vbGJveCBzdGlja3ktcG9zaXRpb25lZCB3aXRoaW4gdGhlIGVkaXRvclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gdG8gaGVscCB0aGUgdXNlciBhdm9pZCBleGNlc3NpdmUgdmVydGljYWwgc2Nyb2xsaW5nLlxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNhbnZhc0lzVGFsbGVyID0gISFjYW52YXMgJiYgY2FudmFzLmhlaWdodCgpID4gdG9vbGJveC5oZWlnaHQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB3aW5kb3dQb3MgPSAkKHdpbmRvdykuc2Nyb2xsVG9wKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2FudmFzSXNUYWxsZXIgJiYgd2luZG93UG9zID4gZWxlbWVudC5vZmZzZXQoKS50b3AgKyBlbGVtZW50LmhlaWdodCgpIC0gdG9vbGJveC5oZWlnaHQoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3guYWRkQ2xhc3MoXCJzdGlja3ktYm90dG9tXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3gucmVtb3ZlQ2xhc3MoXCJzdGlja3ktdG9wXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoY2FudmFzSXNUYWxsZXIgJiYgd2luZG93UG9zID4gZWxlbWVudC5vZmZzZXQoKS50b3ApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94LmFkZENsYXNzKFwic3RpY2t5LXRvcFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sYm94LnJlbW92ZUNsYXNzKFwic3RpY2t5LWJvdHRvbVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3gucmVtb3ZlQ2xhc3MoXCJzdGlja3ktdG9wXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2xib3gucmVtb3ZlQ2xhc3MoXCJzdGlja3ktYm90dG9tXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgXSk7IiwiYW5ndWxhclxuICAgIC5tb2R1bGUoXCJMYXlvdXRFZGl0b3JcIilcbiAgICAuZGlyZWN0aXZlKFwib3JjTGF5b3V0VG9vbGJveEdyb3VwXCIsIFtcIiRjb21waWxlXCIsIFwiZW52aXJvbm1lbnRcIixcbiAgICAgICAgZnVuY3Rpb24gKCRjb21waWxlLCBlbnZpcm9ubWVudCkge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICByZXN0cmljdDogXCJFXCIsXG4gICAgICAgICAgICAgICAgc2NvcGU6IHsgY2F0ZWdvcnk6IFwiPVwiIH0sXG4gICAgICAgICAgICAgICAgY29udHJvbGxlcjogW1wiJHNjb3BlXCIsIFwiJGVsZW1lbnRcIixcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKCRzY29wZSwgJGVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc0NvbGxhcHNlZENvb2tpZU5hbWUgPSBcImxheW91dFRvb2xib3hDYXRlZ29yeV9cIiArICRzY29wZS5jYXRlZ29yeS5uYW1lICsgXCJfSXNDb2xsYXBzZWRcIjtcbiAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5pc0NvbGxhcHNlZCA9ICQuY29va2llKGlzQ29sbGFwc2VkQ29va2llTmFtZSkgPT09IFwidHJ1ZVwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnRvZ2dsZUlzQ29sbGFwc2VkID0gZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuaXNDb2xsYXBzZWQgPSAhJHNjb3BlLmlzQ29sbGFwc2VkO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQuY29va2llKGlzQ29sbGFwc2VkQ29va2llTmFtZSwgJHNjb3BlLmlzQ29sbGFwc2VkLCB7IGV4cGlyZXM6IDM2NSB9KTsgLy8gUmVtZW1iZXIgY29sbGFwc2VkIHN0YXRlIGZvciBhIHllYXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogZW52aXJvbm1lbnQudGVtcGxhdGVVcmwoXCJUb29sYm94R3JvdXBcIiksXG4gICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIF0pOyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ== diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutEditor.min.js b/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutEditor.min.js index 4218317f206..6b9a7bd3931 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutEditor.min.js +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutEditor.min.js @@ -1 +1 @@ -angular.module("LayoutEditor",["ngSanitize","ngResource","ui.sortable"]);var LayoutEditor;!function(e){var t=function(){var e=this;this._clipboardData={},this._isDisabled=!1,this._wasInvoked=!1,this.setData=function(t,o){e._clipboardData[t]=o,e._wasInvoked=!0},this.getData=function(t){return e._clipboardData[t]},this.disable=function(){e._isDisabled=!0,e._wasInvoked=!1,e._clipboardData={}},this.isDisabled=function(){return e._isDisabled},this.wasInvoked=function(){return e._wasInvoked}};e.Clipboard=new t,angular.module("LayoutEditor").factory("clipboard",[function(){return{setData:e.Clipboard.setData,getData:e.Clipboard.getData,disable:e.Clipboard.disable,isDisabled:e.Clipboard.isDisabled,wasInvoked:e.Clipboard.wasInvoked}}])}(LayoutEditor||(LayoutEditor={})),angular.module("LayoutEditor").factory("scopeConfigurator",["$timeout","clipboard",function(e,t){return{configureForElement:function(e,o){o.find(".layout-panel").click(function(e){e.stopPropagation()}),o.parent().keydown(function(n){var l=!1,a=!1,r=e.element;if(!r.editor.isDragging){if(!t.isDisabled()){var i=r.editor.focusedElement;if(i&&n.ctrlKey)switch(n.which){case 67:i.copy(t);break;case 88:i.cut(t);break;case 86:i.paste(t)}}if(n.ctrlKey||n.shiftKey||n.altKey||46!=n.which?n.ctrlKey||n.shiftKey||n.altKey||32!=n.which&&27!=n.which||(o.find(".layout-panel-action-properties").first().click(),l=!0):(e["delete"](r),l=!0),"Content"==r.type&&(n.ctrlKey||n.shiftKey||n.altKey||13!=n.which||(o.find(".layout-panel-action-edit").first().click(),l=!0)),r.children&&(n.ctrlKey||n.shiftKey||!n.altKey||40!=n.which||(r.children.length>0&&r.children[0].setIsFocused(),l=!0),"Column"==r.type)){var c=!n.ctrlKey;37==n.which?(n.altKey&&r.expandLeft(c),n.shiftKey&&r.contractRight(c),l=!0):39==n.which&&(n.altKey&&r.contractLeft(c),n.shiftKey&&r.expandRight(c),l=!0)}r.parent&&(n.altKey&&38==n.which&&(r.parent.setIsFocused(),l=!0),"Row"==r.parent.type?n.ctrlKey||n.shiftKey||n.altKey||37!=n.which?n.ctrlKey||n.shiftKey||n.altKey||39!=n.which?!n.ctrlKey||n.shiftKey||n.altKey||37!=n.which?!n.ctrlKey||n.shiftKey||n.altKey||39!=n.which||(r.moveDown(),l=!0):(r.moveUp(),a=!0,l=!0):(r.parent.moveFocusNextChild(r),l=!0):(r.parent.moveFocusPrevChild(r),l=!0):n.ctrlKey||n.shiftKey||n.altKey||38!=n.which?n.ctrlKey||n.shiftKey||n.altKey||40!=n.which?!n.ctrlKey||n.shiftKey||n.altKey||38!=n.which?!n.ctrlKey||n.shiftKey||n.altKey||40!=n.which||(r.moveDown(),l=!0):(r.moveUp(),a=!0,l=!0):(r.parent.moveFocusNextChild(r),l=!0):(r.parent.moveFocusPrevChild(r),l=!0)),l&&n.preventDefault(),n.stopPropagation(),e.$apply(),a&&window.setTimeout(function(){e.$apply(function(){r.editor.focusedElement.setIsFocused()})},100)}}),e.element.setIsFocusedEventHandlers.push(function(){o.parent().focus()}),e["delete"]=function(e){e["delete"]()}},configureForContainer:function(t,o){var n=t.element;t.getShowChildrenPlaceholder=function(){return 0===t.element.children.length&&!t.element.getIsDropTarget()},t.sortableOptions={cursor:"move",delay:150,disabled:n.getIsSealed(),distance:5,start:function(e,o){t.$apply(function(){n.setIsDropTarget(!0),n.editor.isDragging=!0}),o.placeholder.height(o.item.height()-4),o.placeholder.css("min-height",0)},stop:function(e,o){t.$apply(function(){n.editor.isDragging=!1,n.setIsDropTarget(!1)})},over:function(t,l){l.sender&&l.sender[0].isToolbox&&(l.sender[0].dropTargetTimeout&&(e.cancel(l.sender[0].dropTargetTimeout),l.sender[0].dropTargetTimeout=null),e(function(){if("Row"==n.type){var e=n.editor.dropTargetElement;e&&"Row"==e.type&&e.rollbackAddColumn()}n.setIsDropTarget(!1)}),l.sender[0].dropTargetTimeout=e(function(){if("Row"==n.type){var e=l.item.sortable.model,t=Math.floor(12/(n.children.length+1));e.width=t,e.offset=0,n.beginAddColumn(t);var a=_.max(_(o.find("> .layout-children > .layout-column:not(.ui-sortable-placeholder)")).map(function(e){return $(e).height()}));for(i=1;i<=12;i++)l.placeholder.removeClass("col-xs-"+i);l.placeholder.addClass("col-xs-"+e.width),a>0?(l.placeholder.height(a),l.placeholder.css("min-height",0)):(l.placeholder.height(0),l.placeholder.css("min-height",""))}n.setIsDropTarget(!0)},150))},receive:function(o,l){l.sender&&l.sender[0].isToolbox&&t.$apply(function(){var o=l.item.sortable.model;o&&("Row"==n.type&&n.commitAddColumn(),o.setEditor(n.editor),o.setParent(n),o.hasEditor&&t.$root.editElement(o).then(function(t){t.cancel||(o.data=t.element.data,o.applyElementEditorModel(t.elementEditorModel),o.setHtml&&o.setHtml(t.element.html)),e(function(){t.cancel?o["delete"]():o.setIsFocused(),n.setIsDropTarget(!1)})})),e(function(){n.setIsDropTarget(!1),o&&o.setIsFocused()})})}},t.click=function(e,t){e.editor.isDragging||e.setIsFocused(),t.stopPropagation()},t.getClasses=function(e){var t=["layout-element"];return e.children&&(t.push("layout-container"),e.getIsSealed()&&t.push("layout-container-sealed")),t.push("layout-"+e.type.toLowerCase()),e.dropTargetClass&&t.push(e.dropTargetClass),"Row"==e.type&&(t.push("row"),e.canAddColumn()||t.push("layout-row-full")),"Column"==e.type&&(t.push("col-xs-"+e.width),t.push("col-xs-offset-"+e.offset)),"Content"==e.type&&t.push("layout-content-"+e.contentTypeClass),e.getIsActive()&&t.push("layout-element-active"),e.getIsFocused()&&t.push("layout-element-focused"),e.getIsSelected()&&t.push("layout-element-selected"),e.getIsDropTarget()&&t.push("layout-element-droptarget"),e.isTemplated&&t.push("layout-element-templated"),t}}}}]),angular.module("LayoutEditor").directive("orcLayoutEditor",["environment",function(environment){return{restrict:"E",scope:{},controller:["$scope","$element","$attrs","$compile","clipboard",function($scope,$element,$attrs,$compile,clipboard){if(!$attrs.model)throw new Error("The 'model' attribute must evaluate to a LayoutEditor.Editor object.");$scope.element=eval($attrs.model),$scope.click=function(e,t){e.editor.isDragging||e.setIsFocused(),t.stopPropagation()},$scope.getClasses=function(e){var t=["layout-element","layout-container","layout-canvas"];return e.getIsActive()&&t.push("layout-element-active"),e.getIsFocused()&&t.push("layout-element-focused"),e.getIsSelected()&&t.push("layout-element-selected"),e.getIsDropTarget()&&t.push("layout-element-droptarget"),e.isTemplated&&t.push("layout-element-templated"),t};var layoutDesignerHost=$(".layout-designer").data("layout-designer-host");$scope.$root.layoutDesignerHost=layoutDesignerHost,layoutDesignerHost.element.on("replacecanvas",function(e,t){var o=$scope.element,n={data:t.canvas.data,htmlId:t.canvas.htmlId,htmlClass:t.canvas.htmlClass,htmlStyle:t.canvas.htmlStyle,isTemplated:t.canvas.isTemplated,children:t.canvas.children};layoutDesignerHost.editor=window.layoutEditor=new LayoutEditor.Editor(o.config,n);var l="",a=$compile(l)($scope);$(".layout-editor-holder").html(a)}),$scope.$root.editElement=function(e){var t=$scope.$root.layoutDesignerHost;return t.editElement(e)},$scope.$root.addElement=function(e){var t=$scope.$root.layoutDesignerHost;return t.addElement(e)},$(document).on("cut copy paste",function(e){if(clipboard.wasInvoked())e.originalEvent.clipboardData.setData("text/plain",clipboard.getData("text/plain")),e.originalEvent.clipboardData.setData("text/json",clipboard.getData("text/json")),e.preventDefault();else{var t=$scope.element.focusedElement;t&&($scope.$apply(function(){switch(e.type){case"copy":t.copy(e.originalEvent.clipboardData);break;case"cut":t.cut(e.originalEvent.clipboardData);break;case"paste":t.paste(e.originalEvent.clipboardData)}}),window.setTimeout(function(){$scope.$apply(function(){$scope.element.focusedElement&&$scope.element.focusedElement.setIsFocused()})},100),e.preventDefault())}clipboard.disable()})}],templateUrl:environment.templateUrl("Editor"),replace:!0,link:function(e,t){t.find(".layout-toolbar-container").click(function(e){e.stopPropagation()}),$(window).click(function(t){e.$apply(function(){e.element.activeElement=null,e.element.focusedElement=null})})}}}]),angular.module("LayoutEditor").directive("orcLayoutCanvas",["scopeConfigurator","environment",function(e,t){return{restrict:"E",scope:{element:"="},controller:["$scope","$element","$attrs",function(t,o,n){e.configureForElement(t,o),e.configureForContainer(t,o),t.sortableOptions.axis="y"}],templateUrl:t.templateUrl("Canvas"),replace:!0}}]),angular.module("LayoutEditor").directive("orcLayoutChild",["$compile",function(e){return{restrict:"E",scope:{element:"="},link:function(t,o){var n="",l=e(n)(t);$(o).replaceWith(l)}}}]),angular.module("LayoutEditor").directive("orcLayoutColumn",["$compile","scopeConfigurator","environment",function(e,t,o){return{restrict:"E",scope:{element:"="},controller:["$scope","$element",function(e,o){t.configureForElement(e,o),t.configureForContainer(e,o),e.sortableOptions.axis="y"}],templateUrl:o.templateUrl("Column"),replace:!0,link:function(e,t,o){t.find(".layout-column-resize-bar").draggable({axis:"x",helper:"clone",revert:!0,start:function(t,o){e.$apply(function(){e.element.editor.isResizing=!0})},drag:function(o,n){var l=t.parent(),a=l.width()/e.element.width,r=!o.ctrlKey;if($(o.target).hasClass("layout-column-resize-bar-left")){var i=n.offset.left-l.offset().left;-a>i&&e.element.canExpandLeft(r)?e.$apply(function(){e.element.expandLeft(r)}):i>a&&e.element.canContractLeft(r)&&e.$apply(function(){e.element.contractLeft(r)})}else if($(o.target).hasClass("layout-column-resize-bar-right")){var i=n.offset.left-l.width()-l.offset().left;i>a&&e.element.canExpandRight(r)?e.$apply(function(){e.element.expandRight(r)}):-a>i&&e.element.canContractRight(r)&&e.$apply(function(){e.element.contractRight(r)})}},stop:function(t,o){e.$apply(function(){e.element.editor.isResizing=!1})}})}}}]),angular.module("LayoutEditor").directive("orcLayoutContent",["$sce","scopeConfigurator","environment",function(e,t,o){return{restrict:"E",scope:{element:"="},controller:["$scope","$element",function(o,n){t.configureForElement(o,n),o.edit=function(){o.$root.editElement(o.element).then(function(e){o.$apply(function(){e.cancel||(o.element.data=e.element.data,o.element.setHtml(e.element.html))})})},o.element.setHtml=function(t){o.element.html=t,o.element.htmlUnsafe=e.trustAsHtml(t)},o.element.setHtml(o.element.html)}],templateUrl:o.templateUrl("Content"),replace:!0}}]),angular.module("LayoutEditor").directive("orcLayoutHtml",["$sce","scopeConfigurator","environment",function(e,t,o){return{restrict:"E",scope:{element:"="},controller:["$scope","$element",function(o,n){t.configureForElement(o,n),o.edit=function(){o.$root.editElement(o.element).then(function(e){o.$apply(function(){e.cancel||(o.element.data=e.element.data,o.element.setHtml(e.element.html))})})},o.updateContent=function(e){o.element.setHtml(e.target.innerHTML)},o.element.setHtml=function(t){o.element.html=t,o.element.htmlUnsafe=e.trustAsHtml(t)},o.element.setHtml(o.element.html)}],templateUrl:o.templateUrl("Html"),replace:!0,link:function(e,t){}}}]),angular.module("LayoutEditor").directive("orcLayoutGrid",["$compile","scopeConfigurator","environment",function(e,t,o){return{restrict:"E",scope:{element:"="},controller:["$scope","$element",function(e,o){t.configureForElement(e,o),t.configureForContainer(e,o),e.sortableOptions.axis="y"}],templateUrl:o.templateUrl("Grid"),replace:!0}}]),angular.module("LayoutEditor").directive("orcLayoutRow",["$compile","scopeConfigurator","environment",function(e,t,o){return{restrict:"E",scope:{element:"="},controller:["$scope","$element",function(e,o){t.configureForElement(e,o),t.configureForContainer(e,o),e.sortableOptions.axis="x",e.sortableOptions["ui-floating"]=!0}],templateUrl:o.templateUrl("Row"),replace:!0}}]),angular.module("LayoutEditor").directive("orcLayoutPopup",[function(){return{restrict:"A",link:function(e,t,o){var n=$(t),l=n.closest(".layout-popup-trigger"),a=n.closest(".layout-element");l.click(function(){n.toggle(),n.is(":visible")&&(n.position({my:o.orcLayoutPopupMy||"left top",at:o.orcLayoutPopupAt||"left bottom+4px",of:l}),n.find("input").first().focus())}),n.click(function(e){e.stopPropagation()}),a.click(function(e){n.hide()}),n.keydown(function(e){e.ctrlKey||e.shiftKey||e.altKey||27!=e.which||n.hide(),e.stopPropagation()}),n.on("cut copy paste",function(e){e.stopPropagation()})}}}]),angular.module("LayoutEditor").directive("orcLayoutToolbox",["$compile","environment",function(e,t){return{restrict:"E",controller:["$scope","$element",function(e,t){e.resetElements=function(){e.gridElements=[LayoutEditor.Grid.from({toolboxIcon:"",toolboxLabel:"Grid",toolboxDescription:"Empty grid.",children:[]})],e.rowElements=[LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (1 column)",toolboxDescription:"Row with 1 column.",children:LayoutEditor.Column.times(1)}),LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (2 columns)",toolboxDescription:"Row with 2 columns.",children:LayoutEditor.Column.times(2)}),LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (3 columns)",toolboxDescription:"Row with 3 columns.",children:LayoutEditor.Column.times(3)}),LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (4 columns)",toolboxDescription:"Row with 4 columns.",children:LayoutEditor.Column.times(4)}),LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (6 columns)",toolboxDescription:"Row with 6 columns.",children:LayoutEditor.Column.times(6)}),LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (12 columns)",toolboxDescription:"Row with 12 columns.",children:LayoutEditor.Column.times(12)}),LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (empty)",toolboxDescription:"Empty row.",children:[]})],e.columnElements=[LayoutEditor.Column.from({toolboxIcon:"",toolboxLabel:"Column",toolboxDescription:"Empty column.",width:1,offset:0,children:[]})],e.contentElementCategories=_(e.element.config.categories).map(function(e){return{name:e.name,elements:_(e.contentTypes).map(function(e){var t=e.type,o=LayoutEditor.factories[t]||LayoutEditor.factories.Content,n={isTemplated:!1,contentType:e.id,contentTypeLabel:e.label,contentTypeClass:e.typeClass,data:null,hasEditor:e.hasEditor,html:e.html},l=o(n);return l.toolboxIcon=e.icon||"",l.toolboxLabel=e.label,l.toolboxDescription=e.description,l})}})},e.resetElements(),e.getSortableOptions=function(o){var n,l,a=t.closest(".layout-editor").attr("id"),r=!1;switch(o){case"Grid":n=[".layout-canvas",".layout-column",".layout-common-holder"],l="layout-element layout-container layout-grid ui-sortable-placeholder";break;case"Row":n=[".layout-grid"],l="layout-element layout-container layout-row row ui-sortable-placeholder";break;case"Column":n=[".layout-row:not(.layout-row-full)"],l="layout-element layout-container layout-column ui-sortable-placeholder",r=!0;break;case"Content":n=[".layout-canvas",".layout-column",".layout-common-holder"],l="layout-element layout-content ui-sortable-placeholder"}return{cursor:"move",connectWith:_(n).map(function(e){return"#"+a+" "+e+":not(.layout-container-sealed) > .layout-element-wrapper > .layout-children"}).join(", "),placeholder:l,"ui-floating":r,create:function(e,t){e.target.isToolbox=!0},start:function(t,o){e.$apply(function(){e.element.isDragging=!0})},stop:function(t,o){e.$apply(function(){e.element.isDragging=!1,e.resetElements()})},over:function(t,o){e.$apply(function(){e.element.canvas.setIsDropTarget(!1)})}}};var o="layoutToolboxCategory_Layout_IsCollapsed";e.layoutIsCollapsed="true"===$.cookie(o),e.toggleLayoutIsCollapsed=function(t){e.layoutIsCollapsed=!e.layoutIsCollapsed,$.cookie(o,e.layoutIsCollapsed,{expires:365}),t.preventDefault(),t.stopPropagation()}}],templateUrl:t.templateUrl("Toolbox"),replace:!0,link:function(e,t){var o=t.find(".layout-toolbox");$(window).on("resize scroll",function(e){var n=t.parent().find(".layout-canvas"),l=!!n&&n.height()>o.height(),a=$(window).scrollTop();l&&a>t.offset().top+t.height()-o.height()?(o.addClass("sticky-bottom"),o.removeClass("sticky-top")):l&&a>t.offset().top?(o.addClass("sticky-top"),o.removeClass("sticky-bottom")):(o.removeClass("sticky-top"),o.removeClass("sticky-bottom"))})}}}]),angular.module("LayoutEditor").directive("orcLayoutToolboxGroup",["$compile","environment",function(e,t){return{restrict:"E",scope:{category:"="},controller:["$scope","$element",function(e,t){var o="layoutToolboxCategory_"+e.category.name+"_IsCollapsed";e.isCollapsed="true"===$.cookie(o),e.toggleIsCollapsed=function(t){e.isCollapsed=!e.isCollapsed,$.cookie(o,e.isCollapsed,{expires:365}),t.preventDefault(),t.stopPropagation()}}],templateUrl:t.templateUrl("ToolboxGroup"),replace:!0}}]); \ No newline at end of file +angular.module("LayoutEditor",["ngSanitize","ngResource","ui.sortable"]);var LayoutEditor;!function(e){var t=function(){var e=this;this._clipboardData={},this._isDisabled=!1,this._wasInvoked=!1,this.setData=function(t,o){e._clipboardData[t]=o,e._wasInvoked=!0},this.getData=function(t){return e._clipboardData[t]},this.disable=function(){e._isDisabled=!0,e._wasInvoked=!1,e._clipboardData={}},this.isDisabled=function(){return e._isDisabled},this.wasInvoked=function(){return e._wasInvoked}};e.Clipboard=new t,angular.module("LayoutEditor").factory("clipboard",[function(){return{setData:e.Clipboard.setData,getData:e.Clipboard.getData,disable:e.Clipboard.disable,isDisabled:e.Clipboard.isDisabled,wasInvoked:e.Clipboard.wasInvoked}}])}(LayoutEditor||(LayoutEditor={})),angular.module("LayoutEditor").factory("scopeConfigurator",["$timeout","clipboard",function(e,t){return{configureForElement:function(e,o){o.find(".layout-panel").click(function(e){e.stopPropagation()}),o.parent().keydown(function(n){var l=!1,a=!1,r=e.element;if(!r.editor.isDragging){if(!t.isDisabled()){var i=r.editor.focusedElement;if(i&&n.ctrlKey)switch(n.which){case 67:i.copy(t);break;case 88:i.cut(t);break;case 86:i.paste(t)}}if(n.ctrlKey||n.shiftKey||n.altKey||46!=n.which?n.ctrlKey||n.shiftKey||n.altKey||32!=n.which&&27!=n.which||(o.find(".layout-panel-action-properties").first().click(),l=!0):(e["delete"](r),l=!0),"Content"==r.type&&(n.ctrlKey||n.shiftKey||n.altKey||13!=n.which||(o.find(".layout-panel-action-edit").first().click(),l=!0)),r.children&&(n.ctrlKey||n.shiftKey||!n.altKey||40!=n.which||(r.children.length>0&&r.children[0].setIsFocused(),l=!0),"Column"==r.type)){var c=!n.ctrlKey;37==n.which?(n.altKey&&r.expandLeft(c),n.shiftKey&&r.contractRight(c),l=!0):39==n.which&&(n.altKey&&r.contractLeft(c),n.shiftKey&&r.expandRight(c),l=!0)}r.parent&&(n.altKey&&38==n.which&&(r.parent.setIsFocused(),l=!0),"Row"==r.parent.type?n.ctrlKey||n.shiftKey||n.altKey||37!=n.which?n.ctrlKey||n.shiftKey||n.altKey||39!=n.which?!n.ctrlKey||n.shiftKey||n.altKey||37!=n.which?!n.ctrlKey||n.shiftKey||n.altKey||39!=n.which||(r.moveDown(),l=!0):(r.moveUp(),a=!0,l=!0):(r.parent.moveFocusNextChild(r),l=!0):(r.parent.moveFocusPrevChild(r),l=!0):n.ctrlKey||n.shiftKey||n.altKey||38!=n.which?n.ctrlKey||n.shiftKey||n.altKey||40!=n.which?!n.ctrlKey||n.shiftKey||n.altKey||38!=n.which?!n.ctrlKey||n.shiftKey||n.altKey||40!=n.which||(r.moveDown(),l=!0):(r.moveUp(),a=!0,l=!0):(r.parent.moveFocusNextChild(r),l=!0):(r.parent.moveFocusPrevChild(r),l=!0)),l&&n.preventDefault(),n.stopPropagation(),e.$apply(),a&&window.setTimeout(function(){e.$apply(function(){r.editor.focusedElement.setIsFocused()})},100)}}),e.element.setIsFocusedEventHandlers.push(function(){o.parent().focus()}),e["delete"]=function(e){e["delete"]()},e.element.hasEditor&&(e.edit=function(){e.$root.editElement(e.element).then(function(t){e.$apply(function(){t.cancel||(e.element.data=t.element.data,e.element.applyElementEditorModel(t.elementEditorModel),e.element.setHtml&&e.element.setHtml(t.element.html))})})})},configureForContainer:function(t,o){var n=t.element;t.getShowChildrenPlaceholder=function(){return 0===t.element.children.length&&!t.element.getIsDropTarget()},t.sortableOptions={cursor:"move",delay:150,disabled:n.getIsSealed(),distance:5,start:function(e,o){t.$apply(function(){n.setIsDropTarget(!0),n.editor.isDragging=!0}),o.placeholder.height(o.item.height()-4),o.placeholder.css("min-height",0)},stop:function(e,o){t.$apply(function(){n.editor.isDragging=!1,n.setIsDropTarget(!1)})},over:function(t,l){l.sender&&l.sender[0].isToolbox&&(l.sender[0].dropTargetTimeout&&(e.cancel(l.sender[0].dropTargetTimeout),l.sender[0].dropTargetTimeout=null),e(function(){if("Row"==n.type){var e=n.editor.dropTargetElement;e&&"Row"==e.type&&e.rollbackAddColumn()}n.setIsDropTarget(!1)}),l.sender[0].dropTargetTimeout=e(function(){if("Row"==n.type){var e=l.item.sortable.model,t=Math.floor(12/(n.children.length+1));e.width=t,e.offset=0,n.beginAddColumn(t);var a=_.max(_(o.find("> .layout-children > .layout-column:not(.ui-sortable-placeholder)")).map(function(e){return $(e).height()}));for(i=1;i<=12;i++)l.placeholder.removeClass("col-xs-"+i);l.placeholder.addClass("col-xs-"+e.width),a>0?(l.placeholder.height(a),l.placeholder.css("min-height",0)):(l.placeholder.height(0),l.placeholder.css("min-height",""))}n.setIsDropTarget(!0)},150))},receive:function(o,l){l.sender&&l.sender[0].isToolbox&&t.$apply(function(){var o=l.item.sortable.model;o&&("Row"==n.type&&n.commitAddColumn(),o.setEditor(n.editor),o.setParent(n),o.hasEditor&&t.$root.editElement(o).then(function(t){t.cancel||(o.data=t.element.data,o.applyElementEditorModel(t.elementEditorModel),o.setHtml&&o.setHtml(t.element.html)),e(function(){t.cancel?o["delete"]():o.setIsFocused(),n.setIsDropTarget(!1)})})),e(function(){n.setIsDropTarget(!1),o&&o.setIsFocused()})})}},t.click=function(e,t){e.editor.isDragging||e.setIsFocused(),t.stopPropagation()},t.getClasses=function(e){var t=["layout-element"];return e.children&&(t.push("layout-container"),e.getIsSealed()&&t.push("layout-container-sealed")),t.push("layout-"+e.type.toLowerCase()),e.dropTargetClass&&t.push(e.dropTargetClass),"Row"==e.type&&(t.push("row"),e.canAddColumn()||t.push("layout-row-full")),"Column"==e.type&&(t.push("col-xs-"+e.width),t.push("col-xs-offset-"+e.offset)),"Content"==e.type&&t.push("layout-content-"+e.contentTypeClass),e.getIsActive()&&t.push("layout-element-active"),e.getIsFocused()&&t.push("layout-element-focused"),e.getIsSelected()&&t.push("layout-element-selected"),e.getIsDropTarget()&&t.push("layout-element-droptarget"),e.isTemplated&&t.push("layout-element-templated"),t}}}}]),angular.module("LayoutEditor").directive("orcLayoutEditor",["environment",function(environment){return{restrict:"E",scope:{},controller:["$scope","$element","$attrs","$compile","clipboard",function($scope,$element,$attrs,$compile,clipboard){if(!$attrs.model)throw new Error("The 'model' attribute must evaluate to a LayoutEditor.Editor object.");$scope.element=eval($attrs.model),$scope.click=function(e,t){e.editor.isDragging||e.setIsFocused(),t.stopPropagation()},$scope.getClasses=function(e){var t=["layout-element","layout-container","layout-canvas"];return e.getIsActive()&&t.push("layout-element-active"),e.getIsFocused()&&t.push("layout-element-focused"),e.getIsSelected()&&t.push("layout-element-selected"),e.getIsDropTarget()&&t.push("layout-element-droptarget"),e.isTemplated&&t.push("layout-element-templated"),t};var layoutDesignerHost=$(".layout-designer").data("layout-designer-host");$scope.$root.layoutDesignerHost=layoutDesignerHost,layoutDesignerHost.element.on("replacecanvas",function(e,t){var o=$scope.element,n={data:t.canvas.data,htmlId:t.canvas.htmlId,htmlClass:t.canvas.htmlClass,htmlStyle:t.canvas.htmlStyle,isTemplated:t.canvas.isTemplated,children:t.canvas.children};layoutDesignerHost.editor=window.layoutEditor=new LayoutEditor.Editor(o.config,n);var l="",a=$compile(l)($scope);$(".layout-editor-holder").html(a)}),$scope.$root.editElement=function(e){var t=$scope.$root.layoutDesignerHost;return t.editElement(e)},$scope.$root.addElement=function(e){var t=$scope.$root.layoutDesignerHost;return t.addElement(e)},$(document).on("cut copy paste",function(e){if(clipboard.wasInvoked())e.originalEvent.clipboardData.setData("text/plain",clipboard.getData("text/plain")),e.originalEvent.clipboardData.setData("text/json",clipboard.getData("text/json")),e.preventDefault();else{var t=$scope.element.focusedElement;t&&($scope.$apply(function(){switch(e.type){case"copy":t.copy(e.originalEvent.clipboardData);break;case"cut":t.cut(e.originalEvent.clipboardData);break;case"paste":t.paste(e.originalEvent.clipboardData)}}),window.setTimeout(function(){$scope.$apply(function(){$scope.element.focusedElement&&$scope.element.focusedElement.setIsFocused()})},100),e.preventDefault())}clipboard.disable()})}],templateUrl:environment.templateUrl("Editor"),replace:!0,link:function(e,t){t.find(".layout-toolbar-container").click(function(e){e.stopPropagation()}),$(window).click(function(t){e.$apply(function(){e.element.activeElement=null,e.element.focusedElement=null})})}}}]),angular.module("LayoutEditor").directive("orcLayoutCanvas",["scopeConfigurator","environment",function(e,t){return{restrict:"E",scope:{element:"="},controller:["$scope","$element","$attrs",function(t,o,n){e.configureForElement(t,o),e.configureForContainer(t,o),t.sortableOptions.axis="y"}],templateUrl:t.templateUrl("Canvas"),replace:!0}}]),angular.module("LayoutEditor").directive("orcLayoutChild",["$compile",function(e){return{restrict:"E",scope:{element:"="},link:function(t,o){var n="",l=e(n)(t);$(o).replaceWith(l)}}}]),angular.module("LayoutEditor").directive("orcLayoutColumn",["$compile","scopeConfigurator","environment",function(e,t,o){return{restrict:"E",scope:{element:"="},controller:["$scope","$element",function(e,o){t.configureForElement(e,o),t.configureForContainer(e,o),e.sortableOptions.axis="y"}],templateUrl:o.templateUrl("Column"),replace:!0,link:function(e,t,o){t.find(".layout-column-resize-bar").draggable({axis:"x",helper:"clone",revert:!0,start:function(t,o){e.$apply(function(){e.element.editor.isResizing=!0})},drag:function(o,n){var l=t.parent(),a=l.width()/e.element.width,r=!o.ctrlKey;if($(o.target).hasClass("layout-column-resize-bar-left")){var i=n.offset.left-l.offset().left;-a>i&&e.element.canExpandLeft(r)?e.$apply(function(){e.element.expandLeft(r)}):i>a&&e.element.canContractLeft(r)&&e.$apply(function(){e.element.contractLeft(r)})}else if($(o.target).hasClass("layout-column-resize-bar-right")){var i=n.offset.left-l.width()-l.offset().left;i>a&&e.element.canExpandRight(r)?e.$apply(function(){e.element.expandRight(r)}):-a>i&&e.element.canContractRight(r)&&e.$apply(function(){e.element.contractRight(r)})}},stop:function(t,o){e.$apply(function(){e.element.editor.isResizing=!1})}})}}}]),angular.module("LayoutEditor").directive("orcLayoutContent",["$sce","scopeConfigurator","environment",function(e,t,o){return{restrict:"E",scope:{element:"="},controller:["$scope","$element",function(o,n){t.configureForElement(o,n),o.element.setHtml=function(t){o.element.html=t,o.element.htmlUnsafe=e.trustAsHtml(t)},o.element.setHtml(o.element.html)}],templateUrl:o.templateUrl("Content"),replace:!0}}]),angular.module("LayoutEditor").directive("orcLayoutGrid",["$compile","scopeConfigurator","environment",function(e,t,o){return{restrict:"E",scope:{element:"="},controller:["$scope","$element",function(e,o){t.configureForElement(e,o),t.configureForContainer(e,o),e.sortableOptions.axis="y"}],templateUrl:o.templateUrl("Grid"),replace:!0}}]),angular.module("LayoutEditor").directive("orcLayoutRow",["$compile","scopeConfigurator","environment",function(e,t,o){return{restrict:"E",scope:{element:"="},controller:["$scope","$element",function(e,o){t.configureForElement(e,o),t.configureForContainer(e,o),e.sortableOptions.axis="x",e.sortableOptions["ui-floating"]=!0}],templateUrl:o.templateUrl("Row"),replace:!0}}]),angular.module("LayoutEditor").directive("orcLayoutPopup",[function(){return{restrict:"A",link:function(e,t,o){var n=$(t),l=n.closest(".layout-popup-trigger"),a=n.closest(".layout-element");l.click(function(){n.toggle(),n.is(":visible")&&(n.position({my:o.orcLayoutPopupMy||"left top",at:o.orcLayoutPopupAt||"left bottom+4px",of:l}),n.find("input").first().focus())}),n.click(function(e){e.stopPropagation()}),a.click(function(e){n.hide()}),n.keydown(function(e){e.ctrlKey||e.shiftKey||e.altKey||27!=e.which||n.hide(),e.stopPropagation()}),n.on("cut copy paste",function(e){e.stopPropagation()})}}}]),angular.module("LayoutEditor").directive("orcLayoutToolbox",["$compile","environment",function(e,t){return{restrict:"E",controller:["$scope","$element",function(e,t){e.resetElements=function(){e.gridElements=[LayoutEditor.Grid.from({toolboxIcon:"",toolboxLabel:"Grid",toolboxDescription:"Empty grid.",children:[]})],e.rowElements=[LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (1 column)",toolboxDescription:"Row with 1 column.",children:LayoutEditor.Column.times(1)}),LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (2 columns)",toolboxDescription:"Row with 2 columns.",children:LayoutEditor.Column.times(2)}),LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (3 columns)",toolboxDescription:"Row with 3 columns.",children:LayoutEditor.Column.times(3)}),LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (4 columns)",toolboxDescription:"Row with 4 columns.",children:LayoutEditor.Column.times(4)}),LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (6 columns)",toolboxDescription:"Row with 6 columns.",children:LayoutEditor.Column.times(6)}),LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (12 columns)",toolboxDescription:"Row with 12 columns.",children:LayoutEditor.Column.times(12)}),LayoutEditor.Row.from({toolboxIcon:"",toolboxLabel:"Row (empty)",toolboxDescription:"Empty row.",children:[]})],e.columnElements=[LayoutEditor.Column.from({toolboxIcon:"",toolboxLabel:"Column",toolboxDescription:"Empty column.",width:1,offset:0,children:[]})],e.canvasElements=[LayoutEditor.Canvas.from({toolboxIcon:"",toolboxLabel:"Canvas",toolboxDescription:"Empty canvas.",children:[]})],e.contentElementCategories=_(e.element.config.categories).map(function(e){return{name:e.name,elements:_(e.contentTypes).map(function(e){var t=e.type,o=LayoutEditor.factories[t]||LayoutEditor.factories.Content,n={isTemplated:!1,contentType:e.id,contentTypeLabel:e.label,contentTypeClass:e.typeClass,data:null,hasEditor:e.hasEditor,html:e.html},l=o(n);return l.toolboxIcon=e.icon||"",l.toolboxLabel=e.label,l.toolboxDescription=e.description,l})}})},e.resetElements(),e.getSortableOptions=function(o){var n,l,a=t.closest(".layout-editor").attr("id"),r=!1;switch(o){case"Grid":n=[".layout-canvas",".layout-column",".layout-common-holder"],l="layout-element layout-container layout-grid ui-sortable-placeholder";break;case"Row":n=[".layout-grid"],l="layout-element layout-container layout-row row ui-sortable-placeholder";break;case"Column":n=[".layout-row:not(.layout-row-full)"],l="layout-element layout-container layout-column ui-sortable-placeholder",r=!0;break;case"Content":n=[".layout-canvas",".layout-column",".layout-common-holder"],l="layout-element layout-content ui-sortable-placeholder";break;case"Canvas":n=[".layout-canvas",".layout-column",".layout-common-holder"],l="layout-element layout-container layout-grid ui-sortable-placeholder"}return{cursor:"move",connectWith:_(n).map(function(e){return"#"+a+" "+e+":not(.layout-container-sealed) > .layout-element-wrapper > .layout-children"}).join(", "),placeholder:l,"ui-floating":r,create:function(e,t){e.target.isToolbox=!0},start:function(t,o){e.$apply(function(){e.element.isDragging=!0})},stop:function(t,o){e.$apply(function(){e.element.isDragging=!1,e.resetElements()})},over:function(t,o){e.$apply(function(){e.element.canvas.setIsDropTarget(!1)})}}};var o="layoutToolboxCategory_Layout_IsCollapsed";e.layoutIsCollapsed="true"===$.cookie(o),e.toggleLayoutIsCollapsed=function(t){e.layoutIsCollapsed=!e.layoutIsCollapsed,$.cookie(o,e.layoutIsCollapsed,{expires:365}),t.preventDefault(),t.stopPropagation()}}],templateUrl:t.templateUrl("Toolbox"),replace:!0,link:function(e,t){var o=t.find(".layout-toolbox");$(window).on("resize scroll",function(e){var n=t.parent().find(".layout-canvas"),l=!!n&&n.height()>o.height(),a=$(window).scrollTop();l&&a>t.offset().top+t.height()-o.height()?(o.addClass("sticky-bottom"),o.removeClass("sticky-top")):l&&a>t.offset().top?(o.addClass("sticky-top"),o.removeClass("sticky-bottom")):(o.removeClass("sticky-top"),o.removeClass("sticky-bottom"))})}}}]),angular.module("LayoutEditor").directive("orcLayoutToolboxGroup",["$compile","environment",function(e,t){return{restrict:"E",scope:{category:"="},controller:["$scope","$element",function(e,t){var o="layoutToolboxCategory_"+e.category.name+"_IsCollapsed";e.isCollapsed="true"===$.cookie(o),e.toggleIsCollapsed=function(t){e.isCollapsed=!e.isCollapsed,$.cookie(o,e.isCollapsed,{expires:365}),t.preventDefault(),t.stopPropagation()}}],templateUrl:t.templateUrl("ToolboxGroup"),replace:!0}}]); diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/Lib.js b/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/Lib.js deleted file mode 100644 index 652518c0778..00000000000 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Scripts/Lib.js +++ /dev/null @@ -1,28828 +0,0 @@ -// Underscore.js 1.7.0 -// http://underscorejs.org -// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `exports` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var - push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.7.0'; - - // Internal function that returns an efficient (for current engines) version - // of the passed-in callback, to be repeatedly applied in other Underscore - // functions. - var createCallback = function(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - case 2: return function(value, other) { - return func.call(context, value, other); - }; - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; - }; - - // A mostly-internal function to generate callbacks that can be applied - // to each element in a collection, returning the desired result — either - // identity, an arbitrary callback, a property matcher, or a property accessor. - _.iteratee = function(value, context, argCount) { - if (value == null) return _.identity; - if (_.isFunction(value)) return createCallback(value, context, argCount); - if (_.isObject(value)) return _.matches(value); - return _.property(value); - }; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles raw objects in addition to array-likes. Treats all - // sparse array-likes as if they were dense. - _.each = _.forEach = function(obj, iteratee, context) { - if (obj == null) return obj; - iteratee = createCallback(iteratee, context); - var i, length = obj.length; - if (length === +length) { - for (i = 0; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var keys = _.keys(obj); - for (i = 0, length = keys.length; i < length; i++) { - iteratee(obj[keys[i]], keys[i], obj); - } - } - return obj; - }; - - // Return the results of applying the iteratee to each element. - _.map = _.collect = function(obj, iteratee, context) { - if (obj == null) return []; - iteratee = _.iteratee(iteratee, context); - var keys = obj.length !== +obj.length && _.keys(obj), - length = (keys || obj).length, - results = Array(length), - currentKey; - for (var index = 0; index < length; index++) { - currentKey = keys ? keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - }; - - var reduceError = 'Reduce of empty array with no initial value'; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. - _.reduce = _.foldl = _.inject = function(obj, iteratee, memo, context) { - if (obj == null) obj = []; - iteratee = createCallback(iteratee, context, 4); - var keys = obj.length !== +obj.length && _.keys(obj), - length = (keys || obj).length, - index = 0, currentKey; - if (arguments.length < 3) { - if (!length) throw new TypeError(reduceError); - memo = obj[keys ? keys[index++] : index++]; - } - for (; index < length; index++) { - currentKey = keys ? keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - _.reduceRight = _.foldr = function(obj, iteratee, memo, context) { - if (obj == null) obj = []; - iteratee = createCallback(iteratee, context, 4); - var keys = obj.length !== + obj.length && _.keys(obj), - index = (keys || obj).length, - currentKey; - if (arguments.length < 3) { - if (!index) throw new TypeError(reduceError); - memo = obj[keys ? keys[--index] : --index]; - } - while (index--) { - currentKey = keys ? keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, predicate, context) { - var result; - predicate = _.iteratee(predicate, context); - _.some(obj, function(value, index, list) { - if (predicate(value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Aliased as `select`. - _.filter = _.select = function(obj, predicate, context) { - var results = []; - if (obj == null) return results; - predicate = _.iteratee(predicate, context); - _.each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, predicate, context) { - return _.filter(obj, _.negate(_.iteratee(predicate)), context); - }; - - // Determine whether all of the elements match a truth test. - // Aliased as `all`. - _.every = _.all = function(obj, predicate, context) { - if (obj == null) return true; - predicate = _.iteratee(predicate, context); - var keys = obj.length !== +obj.length && _.keys(obj), - length = (keys || obj).length, - index, currentKey; - for (index = 0; index < length; index++) { - currentKey = keys ? keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; - } - return true; - }; - - // Determine if at least one element in the object matches a truth test. - // Aliased as `any`. - _.some = _.any = function(obj, predicate, context) { - if (obj == null) return false; - predicate = _.iteratee(predicate, context); - var keys = obj.length !== +obj.length && _.keys(obj), - length = (keys || obj).length, - index, currentKey; - for (index = 0; index < length; index++) { - currentKey = keys ? keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function(obj, target) { - if (obj == null) return false; - if (obj.length !== +obj.length) obj = _.values(obj); - return _.indexOf(obj, target) >= 0; - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - return (isFunc ? method : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, _.property(key)); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs) { - return _.filter(obj, _.matches(attrs)); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.find(obj, _.matches(attrs)); - }; - - // Return the maximum element (or element-based computation). - _.max = function(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null && obj != null) { - obj = obj.length === +obj.length ? obj : _.values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value > result) { - result = value; - } - } - } else { - iteratee = _.iteratee(iteratee, context); - _.each(obj, function(value, index, list) { - computed = iteratee(value, index, list); - if (computed > lastComputed || computed === -Infinity && result === -Infinity) { - result = value; - lastComputed = computed; - } - }); - } - return result; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null && obj != null) { - obj = obj.length === +obj.length ? obj : _.values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value < result) { - result = value; - } - } - } else { - iteratee = _.iteratee(iteratee, context); - _.each(obj, function(value, index, list) { - computed = iteratee(value, index, list); - if (computed < lastComputed || computed === Infinity && result === Infinity) { - result = value; - lastComputed = computed; - } - }); - } - return result; - }; - - // Shuffle a collection, using the modern version of the - // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). - _.shuffle = function(obj) { - var set = obj && obj.length === +obj.length ? obj : _.values(obj); - var length = set.length; - var shuffled = Array(length); - for (var index = 0, rand; index < length; index++) { - rand = _.random(0, index); - if (rand !== index) shuffled[index] = shuffled[rand]; - shuffled[rand] = set[index]; - } - return shuffled; - }; - - // Sample **n** random values from a collection. - // If **n** is not specified, returns a single random element. - // The internal `guard` argument allows it to work with `map`. - _.sample = function(obj, n, guard) { - if (n == null || guard) { - if (obj.length !== +obj.length) obj = _.values(obj); - return obj[_.random(obj.length - 1)]; - } - return _.shuffle(obj).slice(0, Math.max(0, n)); - }; - - // Sort the object's values by a criterion produced by an iteratee. - _.sortBy = function(obj, iteratee, context) { - iteratee = _.iteratee(iteratee, context); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value: value, - index: index, - criteria: iteratee(value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(behavior) { - return function(obj, iteratee, context) { - var result = {}; - iteratee = _.iteratee(iteratee, context); - _.each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = group(function(result, value, key) { - if (_.has(result, key)) result[key].push(value); else result[key] = [value]; - }); - - // Indexes the object's values by a criterion, similar to `groupBy`, but for - // when you know that your index values will be unique. - _.indexBy = group(function(result, value, key) { - result[key] = value; - }); - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = group(function(result, value, key) { - if (_.has(result, key)) result[key]++; else result[key] = 1; - }); - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iteratee, context) { - iteratee = _.iteratee(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = array.length; - while (low < high) { - var mid = low + high >>> 1; - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; - }; - - // Safely create a real, live array from anything iterable. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (obj.length === +obj.length) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return obj.length === +obj.length ? obj.length : _.keys(obj).length; - }; - - // Split a collection into two arrays: one whose elements all satisfy the given - // predicate, and one whose elements all do not satisfy the predicate. - _.partition = function(obj, predicate, context) { - predicate = _.iteratee(predicate, context); - var pass = [], fail = []; - _.each(obj, function(value, key, obj) { - (predicate(value, key, obj) ? pass : fail).push(value); - }); - return [pass, fail]; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - if (n == null || guard) return array[0]; - if (n < 0) return []; - return slice.call(array, 0, n); - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if (n == null || guard) return array[array.length - 1]; - return slice.call(array, Math.max(array.length - n, 0)); - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, strict, output) { - if (shallow && _.every(input, _.isArray)) { - return concat.apply(output, input); - } - for (var i = 0, length = input.length; i < length; i++) { - var value = input[i]; - if (!_.isArray(value) && !_.isArguments(value)) { - if (!strict) output.push(value); - } else if (shallow) { - push.apply(output, value); - } else { - flatten(value, shallow, strict, output); - } - } - return output; - }; - - // Flatten out an array, either recursively (by default), or just one level. - _.flatten = function(array, shallow) { - return flatten(array, shallow, false, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iteratee, context) { - if (array == null) return []; - if (!_.isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = _.iteratee(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = array.length; i < length; i++) { - var value = array[i]; - if (isSorted) { - if (!i || seen !== value) result.push(value); - seen = value; - } else if (iteratee) { - var computed = iteratee(value, i, array); - if (_.indexOf(seen, computed) < 0) { - seen.push(computed); - result.push(value); - } - } else if (_.indexOf(result, value) < 0) { - result.push(value); - } - } - return result; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(flatten(arguments, true, true, [])); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - if (array == null) return []; - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = array.length; i < length; i++) { - var item = array[i]; - if (_.contains(result, item)) continue; - for (var j = 1; j < argsLength; j++) { - if (!_.contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = flatten(slice.call(arguments, 1), true, true, []); - return _.filter(array, function(value){ - return !_.contains(rest, value); - }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function(array) { - if (array == null) return []; - var length = _.max(arguments, 'length').length; - var results = Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(arguments, i); - } - return results; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, length = list.length; i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // Return the position of the first occurrence of an item in an array, - // or -1 if the item is not included in the array. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i = 0, length = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted; - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - for (; i < length; i++) if (array[i] === item) return i; - return -1; - }; - - _.lastIndexOf = function(array, item, from) { - if (array == null) return -1; - var idx = array.length; - if (typeof from == 'number') { - idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1); - } - while (--idx >= 0) if (array[idx] === item) return idx; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = step || 1; - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Reusable constructor function for prototype setting. - var Ctor = function(){}; - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - var args, bound; - if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); - args = slice.call(arguments, 2); - bound = function() { - if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); - Ctor.prototype = func.prototype; - var self = new Ctor; - Ctor.prototype = null; - var result = func.apply(self, args.concat(slice.call(arguments))); - if (_.isObject(result)) return result; - return self; - }; - return bound; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. _ acts - // as a placeholder, allowing any combination of arguments to be pre-filled. - _.partial = function(func) { - var boundArgs = slice.call(arguments, 1); - return function() { - var position = 0; - var args = boundArgs.slice(); - for (var i = 0, length = args.length; i < length; i++) { - if (args[i] === _) args[i] = arguments[position++]; - } - while (position < arguments.length) args.push(arguments[position++]); - return func.apply(this, args); - }; - }; - - // Bind a number of an object's methods to that object. Remaining arguments - // are the method names to be bound. Useful for ensuring that all callbacks - // defined on an object belong to it. - _.bindAll = function(obj) { - var i, length = arguments.length, key; - if (length <= 1) throw new Error('bindAll must be passed function names'); - for (i = 1; i < length; i++) { - key = arguments[i]; - obj[key] = _.bind(obj[key], obj); - } - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = hasher ? hasher.apply(this, arguments) : key; - if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ - return func.apply(null, args); - }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. Normally, the throttled function will run - // as much as it can, without ever going more than once per `wait` duration; - // but if you'd like to disable the execution on the leading edge, pass - // `{leading: false}`. To disable execution on the trailing edge, ditto. - _.throttle = function(func, wait, options) { - var context, args, result; - var timeout = null; - var previous = 0; - if (!options) options = {}; - var later = function() { - previous = options.leading === false ? 0 : _.now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - return function() { - var now = _.now(); - if (!previous && options.leading === false) previous = now; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, args, context, timestamp, result; - - var later = function() { - var last = _.now() - timestamp; - - if (last < wait && last > 0) { - timeout = setTimeout(later, wait - last); - } else { - timeout = null; - if (!immediate) { - result = func.apply(context, args); - if (!timeout) context = args = null; - } - } - }; - - return function() { - context = this; - args = arguments; - timestamp = _.now(); - var callNow = immediate && !timeout; - if (!timeout) timeout = setTimeout(later, wait); - if (callNow) { - result = func.apply(context, args); - context = args = null; - } - - return result; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return _.partial(wrapper, func); - }; - - // Returns a negated version of the passed-in predicate. - _.negate = function(predicate) { - return function() { - return !predicate.apply(this, arguments); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Returns a function that will only be executed before being called N times. - _.before = function(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } else { - func = null; - } - return memo; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = _.partial(_.before, 2); - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = function(obj) { - if (!_.isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys.push(key); - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[keys[i]]; - } - return values; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [keys[i], obj[keys[i]]]; - } - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - result[obj[keys[i]]] = keys[i]; - } - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - if (!_.isObject(obj)) return obj; - var source, prop; - for (var i = 1, length = arguments.length; i < length; i++) { - source = arguments[i]; - for (prop in source) { - if (hasOwnProperty.call(source, prop)) { - obj[prop] = source[prop]; - } - } - } - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj, iteratee, context) { - var result = {}, key; - if (obj == null) return result; - if (_.isFunction(iteratee)) { - iteratee = createCallback(iteratee, context); - for (key in obj) { - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - } else { - var keys = concat.apply([], slice.call(arguments, 1)); - obj = new Object(obj); - for (var i = 0, length = keys.length; i < length; i++) { - key = keys[i]; - if (key in obj) result[key] = obj[key]; - } - } - return result; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj, iteratee, context) { - if (_.isFunction(iteratee)) { - iteratee = _.negate(iteratee); - } else { - var keys = _.map(concat.apply([], slice.call(arguments, 1)), String); - iteratee = function(value, key) { - return !_.contains(keys, key); - }; - } - return _.pick(obj, iteratee, context); - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - if (!_.isObject(obj)) return obj; - for (var i = 1, length = arguments.length; i < length; i++) { - var source = arguments[i]; - for (var prop in source) { - if (obj[prop] === void 0) obj[prop] = source[prop]; - } - } - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className !== toString.call(b)) return false; - switch (className) { - // Strings, numbers, regular expressions, dates, and booleans are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a === +b; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if ( - aCtor !== bCtor && - // Handle Object.create(x) cases - 'constructor' in a && 'constructor' in b && - !(_.isFunction(aCtor) && aCtor instanceof aCtor && - _.isFunction(bCtor) && bCtor instanceof bCtor) - ) { - return false; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size, result; - // Recursively compare objects and arrays. - if (className === '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size === b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Deep compare objects. - var keys = _.keys(a), key; - size = keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - result = _.keys(b).length === size; - if (result) { - while (size--) { - // Deep compare each member - key = keys[size]; - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, [], []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) === '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - var type = typeof obj; - return type === 'function' || type === 'object' && !!obj; - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) === '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return _.has(obj, 'callee'); - }; - } - - // Optimize `isFunction` if appropriate. Work around an IE 11 bug. - if (typeof /./ !== 'function') { - _.isFunction = function(obj) { - return typeof obj == 'function' || false; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj !== +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return obj != null && hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iteratees. - _.identity = function(value) { - return value; - }; - - // Predicate-generating functions. Often useful outside of Underscore. - _.constant = function(value) { - return function() { - return value; - }; - }; - - _.noop = function(){}; - - _.property = function(key) { - return function(obj) { - return obj[key]; - }; - }; - - // Returns a predicate for checking whether an object has a given set of `key:value` pairs. - _.matches = function(attrs) { - var pairs = _.pairs(attrs), length = pairs.length; - return function(obj) { - if (obj == null) return !length; - obj = new Object(obj); - for (var i = 0; i < length; i++) { - var pair = pairs[i], key = pair[0]; - if (pair[1] !== obj[key] || !(key in obj)) return false; - } - return true; - }; - }; - - // Run a function **n** times. - _.times = function(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = createCallback(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // A (possibly faster) way to get the current timestamp as an integer. - _.now = Date.now || function() { - return new Date().getTime(); - }; - - // List of HTML entities for escaping. - var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - var unescapeMap = _.invert(escapeMap); - - // Functions for escaping and unescaping strings to/from HTML interpolation. - var createEscaper = function(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped - var source = '(?:' + _.keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; - }; - _.escape = createEscaper(escapeMap); - _.unescape = createEscaper(unescapeMap); - - // If the value of the named `property` is a function then invoke it with the - // `object` as context; otherwise, return it. - _.result = function(object, property) { - if (object == null) return void 0; - var value = object[property]; - return _.isFunction(value) ? object[property]() : value; - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\u2028|\u2029/g; - - var escapeChar = function(match) { - return '\\' + escapes[match]; - }; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - // NB: `oldSettings` only exists for backwards compatibility. - _.template = function(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escaper, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - - // Adobe VMs need the match returned to produce the correct offest. - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; - - try { - var render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled source as a convenience for precompilation. - var argument = settings.variable || 'obj'; - template.source = 'function(' + argument + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function. Start chaining a wrapped Underscore object. - _.chain = function(obj) { - var instance = _(obj); - instance._chain = true; - return instance; - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(obj) { - return this._chain ? _(obj).chain() : obj; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - _.each(_.functions(obj), function(name) { - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - _.each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); - - // Extracts the result from a wrapped and chained object. - _.prototype.value = function() { - return this._wrapped; - }; - - // AMD registration happens at the end for compatibility with AMD loaders - // that may not enforce next-turn semantics on modules. Even though general - // practice for AMD registration is to be anonymous, underscore registers - // as a named module because, like jQuery, it is a base library that is - // popular enough to be bundled in a third party lib, but not be part of - // an AMD load request. Those cases could generate an error when an - // anonymous define() is called outside of a loader request. - if (typeof define === 'function' && define.amd) { - define('underscore', [], function() { - return _; - }); - } -}.call(this)); - -/** - * @license AngularJS v1.3.3 - * (c) 2010-2014 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, document, undefined) {'use strict'; - -/** - * @description - * - * This object provides a utility for producing rich Error messages within - * Angular. It can be called as follows: - * - * var exampleMinErr = minErr('example'); - * throw exampleMinErr('one', 'This {0} is {1}', foo, bar); - * - * The above creates an instance of minErr in the example namespace. The - * resulting error will have a namespaced error code of example.one. The - * resulting error will replace {0} with the value of foo, and {1} with the - * value of bar. The object is not restricted in the number of arguments it can - * take. - * - * If fewer arguments are specified than necessary for interpolation, the extra - * interpolation markers will be preserved in the final string. - * - * Since data will be parsed statically during a build step, some restrictions - * are applied with respect to how minErr instances are created and called. - * Instances should have names of the form namespaceMinErr for a minErr created - * using minErr('namespace') . Error codes, namespaces and template strings - * should all be static strings, not variables or general expressions. - * - * @param {string} module The namespace to use for the new minErr instance. - * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning - * error from returned function, for cases when a particular type of error is useful. - * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance - */ - -function minErr(module, ErrorConstructor) { - ErrorConstructor = ErrorConstructor || Error; - return function() { - var code = arguments[0], - prefix = '[' + (module ? module + ':' : '') + code + '] ', - template = arguments[1], - templateArgs = arguments, - - message, i; - - message = prefix + template.replace(/\{\d+\}/g, function(match) { - var index = +match.slice(1, -1), arg; - - if (index + 2 < templateArgs.length) { - return toDebugString(templateArgs[index + 2]); - } - return match; - }); - - message = message + '\nhttp://errors.angularjs.org/1.3.3/' + - (module ? module + '/' : '') + code; - for (i = 2; i < arguments.length; i++) { - message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' + - encodeURIComponent(toDebugString(arguments[i])); - } - return new ErrorConstructor(message); - }; -} - -/* We need to tell jshint what variables are being exported */ -/* global angular: true, - msie: true, - jqLite: true, - jQuery: true, - slice: true, - splice: true, - push: true, - toString: true, - ngMinErr: true, - angularModule: true, - uid: true, - REGEX_STRING_REGEXP: true, - VALIDITY_STATE_PROPERTY: true, - - lowercase: true, - uppercase: true, - manualLowercase: true, - manualUppercase: true, - nodeName_: true, - isArrayLike: true, - forEach: true, - sortedKeys: true, - forEachSorted: true, - reverseParams: true, - nextUid: true, - setHashKey: true, - extend: true, - int: true, - inherit: true, - noop: true, - identity: true, - valueFn: true, - isUndefined: true, - isDefined: true, - isObject: true, - isString: true, - isNumber: true, - isDate: true, - isArray: true, - isFunction: true, - isRegExp: true, - isWindow: true, - isScope: true, - isFile: true, - isBlob: true, - isBoolean: true, - isPromiseLike: true, - trim: true, - escapeForRegexp: true, - isElement: true, - makeMap: true, - includes: true, - arrayRemove: true, - copy: true, - shallowCopy: true, - equals: true, - csp: true, - concat: true, - sliceArgs: true, - bind: true, - toJsonReplacer: true, - toJson: true, - fromJson: true, - startingTag: true, - tryDecodeURIComponent: true, - parseKeyValue: true, - toKeyValue: true, - encodeUriSegment: true, - encodeUriQuery: true, - angularInit: true, - bootstrap: true, - getTestability: true, - snake_case: true, - bindJQuery: true, - assertArg: true, - assertArgFn: true, - assertNotHasOwnProperty: true, - getter: true, - getBlockNodes: true, - hasOwnProperty: true, - createMap: true, - - NODE_TYPE_ELEMENT: true, - NODE_TYPE_TEXT: true, - NODE_TYPE_COMMENT: true, - NODE_TYPE_DOCUMENT: true, - NODE_TYPE_DOCUMENT_FRAGMENT: true, -*/ - -//////////////////////////////////// - -/** - * @ngdoc module - * @name ng - * @module ng - * @description - * - * # ng (core module) - * The ng module is loaded by default when an AngularJS application is started. The module itself - * contains the essential components for an AngularJS application to function. The table below - * lists a high level breakdown of each of the services/factories, filters, directives and testing - * components available within this core module. - * - *
- */ - -var REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/; - -// The name of a form control's ValidityState property. -// This is used so that it's possible for internal tests to create mock ValidityStates. -var VALIDITY_STATE_PROPERTY = 'validity'; - -/** - * @ngdoc function - * @name angular.lowercase - * @module ng - * @kind function - * - * @description Converts the specified string to lowercase. - * @param {string} string String to be converted to lowercase. - * @returns {string} Lowercased string. - */ -var lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;}; -var hasOwnProperty = Object.prototype.hasOwnProperty; - -/** - * @ngdoc function - * @name angular.uppercase - * @module ng - * @kind function - * - * @description Converts the specified string to uppercase. - * @param {string} string String to be converted to uppercase. - * @returns {string} Uppercased string. - */ -var uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;}; - - -var manualLowercase = function(s) { - /* jshint bitwise: false */ - return isString(s) - ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);}) - : s; -}; -var manualUppercase = function(s) { - /* jshint bitwise: false */ - return isString(s) - ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);}) - : s; -}; - - -// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish -// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods -// with correct but slower alternatives. -if ('i' !== 'I'.toLowerCase()) { - lowercase = manualLowercase; - uppercase = manualUppercase; -} - - -var /** holds major version number for IE or NaN for real browsers */ - msie, - jqLite, // delay binding since jQuery could be loaded after us. - jQuery, // delay binding - slice = [].slice, - splice = [].splice, - push = [].push, - toString = Object.prototype.toString, - ngMinErr = minErr('ng'), - - /** @name angular */ - angular = window.angular || (window.angular = {}), - angularModule, - uid = 0; - -/** - * documentMode is an IE-only property - * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx - */ -msie = document.documentMode; - - -/** - * @private - * @param {*} obj - * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, - * String ...) - */ -function isArrayLike(obj) { - if (obj == null || isWindow(obj)) { - return false; - } - - var length = obj.length; - - if (obj.nodeType === NODE_TYPE_ELEMENT && length) { - return true; - } - - return isString(obj) || isArray(obj) || length === 0 || - typeof length === 'number' && length > 0 && (length - 1) in obj; -} - -/** - * @ngdoc function - * @name angular.forEach - * @module ng - * @kind function - * - * @description - * Invokes the `iterator` function once for each item in `obj` collection, which can be either an - * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value` - * is the value of an object property or an array element, `key` is the object property key or - * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional. - * - * It is worth noting that `.forEach` does not iterate over inherited properties because it filters - * using the `hasOwnProperty` method. - * - * Unlike ES262's - * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18), - * Providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just - * return the value provided. - * - ```js - var values = {name: 'misko', gender: 'male'}; - var log = []; - angular.forEach(values, function(value, key) { - this.push(key + ': ' + value); - }, log); - expect(log).toEqual(['name: misko', 'gender: male']); - ``` - * - * @param {Object|Array} obj Object to iterate over. - * @param {Function} iterator Iterator function. - * @param {Object=} context Object to become context (`this`) for the iterator function. - * @returns {Object|Array} Reference to `obj`. - */ - -function forEach(obj, iterator, context) { - var key, length; - if (obj) { - if (isFunction(obj)) { - for (key in obj) { - // Need to check if hasOwnProperty exists, - // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function - if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) { - iterator.call(context, obj[key], key, obj); - } - } - } else if (isArray(obj) || isArrayLike(obj)) { - var isPrimitive = typeof obj !== 'object'; - for (key = 0, length = obj.length; key < length; key++) { - if (isPrimitive || key in obj) { - iterator.call(context, obj[key], key, obj); - } - } - } else if (obj.forEach && obj.forEach !== forEach) { - obj.forEach(iterator, context, obj); - } else { - for (key in obj) { - if (obj.hasOwnProperty(key)) { - iterator.call(context, obj[key], key, obj); - } - } - } - } - return obj; -} - -function sortedKeys(obj) { - return Object.keys(obj).sort(); -} - -function forEachSorted(obj, iterator, context) { - var keys = sortedKeys(obj); - for (var i = 0; i < keys.length; i++) { - iterator.call(context, obj[keys[i]], keys[i]); - } - return keys; -} - - -/** - * when using forEach the params are value, key, but it is often useful to have key, value. - * @param {function(string, *)} iteratorFn - * @returns {function(*, string)} - */ -function reverseParams(iteratorFn) { - return function(value, key) { iteratorFn(key, value); }; -} - -/** - * A consistent way of creating unique IDs in angular. - * - * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before - * we hit number precision issues in JavaScript. - * - * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M - * - * @returns {number} an unique alpha-numeric string - */ -function nextUid() { - return ++uid; -} - - -/** - * Set or clear the hashkey for an object. - * @param obj object - * @param h the hashkey (!truthy to delete the hashkey) - */ -function setHashKey(obj, h) { - if (h) { - obj.$$hashKey = h; - } - else { - delete obj.$$hashKey; - } -} - -/** - * @ngdoc function - * @name angular.extend - * @module ng - * @kind function - * - * @description - * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s) - * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so - * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`. - * Note: Keep in mind that `angular.extend` does not support recursive merge (deep copy). - * - * @param {Object} dst Destination object. - * @param {...Object} src Source object(s). - * @returns {Object} Reference to `dst`. - */ -function extend(dst) { - var h = dst.$$hashKey; - - for (var i = 1, ii = arguments.length; i < ii; i++) { - var obj = arguments[i]; - if (obj) { - var keys = Object.keys(obj); - for (var j = 0, jj = keys.length; j < jj; j++) { - var key = keys[j]; - dst[key] = obj[key]; - } - } - } - - setHashKey(dst, h); - return dst; -} - -function int(str) { - return parseInt(str, 10); -} - - -function inherit(parent, extra) { - return extend(new (extend(function() {}, {prototype:parent}))(), extra); -} - -/** - * @ngdoc function - * @name angular.noop - * @module ng - * @kind function - * - * @description - * A function that performs no operations. This function can be useful when writing code in the - * functional style. - ```js - function foo(callback) { - var result = calculateResult(); - (callback || angular.noop)(result); - } - ``` - */ -function noop() {} -noop.$inject = []; - - -/** - * @ngdoc function - * @name angular.identity - * @module ng - * @kind function - * - * @description - * A function that returns its first argument. This function is useful when writing code in the - * functional style. - * - ```js - function transformer(transformationFn, value) { - return (transformationFn || angular.identity)(value); - }; - ``` - */ -function identity($) {return $;} -identity.$inject = []; - - -function valueFn(value) {return function() {return value;};} - -/** - * @ngdoc function - * @name angular.isUndefined - * @module ng - * @kind function - * - * @description - * Determines if a reference is undefined. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is undefined. - */ -function isUndefined(value) {return typeof value === 'undefined';} - - -/** - * @ngdoc function - * @name angular.isDefined - * @module ng - * @kind function - * - * @description - * Determines if a reference is defined. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is defined. - */ -function isDefined(value) {return typeof value !== 'undefined';} - - -/** - * @ngdoc function - * @name angular.isObject - * @module ng - * @kind function - * - * @description - * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not - * considered to be objects. Note that JavaScript arrays are objects. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is an `Object` but not `null`. - */ -function isObject(value) { - // http://jsperf.com/isobject4 - return value !== null && typeof value === 'object'; -} - - -/** - * @ngdoc function - * @name angular.isString - * @module ng - * @kind function - * - * @description - * Determines if a reference is a `String`. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `String`. - */ -function isString(value) {return typeof value === 'string';} - - -/** - * @ngdoc function - * @name angular.isNumber - * @module ng - * @kind function - * - * @description - * Determines if a reference is a `Number`. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `Number`. - */ -function isNumber(value) {return typeof value === 'number';} - - -/** - * @ngdoc function - * @name angular.isDate - * @module ng - * @kind function - * - * @description - * Determines if a value is a date. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `Date`. - */ -function isDate(value) { - return toString.call(value) === '[object Date]'; -} - - -/** - * @ngdoc function - * @name angular.isArray - * @module ng - * @kind function - * - * @description - * Determines if a reference is an `Array`. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is an `Array`. - */ -var isArray = Array.isArray; - -/** - * @ngdoc function - * @name angular.isFunction - * @module ng - * @kind function - * - * @description - * Determines if a reference is a `Function`. - * - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `Function`. - */ -function isFunction(value) {return typeof value === 'function';} - - -/** - * Determines if a value is a regular expression object. - * - * @private - * @param {*} value Reference to check. - * @returns {boolean} True if `value` is a `RegExp`. - */ -function isRegExp(value) { - return toString.call(value) === '[object RegExp]'; -} - - -/** - * Checks if `obj` is a window object. - * - * @private - * @param {*} obj Object to check - * @returns {boolean} True if `obj` is a window obj. - */ -function isWindow(obj) { - return obj && obj.window === obj; -} - - -function isScope(obj) { - return obj && obj.$evalAsync && obj.$watch; -} - - -function isFile(obj) { - return toString.call(obj) === '[object File]'; -} - - -function isBlob(obj) { - return toString.call(obj) === '[object Blob]'; -} - - -function isBoolean(value) { - return typeof value === 'boolean'; -} - - -function isPromiseLike(obj) { - return obj && isFunction(obj.then); -} - - -var trim = function(value) { - return isString(value) ? value.trim() : value; -}; - -// Copied from: -// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021 -// Prereq: s is a string. -var escapeForRegexp = function(s) { - return s.replace(/([-()\[\]{}+?*.$\^|,:#= 0) - array.splice(index, 1); - return value; -} - -/** - * @ngdoc function - * @name angular.copy - * @module ng - * @kind function - * - * @description - * Creates a deep copy of `source`, which should be an object or an array. - * - * * If no destination is supplied, a copy of the object or array is created. - * * If a destination is provided, all of its elements (for array) or properties (for objects) - * are deleted and then all elements/properties from the source are copied to it. - * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned. - * * If `source` is identical to 'destination' an exception will be thrown. - * - * @param {*} source The source that will be used to make a copy. - * Can be any type, including primitives, `null`, and `undefined`. - * @param {(Object|Array)=} destination Destination into which the source is copied. If - * provided, must be of the same type as `source`. - * @returns {*} The copy or updated `destination`, if `destination` was specified. - * - * @example - - -
- - Name:
- E-mail:
- Gender: male - female
- - - -
form = {{user | json}}
-
master = {{master | json}}
-
- - -
-
- */ -function copy(source, destination, stackSource, stackDest) { - if (isWindow(source) || isScope(source)) { - throw ngMinErr('cpws', - "Can't copy! Making copies of Window or Scope instances is not supported."); - } - - if (!destination) { - destination = source; - if (source) { - if (isArray(source)) { - destination = copy(source, [], stackSource, stackDest); - } else if (isDate(source)) { - destination = new Date(source.getTime()); - } else if (isRegExp(source)) { - destination = new RegExp(source.source, source.toString().match(/[^\/]*$/)[0]); - destination.lastIndex = source.lastIndex; - } else if (isObject(source)) { - var emptyObject = Object.create(Object.getPrototypeOf(source)); - destination = copy(source, emptyObject, stackSource, stackDest); - } - } - } else { - if (source === destination) throw ngMinErr('cpi', - "Can't copy! Source and destination are identical."); - - stackSource = stackSource || []; - stackDest = stackDest || []; - - if (isObject(source)) { - var index = stackSource.indexOf(source); - if (index !== -1) return stackDest[index]; - - stackSource.push(source); - stackDest.push(destination); - } - - var result; - if (isArray(source)) { - destination.length = 0; - for (var i = 0; i < source.length; i++) { - result = copy(source[i], null, stackSource, stackDest); - if (isObject(source[i])) { - stackSource.push(source[i]); - stackDest.push(result); - } - destination.push(result); - } - } else { - var h = destination.$$hashKey; - if (isArray(destination)) { - destination.length = 0; - } else { - forEach(destination, function(value, key) { - delete destination[key]; - }); - } - for (var key in source) { - if (source.hasOwnProperty(key)) { - result = copy(source[key], null, stackSource, stackDest); - if (isObject(source[key])) { - stackSource.push(source[key]); - stackDest.push(result); - } - destination[key] = result; - } - } - setHashKey(destination,h); - } - - } - return destination; -} - -/** - * Creates a shallow copy of an object, an array or a primitive. - * - * Assumes that there are no proto properties for objects. - */ -function shallowCopy(src, dst) { - if (isArray(src)) { - dst = dst || []; - - for (var i = 0, ii = src.length; i < ii; i++) { - dst[i] = src[i]; - } - } else if (isObject(src)) { - dst = dst || {}; - - for (var key in src) { - if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) { - dst[key] = src[key]; - } - } - } - - return dst || src; -} - - -/** - * @ngdoc function - * @name angular.equals - * @module ng - * @kind function - * - * @description - * Determines if two objects or two values are equivalent. Supports value types, regular - * expressions, arrays and objects. - * - * Two objects or values are considered equivalent if at least one of the following is true: - * - * * Both objects or values pass `===` comparison. - * * Both objects or values are of the same type and all of their properties are equal by - * comparing them with `angular.equals`. - * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal) - * * Both values represent the same regular expression (In JavaScript, - * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual - * representation matches). - * - * During a property comparison, properties of `function` type and properties with names - * that begin with `$` are ignored. - * - * Scope and DOMWindow objects are being compared only by identify (`===`). - * - * @param {*} o1 Object or value to compare. - * @param {*} o2 Object or value to compare. - * @returns {boolean} True if arguments are equal. - */ -function equals(o1, o2) { - if (o1 === o2) return true; - if (o1 === null || o2 === null) return false; - if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN - var t1 = typeof o1, t2 = typeof o2, length, key, keySet; - if (t1 == t2) { - if (t1 == 'object') { - if (isArray(o1)) { - if (!isArray(o2)) return false; - if ((length = o1.length) == o2.length) { - for (key = 0; key < length; key++) { - if (!equals(o1[key], o2[key])) return false; - } - return true; - } - } else if (isDate(o1)) { - if (!isDate(o2)) return false; - return equals(o1.getTime(), o2.getTime()); - } else if (isRegExp(o1) && isRegExp(o2)) { - return o1.toString() == o2.toString(); - } else { - if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) || isArray(o2)) return false; - keySet = {}; - for (key in o1) { - if (key.charAt(0) === '$' || isFunction(o1[key])) continue; - if (!equals(o1[key], o2[key])) return false; - keySet[key] = true; - } - for (key in o2) { - if (!keySet.hasOwnProperty(key) && - key.charAt(0) !== '$' && - o2[key] !== undefined && - !isFunction(o2[key])) return false; - } - return true; - } - } - } - return false; -} - -var csp = function() { - if (isDefined(csp.isActive_)) return csp.isActive_; - - var active = !!(document.querySelector('[ng-csp]') || - document.querySelector('[data-ng-csp]')); - - if (!active) { - try { - /* jshint -W031, -W054 */ - new Function(''); - /* jshint +W031, +W054 */ - } catch (e) { - active = true; - } - } - - return (csp.isActive_ = active); -}; - - - -function concat(array1, array2, index) { - return array1.concat(slice.call(array2, index)); -} - -function sliceArgs(args, startIndex) { - return slice.call(args, startIndex || 0); -} - - -/* jshint -W101 */ -/** - * @ngdoc function - * @name angular.bind - * @module ng - * @kind function - * - * @description - * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for - * `fn`). You can supply optional `args` that are prebound to the function. This feature is also - * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as - * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application). - * - * @param {Object} self Context which `fn` should be evaluated in. - * @param {function()} fn Function to be bound. - * @param {...*} args Optional arguments to be prebound to the `fn` function call. - * @returns {function()} Function that wraps the `fn` with all the specified bindings. - */ -/* jshint +W101 */ -function bind(self, fn) { - var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : []; - if (isFunction(fn) && !(fn instanceof RegExp)) { - return curryArgs.length - ? function() { - return arguments.length - ? fn.apply(self, concat(curryArgs, arguments, 0)) - : fn.apply(self, curryArgs); - } - : function() { - return arguments.length - ? fn.apply(self, arguments) - : fn.call(self); - }; - } else { - // in IE, native methods are not functions so they cannot be bound (note: they don't need to be) - return fn; - } -} - - -function toJsonReplacer(key, value) { - var val = value; - - if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') { - val = undefined; - } else if (isWindow(value)) { - val = '$WINDOW'; - } else if (value && document === value) { - val = '$DOCUMENT'; - } else if (isScope(value)) { - val = '$SCOPE'; - } - - return val; -} - - -/** - * @ngdoc function - * @name angular.toJson - * @module ng - * @kind function - * - * @description - * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be - * stripped since angular uses this notation internally. - * - * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON. - * @param {boolean=} pretty If set to true, the JSON output will contain newlines and whitespace. - * @returns {string|undefined} JSON-ified string representing `obj`. - */ -function toJson(obj, pretty) { - if (typeof obj === 'undefined') return undefined; - return JSON.stringify(obj, toJsonReplacer, pretty ? ' ' : null); -} - - -/** - * @ngdoc function - * @name angular.fromJson - * @module ng - * @kind function - * - * @description - * Deserializes a JSON string. - * - * @param {string} json JSON string to deserialize. - * @returns {Object|Array|string|number} Deserialized thingy. - */ -function fromJson(json) { - return isString(json) - ? JSON.parse(json) - : json; -} - - -/** - * @returns {string} Returns the string representation of the element. - */ -function startingTag(element) { - element = jqLite(element).clone(); - try { - // turns out IE does not let you set .html() on elements which - // are not allowed to have children. So we just ignore it. - element.empty(); - } catch (e) {} - var elemHtml = jqLite('
').append(element).html(); - try { - return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) : - elemHtml. - match(/^(<[^>]+>)/)[1]. - replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); }); - } catch (e) { - return lowercase(elemHtml); - } - -} - - -///////////////////////////////////////////////// - -/** - * Tries to decode the URI component without throwing an exception. - * - * @private - * @param str value potential URI component to check. - * @returns {boolean} True if `value` can be decoded - * with the decodeURIComponent function. - */ -function tryDecodeURIComponent(value) { - try { - return decodeURIComponent(value); - } catch (e) { - // Ignore any invalid uri component - } -} - - -/** - * Parses an escaped url query string into key-value pairs. - * @returns {Object.} - */ -function parseKeyValue(/**string*/keyValue) { - var obj = {}, key_value, key; - forEach((keyValue || "").split('&'), function(keyValue) { - if (keyValue) { - key_value = keyValue.replace(/\+/g,'%20').split('='); - key = tryDecodeURIComponent(key_value[0]); - if (isDefined(key)) { - var val = isDefined(key_value[1]) ? tryDecodeURIComponent(key_value[1]) : true; - if (!hasOwnProperty.call(obj, key)) { - obj[key] = val; - } else if (isArray(obj[key])) { - obj[key].push(val); - } else { - obj[key] = [obj[key],val]; - } - } - } - }); - return obj; -} - -function toKeyValue(obj) { - var parts = []; - forEach(obj, function(value, key) { - if (isArray(value)) { - forEach(value, function(arrayValue) { - parts.push(encodeUriQuery(key, true) + - (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true))); - }); - } else { - parts.push(encodeUriQuery(key, true) + - (value === true ? '' : '=' + encodeUriQuery(value, true))); - } - }); - return parts.length ? parts.join('&') : ''; -} - - -/** - * We need our custom method because encodeURIComponent is too aggressive and doesn't follow - * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path - * segments: - * segment = *pchar - * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - * pct-encoded = "%" HEXDIG HEXDIG - * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" - * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" - * / "*" / "+" / "," / ";" / "=" - */ -function encodeUriSegment(val) { - return encodeUriQuery(val, true). - replace(/%26/gi, '&'). - replace(/%3D/gi, '='). - replace(/%2B/gi, '+'); -} - - -/** - * This method is intended for encoding *key* or *value* parts of query component. We need a custom - * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be - * encoded per http://tools.ietf.org/html/rfc3986: - * query = *( pchar / "/" / "?" ) - * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" - * pct-encoded = "%" HEXDIG HEXDIG - * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" - * / "*" / "+" / "," / ";" / "=" - */ -function encodeUriQuery(val, pctEncodeSpaces) { - return encodeURIComponent(val). - replace(/%40/gi, '@'). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%3B/gi, ';'). - replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); -} - -var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-']; - -function getNgAttribute(element, ngAttr) { - var attr, i, ii = ngAttrPrefixes.length; - element = jqLite(element); - for (i = 0; i < ii; ++i) { - attr = ngAttrPrefixes[i] + ngAttr; - if (isString(attr = element.attr(attr))) { - return attr; - } - } - return null; -} - -/** - * @ngdoc directive - * @name ngApp - * @module ng - * - * @element ANY - * @param {angular.Module} ngApp an optional application - * {@link angular.module module} name to load. - * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be - * created in "strict-di" mode. This means that the application will fail to invoke functions which - * do not use explicit function annotation (and are thus unsuitable for minification), as described - * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in - * tracking down the root of these bugs. - * - * @description - * - * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive - * designates the **root element** of the application and is typically placed near the root element - * of the page - e.g. on the `` or `` tags. - * - * Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp` - * found in the document will be used to define the root element to auto-bootstrap as an - * application. To run multiple applications in an HTML document you must manually bootstrap them using - * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other. - * - * You can specify an **AngularJS module** to be used as the root module for the application. This - * module will be loaded into the {@link auto.$injector} when the application is bootstrapped and - * should contain the application code needed or have dependencies on other modules that will - * contain the code. See {@link angular.module} for more information. - * - * In the example below if the `ngApp` directive were not placed on the `html` element then the - * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}` - * would not be resolved to `3`. - * - * `ngApp` is the easiest, and most common, way to bootstrap an application. - * - - -
- I can add: {{a}} + {{b}} = {{ a+b }} -
-
- - angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) { - $scope.a = 1; - $scope.b = 2; - }); - -
- * - * Using `ngStrictDi`, you would see something like this: - * - - -
-
- I can add: {{a}} + {{b}} = {{ a+b }} - -

This renders because the controller does not fail to - instantiate, by using explicit annotation style (see - script.js for details) -

-
- -
- Name:
- Hello, {{name}}! - -

This renders because the controller does not fail to - instantiate, by using explicit annotation style - (see script.js for details) -

-
- -
- I can add: {{a}} + {{b}} = {{ a+b }} - -

The controller could not be instantiated, due to relying - on automatic function annotations (which are disabled in - strict mode). As such, the content of this section is not - interpolated, and there should be an error in your web console. -

-
-
-
- - angular.module('ngAppStrictDemo', []) - // BadController will fail to instantiate, due to relying on automatic function annotation, - // rather than an explicit annotation - .controller('BadController', function($scope) { - $scope.a = 1; - $scope.b = 2; - }) - // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated, - // due to using explicit annotations using the array style and $inject property, respectively. - .controller('GoodController1', ['$scope', function($scope) { - $scope.a = 1; - $scope.b = 2; - }]) - .controller('GoodController2', GoodController2); - function GoodController2($scope) { - $scope.name = "World"; - } - GoodController2.$inject = ['$scope']; - - - div[ng-controller] { - margin-bottom: 1em; - -webkit-border-radius: 4px; - border-radius: 4px; - border: 1px solid; - padding: .5em; - } - div[ng-controller^=Good] { - border-color: #d6e9c6; - background-color: #dff0d8; - color: #3c763d; - } - div[ng-controller^=Bad] { - border-color: #ebccd1; - background-color: #f2dede; - color: #a94442; - margin-bottom: 0; - } - -
- */ -function angularInit(element, bootstrap) { - var appElement, - module, - config = {}; - - // The element `element` has priority over any other element - forEach(ngAttrPrefixes, function(prefix) { - var name = prefix + 'app'; - - if (!appElement && element.hasAttribute && element.hasAttribute(name)) { - appElement = element; - module = element.getAttribute(name); - } - }); - forEach(ngAttrPrefixes, function(prefix) { - var name = prefix + 'app'; - var candidate; - - if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) { - appElement = candidate; - module = candidate.getAttribute(name); - } - }); - if (appElement) { - config.strictDi = getNgAttribute(appElement, "strict-di") !== null; - bootstrap(appElement, module ? [module] : [], config); - } -} - -/** - * @ngdoc function - * @name angular.bootstrap - * @module ng - * @description - * Use this function to manually start up angular application. - * - * See: {@link guide/bootstrap Bootstrap} - * - * Note that Protractor based end-to-end tests cannot use this function to bootstrap manually. - * They must use {@link ng.directive:ngApp ngApp}. - * - * Angular will detect if it has been loaded into the browser more than once and only allow the - * first loaded script to be bootstrapped and will report a warning to the browser console for - * each of the subsequent scripts. This prevents strange results in applications, where otherwise - * multiple instances of Angular try to work on the DOM. - * - * ```html - * - * - * - *
- * {{greeting}} - *
- * - * - * - * - * - * ``` - * - * @param {DOMElement} element DOM element which is the root of angular application. - * @param {Array=} modules an array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a run block. - * See: {@link angular.module modules} - * @param {Object=} config an object for defining configuration options for the application. The - * following keys are supported: - * - * - `strictDi`: disable automatic function annotation for the application. This is meant to - * assist in finding bugs which break minified code. - * - * @returns {auto.$injector} Returns the newly created injector for this app. - */ -function bootstrap(element, modules, config) { - if (!isObject(config)) config = {}; - var defaultConfig = { - strictDi: false - }; - config = extend(defaultConfig, config); - var doBootstrap = function() { - element = jqLite(element); - - if (element.injector()) { - var tag = (element[0] === document) ? 'document' : startingTag(element); - //Encode angle brackets to prevent input from being sanitized to empty string #8683 - throw ngMinErr( - 'btstrpd', - "App Already Bootstrapped with this Element '{0}'", - tag.replace(//,'>')); - } - - modules = modules || []; - modules.unshift(['$provide', function($provide) { - $provide.value('$rootElement', element); - }]); - - if (config.debugInfoEnabled) { - // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`. - modules.push(['$compileProvider', function($compileProvider) { - $compileProvider.debugInfoEnabled(true); - }]); - } - - modules.unshift('ng'); - var injector = createInjector(modules, config.strictDi); - injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector', - function bootstrapApply(scope, element, compile, injector) { - scope.$apply(function() { - element.data('$injector', injector); - compile(element)(scope); - }); - }] - ); - return injector; - }; - - var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/; - var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/; - - if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) { - config.debugInfoEnabled = true; - window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, ''); - } - - if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) { - return doBootstrap(); - } - - window.name = window.name.replace(NG_DEFER_BOOTSTRAP, ''); - angular.resumeBootstrap = function(extraModules) { - forEach(extraModules, function(module) { - modules.push(module); - }); - doBootstrap(); - }; -} - -/** - * @ngdoc function - * @name angular.reloadWithDebugInfo - * @module ng - * @description - * Use this function to reload the current application with debug information turned on. - * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`. - * - * See {@link ng.$compileProvider#debugInfoEnabled} for more. - */ -function reloadWithDebugInfo() { - window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name; - window.location.reload(); -} - -/** - * @name angular.getTestability - * @module ng - * @description - * Get the testability service for the instance of Angular on the given - * element. - * @param {DOMElement} element DOM element which is the root of angular application. - */ -function getTestability(rootElement) { - return angular.element(rootElement).injector().get('$$testability'); -} - -var SNAKE_CASE_REGEXP = /[A-Z]/g; -function snake_case(name, separator) { - separator = separator || '_'; - return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) { - return (pos ? separator : '') + letter.toLowerCase(); - }); -} - -var bindJQueryFired = false; -var skipDestroyOnNextJQueryCleanData; -function bindJQuery() { - var originalCleanData; - - if (bindJQueryFired) { - return; - } - - // bind to jQuery if present; - jQuery = window.jQuery; - // Use jQuery if it exists with proper functionality, otherwise default to us. - // Angular 1.2+ requires jQuery 1.7+ for on()/off() support. - // Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older - // versions. It will not work for sure with jQuery <1.7, though. - if (jQuery && jQuery.fn.on) { - jqLite = jQuery; - extend(jQuery.fn, { - scope: JQLitePrototype.scope, - isolateScope: JQLitePrototype.isolateScope, - controller: JQLitePrototype.controller, - injector: JQLitePrototype.injector, - inheritedData: JQLitePrototype.inheritedData - }); - - // All nodes removed from the DOM via various jQuery APIs like .remove() - // are passed through jQuery.cleanData. Monkey-patch this method to fire - // the $destroy event on all removed nodes. - originalCleanData = jQuery.cleanData; - jQuery.cleanData = function(elems) { - var events; - if (!skipDestroyOnNextJQueryCleanData) { - for (var i = 0, elem; (elem = elems[i]) != null; i++) { - events = jQuery._data(elem, "events"); - if (events && events.$destroy) { - jQuery(elem).triggerHandler('$destroy'); - } - } - } else { - skipDestroyOnNextJQueryCleanData = false; - } - originalCleanData(elems); - }; - } else { - jqLite = JQLite; - } - - angular.element = jqLite; - - // Prevent double-proxying. - bindJQueryFired = true; -} - -/** - * throw error if the argument is falsy. - */ -function assertArg(arg, name, reason) { - if (!arg) { - throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required")); - } - return arg; -} - -function assertArgFn(arg, name, acceptArrayAnnotation) { - if (acceptArrayAnnotation && isArray(arg)) { - arg = arg[arg.length - 1]; - } - - assertArg(isFunction(arg), name, 'not a function, got ' + - (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg)); - return arg; -} - -/** - * throw error if the name given is hasOwnProperty - * @param {String} name the name to test - * @param {String} context the context in which the name is used, such as module or directive - */ -function assertNotHasOwnProperty(name, context) { - if (name === 'hasOwnProperty') { - throw ngMinErr('badname', "hasOwnProperty is not a valid {0} name", context); - } -} - -/** - * Return the value accessible from the object by path. Any undefined traversals are ignored - * @param {Object} obj starting object - * @param {String} path path to traverse - * @param {boolean} [bindFnToScope=true] - * @returns {Object} value as accessible by path - */ -//TODO(misko): this function needs to be removed -function getter(obj, path, bindFnToScope) { - if (!path) return obj; - var keys = path.split('.'); - var key; - var lastInstance = obj; - var len = keys.length; - - for (var i = 0; i < len; i++) { - key = keys[i]; - if (obj) { - obj = (lastInstance = obj)[key]; - } - } - if (!bindFnToScope && isFunction(obj)) { - return bind(lastInstance, obj); - } - return obj; -} - -/** - * Return the DOM siblings between the first and last node in the given array. - * @param {Array} array like object - * @returns {jqLite} jqLite collection containing the nodes - */ -function getBlockNodes(nodes) { - // TODO(perf): just check if all items in `nodes` are siblings and if they are return the original - // collection, otherwise update the original collection. - var node = nodes[0]; - var endNode = nodes[nodes.length - 1]; - var blockNodes = [node]; - - do { - node = node.nextSibling; - if (!node) break; - blockNodes.push(node); - } while (node !== endNode); - - return jqLite(blockNodes); -} - - -/** - * Creates a new object without a prototype. This object is useful for lookup without having to - * guard against prototypically inherited properties via hasOwnProperty. - * - * Related micro-benchmarks: - * - http://jsperf.com/object-create2 - * - http://jsperf.com/proto-map-lookup/2 - * - http://jsperf.com/for-in-vs-object-keys2 - * - * @returns {Object} - */ -function createMap() { - return Object.create(null); -} - -var NODE_TYPE_ELEMENT = 1; -var NODE_TYPE_TEXT = 3; -var NODE_TYPE_COMMENT = 8; -var NODE_TYPE_DOCUMENT = 9; -var NODE_TYPE_DOCUMENT_FRAGMENT = 11; - -/** - * @ngdoc type - * @name angular.Module - * @module ng - * @description - * - * Interface for configuring angular {@link angular.module modules}. - */ - -function setupModuleLoader(window) { - - var $injectorMinErr = minErr('$injector'); - var ngMinErr = minErr('ng'); - - function ensure(obj, name, factory) { - return obj[name] || (obj[name] = factory()); - } - - var angular = ensure(window, 'angular', Object); - - // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap - angular.$$minErr = angular.$$minErr || minErr; - - return ensure(angular, 'module', function() { - /** @type {Object.} */ - var modules = {}; - - /** - * @ngdoc function - * @name angular.module - * @module ng - * @description - * - * The `angular.module` is a global place for creating, registering and retrieving Angular - * modules. - * All modules (angular core or 3rd party) that should be available to an application must be - * registered using this mechanism. - * - * When passed two or more arguments, a new module is created. If passed only one argument, an - * existing module (the name passed as the first argument to `module`) is retrieved. - * - * - * # Module - * - * A module is a collection of services, directives, controllers, filters, and configuration information. - * `angular.module` is used to configure the {@link auto.$injector $injector}. - * - * ```js - * // Create a new module - * var myModule = angular.module('myModule', []); - * - * // register a new service - * myModule.value('appName', 'MyCoolApp'); - * - * // configure existing services inside initialization blocks. - * myModule.config(['$locationProvider', function($locationProvider) { - * // Configure existing providers - * $locationProvider.hashPrefix('!'); - * }]); - * ``` - * - * Then you can create an injector and load your modules like this: - * - * ```js - * var injector = angular.injector(['ng', 'myModule']) - * ``` - * - * However it's more likely that you'll just use - * {@link ng.directive:ngApp ngApp} or - * {@link angular.bootstrap} to simplify this process for you. - * - * @param {!string} name The name of the module to create or retrieve. - * @param {!Array.=} requires If specified then new module is being created. If - * unspecified then the module is being retrieved for further configuration. - * @param {Function=} configFn Optional configuration function for the module. Same as - * {@link angular.Module#config Module#config()}. - * @returns {module} new module with the {@link angular.Module} api. - */ - return function module(name, requires, configFn) { - var assertNotHasOwnProperty = function(name, context) { - if (name === 'hasOwnProperty') { - throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context); - } - }; - - assertNotHasOwnProperty(name, 'module'); - if (requires && modules.hasOwnProperty(name)) { - modules[name] = null; - } - return ensure(modules, name, function() { - if (!requires) { - throw $injectorMinErr('nomod', "Module '{0}' is not available! You either misspelled " + - "the module name or forgot to load it. If registering a module ensure that you " + - "specify the dependencies as the second argument.", name); - } - - /** @type {!Array.>} */ - var invokeQueue = []; - - /** @type {!Array.} */ - var configBlocks = []; - - /** @type {!Array.} */ - var runBlocks = []; - - var config = invokeLater('$injector', 'invoke', 'push', configBlocks); - - /** @type {angular.Module} */ - var moduleInstance = { - // Private state - _invokeQueue: invokeQueue, - _configBlocks: configBlocks, - _runBlocks: runBlocks, - - /** - * @ngdoc property - * @name angular.Module#requires - * @module ng - * - * @description - * Holds the list of modules which the injector will load before the current module is - * loaded. - */ - requires: requires, - - /** - * @ngdoc property - * @name angular.Module#name - * @module ng - * - * @description - * Name of the module. - */ - name: name, - - - /** - * @ngdoc method - * @name angular.Module#provider - * @module ng - * @param {string} name service name - * @param {Function} providerType Construction function for creating new instance of the - * service. - * @description - * See {@link auto.$provide#provider $provide.provider()}. - */ - provider: invokeLater('$provide', 'provider'), - - /** - * @ngdoc method - * @name angular.Module#factory - * @module ng - * @param {string} name service name - * @param {Function} providerFunction Function for creating new instance of the service. - * @description - * See {@link auto.$provide#factory $provide.factory()}. - */ - factory: invokeLater('$provide', 'factory'), - - /** - * @ngdoc method - * @name angular.Module#service - * @module ng - * @param {string} name service name - * @param {Function} constructor A constructor function that will be instantiated. - * @description - * See {@link auto.$provide#service $provide.service()}. - */ - service: invokeLater('$provide', 'service'), - - /** - * @ngdoc method - * @name angular.Module#value - * @module ng - * @param {string} name service name - * @param {*} object Service instance object. - * @description - * See {@link auto.$provide#value $provide.value()}. - */ - value: invokeLater('$provide', 'value'), - - /** - * @ngdoc method - * @name angular.Module#constant - * @module ng - * @param {string} name constant name - * @param {*} object Constant value. - * @description - * Because the constant are fixed, they get applied before other provide methods. - * See {@link auto.$provide#constant $provide.constant()}. - */ - constant: invokeLater('$provide', 'constant', 'unshift'), - - /** - * @ngdoc method - * @name angular.Module#animation - * @module ng - * @param {string} name animation name - * @param {Function} animationFactory Factory function for creating new instance of an - * animation. - * @description - * - * **NOTE**: animations take effect only if the **ngAnimate** module is loaded. - * - * - * Defines an animation hook that can be later used with - * {@link ngAnimate.$animate $animate} service and directives that use this service. - * - * ```js - * module.animation('.animation-name', function($inject1, $inject2) { - * return { - * eventName : function(element, done) { - * //code to run the animation - * //once complete, then run done() - * return function cancellationFunction(element) { - * //code to cancel the animation - * } - * } - * } - * }) - * ``` - * - * See {@link ng.$animateProvider#register $animateProvider.register()} and - * {@link ngAnimate ngAnimate module} for more information. - */ - animation: invokeLater('$animateProvider', 'register'), - - /** - * @ngdoc method - * @name angular.Module#filter - * @module ng - * @param {string} name Filter name. - * @param {Function} filterFactory Factory function for creating new instance of filter. - * @description - * See {@link ng.$filterProvider#register $filterProvider.register()}. - */ - filter: invokeLater('$filterProvider', 'register'), - - /** - * @ngdoc method - * @name angular.Module#controller - * @module ng - * @param {string|Object} name Controller name, or an object map of controllers where the - * keys are the names and the values are the constructors. - * @param {Function} constructor Controller constructor function. - * @description - * See {@link ng.$controllerProvider#register $controllerProvider.register()}. - */ - controller: invokeLater('$controllerProvider', 'register'), - - /** - * @ngdoc method - * @name angular.Module#directive - * @module ng - * @param {string|Object} name Directive name, or an object map of directives where the - * keys are the names and the values are the factories. - * @param {Function} directiveFactory Factory function for creating new instance of - * directives. - * @description - * See {@link ng.$compileProvider#directive $compileProvider.directive()}. - */ - directive: invokeLater('$compileProvider', 'directive'), - - /** - * @ngdoc method - * @name angular.Module#config - * @module ng - * @param {Function} configFn Execute this function on module load. Useful for service - * configuration. - * @description - * Use this method to register work which needs to be performed on module loading. - * For more about how to configure services, see - * {@link providers#provider-recipe Provider Recipe}. - */ - config: config, - - /** - * @ngdoc method - * @name angular.Module#run - * @module ng - * @param {Function} initializationFn Execute this function after injector creation. - * Useful for application initialization. - * @description - * Use this method to register work which should be performed when the injector is done - * loading all modules. - */ - run: function(block) { - runBlocks.push(block); - return this; - } - }; - - if (configFn) { - config(configFn); - } - - return moduleInstance; - - /** - * @param {string} provider - * @param {string} method - * @param {String=} insertMethod - * @returns {angular.Module} - */ - function invokeLater(provider, method, insertMethod, queue) { - if (!queue) queue = invokeQueue; - return function() { - queue[insertMethod || 'push']([provider, method, arguments]); - return moduleInstance; - }; - } - }); - }; - }); - -} - -/* global: toDebugString: true */ - -function serializeObject(obj) { - var seen = []; - - return JSON.stringify(obj, function(key, val) { - val = toJsonReplacer(key, val); - if (isObject(val)) { - - if (seen.indexOf(val) >= 0) return '<>'; - - seen.push(val); - } - return val; - }); -} - -function toDebugString(obj) { - if (typeof obj === 'function') { - return obj.toString().replace(/ \{[\s\S]*$/, ''); - } else if (typeof obj === 'undefined') { - return 'undefined'; - } else if (typeof obj !== 'string') { - return serializeObject(obj); - } - return obj; -} - -/* global angularModule: true, - version: true, - - $LocaleProvider, - $CompileProvider, - - htmlAnchorDirective, - inputDirective, - inputDirective, - formDirective, - scriptDirective, - selectDirective, - styleDirective, - optionDirective, - ngBindDirective, - ngBindHtmlDirective, - ngBindTemplateDirective, - ngClassDirective, - ngClassEvenDirective, - ngClassOddDirective, - ngCspDirective, - ngCloakDirective, - ngControllerDirective, - ngFormDirective, - ngHideDirective, - ngIfDirective, - ngIncludeDirective, - ngIncludeFillContentDirective, - ngInitDirective, - ngNonBindableDirective, - ngPluralizeDirective, - ngRepeatDirective, - ngShowDirective, - ngStyleDirective, - ngSwitchDirective, - ngSwitchWhenDirective, - ngSwitchDefaultDirective, - ngOptionsDirective, - ngTranscludeDirective, - ngModelDirective, - ngListDirective, - ngChangeDirective, - patternDirective, - patternDirective, - requiredDirective, - requiredDirective, - minlengthDirective, - minlengthDirective, - maxlengthDirective, - maxlengthDirective, - ngValueDirective, - ngModelOptionsDirective, - ngAttributeAliasDirectives, - ngEventDirectives, - - $AnchorScrollProvider, - $AnimateProvider, - $BrowserProvider, - $CacheFactoryProvider, - $ControllerProvider, - $DocumentProvider, - $ExceptionHandlerProvider, - $FilterProvider, - $InterpolateProvider, - $IntervalProvider, - $HttpProvider, - $HttpBackendProvider, - $LocationProvider, - $LogProvider, - $ParseProvider, - $RootScopeProvider, - $QProvider, - $$QProvider, - $$SanitizeUriProvider, - $SceProvider, - $SceDelegateProvider, - $SnifferProvider, - $TemplateCacheProvider, - $TemplateRequestProvider, - $$TestabilityProvider, - $TimeoutProvider, - $$RAFProvider, - $$AsyncCallbackProvider, - $WindowProvider -*/ - - -/** - * @ngdoc object - * @name angular.version - * @module ng - * @description - * An object that contains information about the current AngularJS version. This object has the - * following properties: - * - * - `full` – `{string}` – Full version string, such as "0.9.18". - * - `major` – `{number}` – Major version number, such as "0". - * - `minor` – `{number}` – Minor version number, such as "9". - * - `dot` – `{number}` – Dot version number, such as "18". - * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat". - */ -var version = { - full: '1.3.3', // all of these placeholder strings will be replaced by grunt's - major: 1, // package task - minor: 3, - dot: 3, - codeName: 'undersea-arithmetic' -}; - - -function publishExternalAPI(angular) { - extend(angular, { - 'bootstrap': bootstrap, - 'copy': copy, - 'extend': extend, - 'equals': equals, - 'element': jqLite, - 'forEach': forEach, - 'injector': createInjector, - 'noop': noop, - 'bind': bind, - 'toJson': toJson, - 'fromJson': fromJson, - 'identity': identity, - 'isUndefined': isUndefined, - 'isDefined': isDefined, - 'isString': isString, - 'isFunction': isFunction, - 'isObject': isObject, - 'isNumber': isNumber, - 'isElement': isElement, - 'isArray': isArray, - 'version': version, - 'isDate': isDate, - 'lowercase': lowercase, - 'uppercase': uppercase, - 'callbacks': {counter: 0}, - 'getTestability': getTestability, - '$$minErr': minErr, - '$$csp': csp, - 'reloadWithDebugInfo': reloadWithDebugInfo - }); - - angularModule = setupModuleLoader(window); - try { - angularModule('ngLocale'); - } catch (e) { - angularModule('ngLocale', []).provider('$locale', $LocaleProvider); - } - - angularModule('ng', ['ngLocale'], ['$provide', - function ngModule($provide) { - // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it. - $provide.provider({ - $$sanitizeUri: $$SanitizeUriProvider - }); - $provide.provider('$compile', $CompileProvider). - directive({ - a: htmlAnchorDirective, - input: inputDirective, - textarea: inputDirective, - form: formDirective, - script: scriptDirective, - select: selectDirective, - style: styleDirective, - option: optionDirective, - ngBind: ngBindDirective, - ngBindHtml: ngBindHtmlDirective, - ngBindTemplate: ngBindTemplateDirective, - ngClass: ngClassDirective, - ngClassEven: ngClassEvenDirective, - ngClassOdd: ngClassOddDirective, - ngCloak: ngCloakDirective, - ngController: ngControllerDirective, - ngForm: ngFormDirective, - ngHide: ngHideDirective, - ngIf: ngIfDirective, - ngInclude: ngIncludeDirective, - ngInit: ngInitDirective, - ngNonBindable: ngNonBindableDirective, - ngPluralize: ngPluralizeDirective, - ngRepeat: ngRepeatDirective, - ngShow: ngShowDirective, - ngStyle: ngStyleDirective, - ngSwitch: ngSwitchDirective, - ngSwitchWhen: ngSwitchWhenDirective, - ngSwitchDefault: ngSwitchDefaultDirective, - ngOptions: ngOptionsDirective, - ngTransclude: ngTranscludeDirective, - ngModel: ngModelDirective, - ngList: ngListDirective, - ngChange: ngChangeDirective, - pattern: patternDirective, - ngPattern: patternDirective, - required: requiredDirective, - ngRequired: requiredDirective, - minlength: minlengthDirective, - ngMinlength: minlengthDirective, - maxlength: maxlengthDirective, - ngMaxlength: maxlengthDirective, - ngValue: ngValueDirective, - ngModelOptions: ngModelOptionsDirective - }). - directive({ - ngInclude: ngIncludeFillContentDirective - }). - directive(ngAttributeAliasDirectives). - directive(ngEventDirectives); - $provide.provider({ - $anchorScroll: $AnchorScrollProvider, - $animate: $AnimateProvider, - $browser: $BrowserProvider, - $cacheFactory: $CacheFactoryProvider, - $controller: $ControllerProvider, - $document: $DocumentProvider, - $exceptionHandler: $ExceptionHandlerProvider, - $filter: $FilterProvider, - $interpolate: $InterpolateProvider, - $interval: $IntervalProvider, - $http: $HttpProvider, - $httpBackend: $HttpBackendProvider, - $location: $LocationProvider, - $log: $LogProvider, - $parse: $ParseProvider, - $rootScope: $RootScopeProvider, - $q: $QProvider, - $$q: $$QProvider, - $sce: $SceProvider, - $sceDelegate: $SceDelegateProvider, - $sniffer: $SnifferProvider, - $templateCache: $TemplateCacheProvider, - $templateRequest: $TemplateRequestProvider, - $$testability: $$TestabilityProvider, - $timeout: $TimeoutProvider, - $window: $WindowProvider, - $$rAF: $$RAFProvider, - $$asyncCallback: $$AsyncCallbackProvider - }); - } - ]); -} - -/* global JQLitePrototype: true, - addEventListenerFn: true, - removeEventListenerFn: true, - BOOLEAN_ATTR: true, - ALIASED_ATTR: true, -*/ - -////////////////////////////////// -//JQLite -////////////////////////////////// - -/** - * @ngdoc function - * @name angular.element - * @module ng - * @kind function - * - * @description - * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element. - * - * If jQuery is available, `angular.element` is an alias for the - * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element` - * delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite." - * - *
jqLite is a tiny, API-compatible subset of jQuery that allows - * Angular to manipulate the DOM in a cross-browser compatible way. **jqLite** implements only the most - * commonly needed functionality with the goal of having a very small footprint.
- * - * To use jQuery, simply load it before `DOMContentLoaded` event fired. - * - *
**Note:** all element references in Angular are always wrapped with jQuery or - * jqLite; they are never raw DOM references.
- * - * ## Angular's jqLite - * jqLite provides only the following jQuery methods: - * - * - [`addClass()`](http://api.jquery.com/addClass/) - * - [`after()`](http://api.jquery.com/after/) - * - [`append()`](http://api.jquery.com/append/) - * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters - * - [`bind()`](http://api.jquery.com/bind/) - Does not support namespaces, selectors or eventData - * - [`children()`](http://api.jquery.com/children/) - Does not support selectors - * - [`clone()`](http://api.jquery.com/clone/) - * - [`contents()`](http://api.jquery.com/contents/) - * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()` - * - [`data()`](http://api.jquery.com/data/) - * - [`detach()`](http://api.jquery.com/detach/) - * - [`empty()`](http://api.jquery.com/empty/) - * - [`eq()`](http://api.jquery.com/eq/) - * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name - * - [`hasClass()`](http://api.jquery.com/hasClass/) - * - [`html()`](http://api.jquery.com/html/) - * - [`next()`](http://api.jquery.com/next/) - Does not support selectors - * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData - * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces or selectors - * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors - * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors - * - [`prepend()`](http://api.jquery.com/prepend/) - * - [`prop()`](http://api.jquery.com/prop/) - * - [`ready()`](http://api.jquery.com/ready/) - * - [`remove()`](http://api.jquery.com/remove/) - * - [`removeAttr()`](http://api.jquery.com/removeAttr/) - * - [`removeClass()`](http://api.jquery.com/removeClass/) - * - [`removeData()`](http://api.jquery.com/removeData/) - * - [`replaceWith()`](http://api.jquery.com/replaceWith/) - * - [`text()`](http://api.jquery.com/text/) - * - [`toggleClass()`](http://api.jquery.com/toggleClass/) - * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers. - * - [`unbind()`](http://api.jquery.com/unbind/) - Does not support namespaces - * - [`val()`](http://api.jquery.com/val/) - * - [`wrap()`](http://api.jquery.com/wrap/) - * - * ## jQuery/jqLite Extras - * Angular also provides the following additional methods and events to both jQuery and jqLite: - * - * ### Events - * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event - * on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM - * element before it is removed. - * - * ### Methods - * - `controller(name)` - retrieves the controller of the current element or its parent. By default - * retrieves controller associated with the `ngController` directive. If `name` is provided as - * camelCase directive name, then the controller for this directive will be retrieved (e.g. - * `'ngModel'`). - * - `injector()` - retrieves the injector of the current element or its parent. - * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current - * element or its parent. - * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the - * current element. This getter should be used only on elements that contain a directive which starts a new isolate - * scope. Calling `scope()` on this element always returns the original non-isolate scope. - * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top - * parent element is reached. - * - * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery. - * @returns {Object} jQuery object. - */ - -JQLite.expando = 'ng339'; - -var jqCache = JQLite.cache = {}, - jqId = 1, - addEventListenerFn = function(element, type, fn) { - element.addEventListener(type, fn, false); - }, - removeEventListenerFn = function(element, type, fn) { - element.removeEventListener(type, fn, false); - }; - -/* - * !!! This is an undocumented "private" function !!! - */ -JQLite._data = function(node) { - //jQuery always returns an object on cache miss - return this.cache[node[this.expando]] || {}; -}; - -function jqNextId() { return ++jqId; } - - -var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g; -var MOZ_HACK_REGEXP = /^moz([A-Z])/; -var MOUSE_EVENT_MAP= { mouseleave: "mouseout", mouseenter: "mouseover"}; -var jqLiteMinErr = minErr('jqLite'); - -/** - * Converts snake_case to camelCase. - * Also there is special case for Moz prefix starting with upper case letter. - * @param name Name to normalize - */ -function camelCase(name) { - return name. - replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) { - return offset ? letter.toUpperCase() : letter; - }). - replace(MOZ_HACK_REGEXP, 'Moz$1'); -} - -var SINGLE_TAG_REGEXP = /^<(\w+)\s*\/?>(?:<\/\1>|)$/; -var HTML_REGEXP = /<|&#?\w+;/; -var TAG_NAME_REGEXP = /<([\w:]+)/; -var XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi; - -var wrapMap = { - 'option': [1, ''], - - 'thead': [1, '', '
'], - 'col': [2, '', '
'], - 'tr': [2, '', '
'], - 'td': [3, '', '
'], - '_default': [0, "", ""] -}; - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - - -function jqLiteIsTextNode(html) { - return !HTML_REGEXP.test(html); -} - -function jqLiteAcceptsData(node) { - // The window object can accept data but has no nodeType - // Otherwise we are only interested in elements (1) and documents (9) - var nodeType = node.nodeType; - return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT; -} - -function jqLiteBuildFragment(html, context) { - var tmp, tag, wrap, - fragment = context.createDocumentFragment(), - nodes = [], i; - - if (jqLiteIsTextNode(html)) { - // Convert non-html into a text node - nodes.push(context.createTextNode(html)); - } else { - // Convert html into DOM nodes - tmp = tmp || fragment.appendChild(context.createElement("div")); - tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase(); - wrap = wrapMap[tag] || wrapMap._default; - tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, "<$1>") + wrap[2]; - - // Descend through wrappers to the right content - i = wrap[0]; - while (i--) { - tmp = tmp.lastChild; - } - - nodes = concat(nodes, tmp.childNodes); - - tmp = fragment.firstChild; - tmp.textContent = ""; - } - - // Remove wrapper from fragment - fragment.textContent = ""; - fragment.innerHTML = ""; // Clear inner HTML - forEach(nodes, function(node) { - fragment.appendChild(node); - }); - - return fragment; -} - -function jqLiteParseHTML(html, context) { - context = context || document; - var parsed; - - if ((parsed = SINGLE_TAG_REGEXP.exec(html))) { - return [context.createElement(parsed[1])]; - } - - if ((parsed = jqLiteBuildFragment(html, context))) { - return parsed.childNodes; - } - - return []; -} - -///////////////////////////////////////////// -function JQLite(element) { - if (element instanceof JQLite) { - return element; - } - - var argIsString; - - if (isString(element)) { - element = trim(element); - argIsString = true; - } - if (!(this instanceof JQLite)) { - if (argIsString && element.charAt(0) != '<') { - throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element'); - } - return new JQLite(element); - } - - if (argIsString) { - jqLiteAddNodes(this, jqLiteParseHTML(element)); - } else { - jqLiteAddNodes(this, element); - } -} - -function jqLiteClone(element) { - return element.cloneNode(true); -} - -function jqLiteDealoc(element, onlyDescendants) { - if (!onlyDescendants) jqLiteRemoveData(element); - - if (element.querySelectorAll) { - var descendants = element.querySelectorAll('*'); - for (var i = 0, l = descendants.length; i < l; i++) { - jqLiteRemoveData(descendants[i]); - } - } -} - -function jqLiteOff(element, type, fn, unsupported) { - if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument'); - - var expandoStore = jqLiteExpandoStore(element); - var events = expandoStore && expandoStore.events; - var handle = expandoStore && expandoStore.handle; - - if (!handle) return; //no listeners registered - - if (!type) { - for (type in events) { - if (type !== '$destroy') { - removeEventListenerFn(element, type, handle); - } - delete events[type]; - } - } else { - forEach(type.split(' '), function(type) { - if (isDefined(fn)) { - var listenerFns = events[type]; - arrayRemove(listenerFns || [], fn); - if (listenerFns && listenerFns.length > 0) { - return; - } - } - - removeEventListenerFn(element, type, handle); - delete events[type]; - }); - } -} - -function jqLiteRemoveData(element, name) { - var expandoId = element.ng339; - var expandoStore = expandoId && jqCache[expandoId]; - - if (expandoStore) { - if (name) { - delete expandoStore.data[name]; - return; - } - - if (expandoStore.handle) { - if (expandoStore.events.$destroy) { - expandoStore.handle({}, '$destroy'); - } - jqLiteOff(element); - } - delete jqCache[expandoId]; - element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it - } -} - - -function jqLiteExpandoStore(element, createIfNecessary) { - var expandoId = element.ng339, - expandoStore = expandoId && jqCache[expandoId]; - - if (createIfNecessary && !expandoStore) { - element.ng339 = expandoId = jqNextId(); - expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined}; - } - - return expandoStore; -} - - -function jqLiteData(element, key, value) { - if (jqLiteAcceptsData(element)) { - - var isSimpleSetter = isDefined(value); - var isSimpleGetter = !isSimpleSetter && key && !isObject(key); - var massGetter = !key; - var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter); - var data = expandoStore && expandoStore.data; - - if (isSimpleSetter) { // data('key', value) - data[key] = value; - } else { - if (massGetter) { // data() - return data; - } else { - if (isSimpleGetter) { // data('key') - // don't force creation of expandoStore if it doesn't exist yet - return data && data[key]; - } else { // mass-setter: data({key1: val1, key2: val2}) - extend(data, key); - } - } - } - } -} - -function jqLiteHasClass(element, selector) { - if (!element.getAttribute) return false; - return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " "). - indexOf(" " + selector + " ") > -1); -} - -function jqLiteRemoveClass(element, cssClasses) { - if (cssClasses && element.setAttribute) { - forEach(cssClasses.split(' '), function(cssClass) { - element.setAttribute('class', trim( - (" " + (element.getAttribute('class') || '') + " ") - .replace(/[\n\t]/g, " ") - .replace(" " + trim(cssClass) + " ", " ")) - ); - }); - } -} - -function jqLiteAddClass(element, cssClasses) { - if (cssClasses && element.setAttribute) { - var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ') - .replace(/[\n\t]/g, " "); - - forEach(cssClasses.split(' '), function(cssClass) { - cssClass = trim(cssClass); - if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) { - existingClasses += cssClass + ' '; - } - }); - - element.setAttribute('class', trim(existingClasses)); - } -} - - -function jqLiteAddNodes(root, elements) { - // THIS CODE IS VERY HOT. Don't make changes without benchmarking. - - if (elements) { - - // if a Node (the most common case) - if (elements.nodeType) { - root[root.length++] = elements; - } else { - var length = elements.length; - - // if an Array or NodeList and not a Window - if (typeof length === 'number' && elements.window !== elements) { - if (length) { - for (var i = 0; i < length; i++) { - root[root.length++] = elements[i]; - } - } - } else { - root[root.length++] = elements; - } - } - } -} - - -function jqLiteController(element, name) { - return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller'); -} - -function jqLiteInheritedData(element, name, value) { - // if element is the document object work with the html element instead - // this makes $(document).scope() possible - if (element.nodeType == NODE_TYPE_DOCUMENT) { - element = element.documentElement; - } - var names = isArray(name) ? name : [name]; - - while (element) { - for (var i = 0, ii = names.length; i < ii; i++) { - if ((value = jqLite.data(element, names[i])) !== undefined) return value; - } - - // If dealing with a document fragment node with a host element, and no parent, use the host - // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM - // to lookup parent controllers. - element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host); - } -} - -function jqLiteEmpty(element) { - jqLiteDealoc(element, true); - while (element.firstChild) { - element.removeChild(element.firstChild); - } -} - -function jqLiteRemove(element, keepData) { - if (!keepData) jqLiteDealoc(element); - var parent = element.parentNode; - if (parent) parent.removeChild(element); -} - - -function jqLiteDocumentLoaded(action, win) { - win = win || window; - if (win.document.readyState === 'complete') { - // Force the action to be run async for consistent behaviour - // from the action's point of view - // i.e. it will definitely not be in a $apply - win.setTimeout(action); - } else { - // No need to unbind this handler as load is only ever called once - jqLite(win).on('load', action); - } -} - -////////////////////////////////////////// -// Functions which are declared directly. -////////////////////////////////////////// -var JQLitePrototype = JQLite.prototype = { - ready: function(fn) { - var fired = false; - - function trigger() { - if (fired) return; - fired = true; - fn(); - } - - // check if document is already loaded - if (document.readyState === 'complete') { - setTimeout(trigger); - } else { - this.on('DOMContentLoaded', trigger); // works for modern browsers and IE9 - // we can not use jqLite since we are not done loading and jQuery could be loaded later. - // jshint -W064 - JQLite(window).on('load', trigger); // fallback to window.onload for others - // jshint +W064 - } - }, - toString: function() { - var value = []; - forEach(this, function(e) { value.push('' + e);}); - return '[' + value.join(', ') + ']'; - }, - - eq: function(index) { - return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]); - }, - - length: 0, - push: push, - sort: [].sort, - splice: [].splice -}; - -////////////////////////////////////////// -// Functions iterating getter/setters. -// these functions return self on setter and -// value on get. -////////////////////////////////////////// -var BOOLEAN_ATTR = {}; -forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) { - BOOLEAN_ATTR[lowercase(value)] = value; -}); -var BOOLEAN_ELEMENTS = {}; -forEach('input,select,option,textarea,button,form,details'.split(','), function(value) { - BOOLEAN_ELEMENTS[value] = true; -}); -var ALIASED_ATTR = { - 'ngMinlength': 'minlength', - 'ngMaxlength': 'maxlength', - 'ngMin': 'min', - 'ngMax': 'max', - 'ngPattern': 'pattern' -}; - -function getBooleanAttrName(element, name) { - // check dom last since we will most likely fail on name - var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()]; - - // booleanAttr is here twice to minimize DOM access - return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr; -} - -function getAliasedAttrName(element, name) { - var nodeName = element.nodeName; - return (nodeName === 'INPUT' || nodeName === 'TEXTAREA') && ALIASED_ATTR[name]; -} - -forEach({ - data: jqLiteData, - removeData: jqLiteRemoveData -}, function(fn, name) { - JQLite[name] = fn; -}); - -forEach({ - data: jqLiteData, - inheritedData: jqLiteInheritedData, - - scope: function(element) { - // Can't use jqLiteData here directly so we stay compatible with jQuery! - return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']); - }, - - isolateScope: function(element) { - // Can't use jqLiteData here directly so we stay compatible with jQuery! - return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate'); - }, - - controller: jqLiteController, - - injector: function(element) { - return jqLiteInheritedData(element, '$injector'); - }, - - removeAttr: function(element, name) { - element.removeAttribute(name); - }, - - hasClass: jqLiteHasClass, - - css: function(element, name, value) { - name = camelCase(name); - - if (isDefined(value)) { - element.style[name] = value; - } else { - return element.style[name]; - } - }, - - attr: function(element, name, value) { - var lowercasedName = lowercase(name); - if (BOOLEAN_ATTR[lowercasedName]) { - if (isDefined(value)) { - if (!!value) { - element[name] = true; - element.setAttribute(name, lowercasedName); - } else { - element[name] = false; - element.removeAttribute(lowercasedName); - } - } else { - return (element[name] || - (element.attributes.getNamedItem(name) || noop).specified) - ? lowercasedName - : undefined; - } - } else if (isDefined(value)) { - element.setAttribute(name, value); - } else if (element.getAttribute) { - // the extra argument "2" is to get the right thing for a.href in IE, see jQuery code - // some elements (e.g. Document) don't have get attribute, so return undefined - var ret = element.getAttribute(name, 2); - // normalize non-existing attributes to undefined (as jQuery) - return ret === null ? undefined : ret; - } - }, - - prop: function(element, name, value) { - if (isDefined(value)) { - element[name] = value; - } else { - return element[name]; - } - }, - - text: (function() { - getText.$dv = ''; - return getText; - - function getText(element, value) { - if (isUndefined(value)) { - var nodeType = element.nodeType; - return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : ''; - } - element.textContent = value; - } - })(), - - val: function(element, value) { - if (isUndefined(value)) { - if (element.multiple && nodeName_(element) === 'select') { - var result = []; - forEach(element.options, function(option) { - if (option.selected) { - result.push(option.value || option.text); - } - }); - return result.length === 0 ? null : result; - } - return element.value; - } - element.value = value; - }, - - html: function(element, value) { - if (isUndefined(value)) { - return element.innerHTML; - } - jqLiteDealoc(element, true); - element.innerHTML = value; - }, - - empty: jqLiteEmpty -}, function(fn, name) { - /** - * Properties: writes return selection, reads return first value - */ - JQLite.prototype[name] = function(arg1, arg2) { - var i, key; - var nodeCount = this.length; - - // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it - // in a way that survives minification. - // jqLiteEmpty takes no arguments but is a setter. - if (fn !== jqLiteEmpty && - (((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2) === undefined)) { - if (isObject(arg1)) { - - // we are a write, but the object properties are the key/values - for (i = 0; i < nodeCount; i++) { - if (fn === jqLiteData) { - // data() takes the whole object in jQuery - fn(this[i], arg1); - } else { - for (key in arg1) { - fn(this[i], key, arg1[key]); - } - } - } - // return self for chaining - return this; - } else { - // we are a read, so read the first child. - // TODO: do we still need this? - var value = fn.$dv; - // Only if we have $dv do we iterate over all, otherwise it is just the first element. - var jj = (value === undefined) ? Math.min(nodeCount, 1) : nodeCount; - for (var j = 0; j < jj; j++) { - var nodeValue = fn(this[j], arg1, arg2); - value = value ? value + nodeValue : nodeValue; - } - return value; - } - } else { - // we are a write, so apply to all children - for (i = 0; i < nodeCount; i++) { - fn(this[i], arg1, arg2); - } - // return self for chaining - return this; - } - }; -}); - -function createEventHandler(element, events) { - var eventHandler = function(event, type) { - // jQuery specific api - event.isDefaultPrevented = function() { - return event.defaultPrevented; - }; - - var eventFns = events[type || event.type]; - var eventFnsLength = eventFns ? eventFns.length : 0; - - if (!eventFnsLength) return; - - if (isUndefined(event.immediatePropagationStopped)) { - var originalStopImmediatePropagation = event.stopImmediatePropagation; - event.stopImmediatePropagation = function() { - event.immediatePropagationStopped = true; - - if (event.stopPropagation) { - event.stopPropagation(); - } - - if (originalStopImmediatePropagation) { - originalStopImmediatePropagation.call(event); - } - }; - } - - event.isImmediatePropagationStopped = function() { - return event.immediatePropagationStopped === true; - }; - - // Copy event handlers in case event handlers array is modified during execution. - if ((eventFnsLength > 1)) { - eventFns = shallowCopy(eventFns); - } - - for (var i = 0; i < eventFnsLength; i++) { - if (!event.isImmediatePropagationStopped()) { - eventFns[i].call(element, event); - } - } - }; - - // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all - // events on `element` - eventHandler.elem = element; - return eventHandler; -} - -////////////////////////////////////////// -// Functions iterating traversal. -// These functions chain results into a single -// selector. -////////////////////////////////////////// -forEach({ - removeData: jqLiteRemoveData, - - on: function jqLiteOn(element, type, fn, unsupported) { - if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters'); - - // Do not add event handlers to non-elements because they will not be cleaned up. - if (!jqLiteAcceptsData(element)) { - return; - } - - var expandoStore = jqLiteExpandoStore(element, true); - var events = expandoStore.events; - var handle = expandoStore.handle; - - if (!handle) { - handle = expandoStore.handle = createEventHandler(element, events); - } - - // http://jsperf.com/string-indexof-vs-split - var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type]; - var i = types.length; - - while (i--) { - type = types[i]; - var eventFns = events[type]; - - if (!eventFns) { - events[type] = []; - - if (type === 'mouseenter' || type === 'mouseleave') { - // Refer to jQuery's implementation of mouseenter & mouseleave - // Read about mouseenter and mouseleave: - // http://www.quirksmode.org/js/events_mouse.html#link8 - - jqLiteOn(element, MOUSE_EVENT_MAP[type], function(event) { - var target = this, related = event.relatedTarget; - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if (!related || (related !== target && !target.contains(related))) { - handle(event, type); - } - }); - - } else { - if (type !== '$destroy') { - addEventListenerFn(element, type, handle); - } - } - eventFns = events[type]; - } - eventFns.push(fn); - } - }, - - off: jqLiteOff, - - one: function(element, type, fn) { - element = jqLite(element); - - //add the listener twice so that when it is called - //you can remove the original function and still be - //able to call element.off(ev, fn) normally - element.on(type, function onFn() { - element.off(type, fn); - element.off(type, onFn); - }); - element.on(type, fn); - }, - - replaceWith: function(element, replaceNode) { - var index, parent = element.parentNode; - jqLiteDealoc(element); - forEach(new JQLite(replaceNode), function(node) { - if (index) { - parent.insertBefore(node, index.nextSibling); - } else { - parent.replaceChild(node, element); - } - index = node; - }); - }, - - children: function(element) { - var children = []; - forEach(element.childNodes, function(element) { - if (element.nodeType === NODE_TYPE_ELEMENT) - children.push(element); - }); - return children; - }, - - contents: function(element) { - return element.contentDocument || element.childNodes || []; - }, - - append: function(element, node) { - var nodeType = element.nodeType; - if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return; - - node = new JQLite(node); - - for (var i = 0, ii = node.length; i < ii; i++) { - var child = node[i]; - element.appendChild(child); - } - }, - - prepend: function(element, node) { - if (element.nodeType === NODE_TYPE_ELEMENT) { - var index = element.firstChild; - forEach(new JQLite(node), function(child) { - element.insertBefore(child, index); - }); - } - }, - - wrap: function(element, wrapNode) { - wrapNode = jqLite(wrapNode).eq(0).clone()[0]; - var parent = element.parentNode; - if (parent) { - parent.replaceChild(wrapNode, element); - } - wrapNode.appendChild(element); - }, - - remove: jqLiteRemove, - - detach: function(element) { - jqLiteRemove(element, true); - }, - - after: function(element, newElement) { - var index = element, parent = element.parentNode; - newElement = new JQLite(newElement); - - for (var i = 0, ii = newElement.length; i < ii; i++) { - var node = newElement[i]; - parent.insertBefore(node, index.nextSibling); - index = node; - } - }, - - addClass: jqLiteAddClass, - removeClass: jqLiteRemoveClass, - - toggleClass: function(element, selector, condition) { - if (selector) { - forEach(selector.split(' '), function(className) { - var classCondition = condition; - if (isUndefined(classCondition)) { - classCondition = !jqLiteHasClass(element, className); - } - (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className); - }); - } - }, - - parent: function(element) { - var parent = element.parentNode; - return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null; - }, - - next: function(element) { - return element.nextElementSibling; - }, - - find: function(element, selector) { - if (element.getElementsByTagName) { - return element.getElementsByTagName(selector); - } else { - return []; - } - }, - - clone: jqLiteClone, - - triggerHandler: function(element, event, extraParameters) { - - var dummyEvent, eventFnsCopy, handlerArgs; - var eventName = event.type || event; - var expandoStore = jqLiteExpandoStore(element); - var events = expandoStore && expandoStore.events; - var eventFns = events && events[eventName]; - - if (eventFns) { - // Create a dummy event to pass to the handlers - dummyEvent = { - preventDefault: function() { this.defaultPrevented = true; }, - isDefaultPrevented: function() { return this.defaultPrevented === true; }, - stopImmediatePropagation: function() { this.immediatePropagationStopped = true; }, - isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; }, - stopPropagation: noop, - type: eventName, - target: element - }; - - // If a custom event was provided then extend our dummy event with it - if (event.type) { - dummyEvent = extend(dummyEvent, event); - } - - // Copy event handlers in case event handlers array is modified during execution. - eventFnsCopy = shallowCopy(eventFns); - handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent]; - - forEach(eventFnsCopy, function(fn) { - if (!dummyEvent.isImmediatePropagationStopped()) { - fn.apply(element, handlerArgs); - } - }); - } - } -}, function(fn, name) { - /** - * chaining functions - */ - JQLite.prototype[name] = function(arg1, arg2, arg3) { - var value; - - for (var i = 0, ii = this.length; i < ii; i++) { - if (isUndefined(value)) { - value = fn(this[i], arg1, arg2, arg3); - if (isDefined(value)) { - // any function which returns a value needs to be wrapped - value = jqLite(value); - } - } else { - jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3)); - } - } - return isDefined(value) ? value : this; - }; - - // bind legacy bind/unbind to on/off - JQLite.prototype.bind = JQLite.prototype.on; - JQLite.prototype.unbind = JQLite.prototype.off; -}); - -/** - * Computes a hash of an 'obj'. - * Hash of a: - * string is string - * number is number as string - * object is either result of calling $$hashKey function on the object or uniquely generated id, - * that is also assigned to the $$hashKey property of the object. - * - * @param obj - * @returns {string} hash string such that the same input will have the same hash string. - * The resulting string key is in 'type:hashKey' format. - */ -function hashKey(obj, nextUidFn) { - var key = obj && obj.$$hashKey; - - if (key) { - if (typeof key === 'function') { - key = obj.$$hashKey(); - } - return key; - } - - var objType = typeof obj; - if (objType == 'function' || (objType == 'object' && obj !== null)) { - key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)(); - } else { - key = objType + ':' + obj; - } - - return key; -} - -/** - * HashMap which can use objects as keys - */ -function HashMap(array, isolatedUid) { - if (isolatedUid) { - var uid = 0; - this.nextUid = function() { - return ++uid; - }; - } - forEach(array, this.put, this); -} -HashMap.prototype = { - /** - * Store key value pair - * @param key key to store can be any type - * @param value value to store can be any type - */ - put: function(key, value) { - this[hashKey(key, this.nextUid)] = value; - }, - - /** - * @param key - * @returns {Object} the value for the key - */ - get: function(key) { - return this[hashKey(key, this.nextUid)]; - }, - - /** - * Remove the key/value pair - * @param key - */ - remove: function(key) { - var value = this[key = hashKey(key, this.nextUid)]; - delete this[key]; - return value; - } -}; - -/** - * @ngdoc function - * @module ng - * @name angular.injector - * @kind function - * - * @description - * Creates an injector object that can be used for retrieving services as well as for - * dependency injection (see {@link guide/di dependency injection}). - * - - * @param {Array.} modules A list of module functions or their aliases. See - * {@link angular.module}. The `ng` module must be explicitly added. - * @returns {injector} Injector object. See {@link auto.$injector $injector}. - * - * @example - * Typical usage - * ```js - * // create an injector - * var $injector = angular.injector(['ng']); - * - * // use the injector to kick off your application - * // use the type inference to auto inject arguments, or use implicit injection - * $injector.invoke(function($rootScope, $compile, $document) { - * $compile($document)($rootScope); - * $rootScope.$digest(); - * }); - * ``` - * - * Sometimes you want to get access to the injector of a currently running Angular app - * from outside Angular. Perhaps, you want to inject and compile some markup after the - * application has been bootstrapped. You can do this using the extra `injector()` added - * to JQuery/jqLite elements. See {@link angular.element}. - * - * *This is fairly rare but could be the case if a third party library is injecting the - * markup.* - * - * In the following example a new block of HTML containing a `ng-controller` - * directive is added to the end of the document body by JQuery. We then compile and link - * it into the current AngularJS scope. - * - * ```js - * var $div = $('
{{content.label}}
'); - * $(document.body).append($div); - * - * angular.element(document).injector().invoke(function($compile) { - * var scope = angular.element($div).scope(); - * $compile($div)(scope); - * }); - * ``` - */ - - -/** - * @ngdoc module - * @name auto - * @description - * - * Implicit module which gets automatically added to each {@link auto.$injector $injector}. - */ - -var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m; -var FN_ARG_SPLIT = /,/; -var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/; -var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; -var $injectorMinErr = minErr('$injector'); - -function anonFn(fn) { - // For anonymous functions, showing at the very least the function signature can help in - // debugging. - var fnText = fn.toString().replace(STRIP_COMMENTS, ''), - args = fnText.match(FN_ARGS); - if (args) { - return 'function(' + (args[1] || '').replace(/[\s\r\n]+/, ' ') + ')'; - } - return 'fn'; -} - -function annotate(fn, strictDi, name) { - var $inject, - fnText, - argDecl, - last; - - if (typeof fn === 'function') { - if (!($inject = fn.$inject)) { - $inject = []; - if (fn.length) { - if (strictDi) { - if (!isString(name) || !name) { - name = fn.name || anonFn(fn); - } - throw $injectorMinErr('strictdi', - '{0} is not using explicit annotation and cannot be invoked in strict mode', name); - } - fnText = fn.toString().replace(STRIP_COMMENTS, ''); - argDecl = fnText.match(FN_ARGS); - forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) { - arg.replace(FN_ARG, function(all, underscore, name) { - $inject.push(name); - }); - }); - } - fn.$inject = $inject; - } - } else if (isArray(fn)) { - last = fn.length - 1; - assertArgFn(fn[last], 'fn'); - $inject = fn.slice(0, last); - } else { - assertArgFn(fn, 'fn', true); - } - return $inject; -} - -/////////////////////////////////////// - -/** - * @ngdoc service - * @name $injector - * - * @description - * - * `$injector` is used to retrieve object instances as defined by - * {@link auto.$provide provider}, instantiate types, invoke methods, - * and load modules. - * - * The following always holds true: - * - * ```js - * var $injector = angular.injector(); - * expect($injector.get('$injector')).toBe($injector); - * expect($injector.invoke(function($injector) { - * return $injector; - * })).toBe($injector); - * ``` - * - * # Injection Function Annotation - * - * JavaScript does not have annotations, and annotations are needed for dependency injection. The - * following are all valid ways of annotating function with injection arguments and are equivalent. - * - * ```js - * // inferred (only works if code not minified/obfuscated) - * $injector.invoke(function(serviceA){}); - * - * // annotated - * function explicit(serviceA) {}; - * explicit.$inject = ['serviceA']; - * $injector.invoke(explicit); - * - * // inline - * $injector.invoke(['serviceA', function(serviceA){}]); - * ``` - * - * ## Inference - * - * In JavaScript calling `toString()` on a function returns the function definition. The definition - * can then be parsed and the function arguments can be extracted. *NOTE:* This does not work with - * minification, and obfuscation tools since these tools change the argument names. - * - * ## `$inject` Annotation - * By adding an `$inject` property onto a function the injection parameters can be specified. - * - * ## Inline - * As an array of injection names, where the last item in the array is the function to call. - */ - -/** - * @ngdoc method - * @name $injector#get - * - * @description - * Return an instance of the service. - * - * @param {string} name The name of the instance to retrieve. - * @return {*} The instance. - */ - -/** - * @ngdoc method - * @name $injector#invoke - * - * @description - * Invoke the method and supply the method arguments from the `$injector`. - * - * @param {!Function} fn The function to invoke. Function parameters are injected according to the - * {@link guide/di $inject Annotation} rules. - * @param {Object=} self The `this` for the invoked method. - * @param {Object=} locals Optional object. If preset then any argument names are read from this - * object first, before the `$injector` is consulted. - * @returns {*} the value returned by the invoked `fn` function. - */ - -/** - * @ngdoc method - * @name $injector#has - * - * @description - * Allows the user to query if the particular service exists. - * - * @param {string} name Name of the service to query. - * @returns {boolean} `true` if injector has given service. - */ - -/** - * @ngdoc method - * @name $injector#instantiate - * @description - * Create a new instance of JS type. The method takes a constructor function, invokes the new - * operator, and supplies all of the arguments to the constructor function as specified by the - * constructor annotation. - * - * @param {Function} Type Annotated constructor function. - * @param {Object=} locals Optional object. If preset then any argument names are read from this - * object first, before the `$injector` is consulted. - * @returns {Object} new instance of `Type`. - */ - -/** - * @ngdoc method - * @name $injector#annotate - * - * @description - * Returns an array of service names which the function is requesting for injection. This API is - * used by the injector to determine which services need to be injected into the function when the - * function is invoked. There are three ways in which the function can be annotated with the needed - * dependencies. - * - * # Argument names - * - * The simplest form is to extract the dependencies from the arguments of the function. This is done - * by converting the function into a string using `toString()` method and extracting the argument - * names. - * ```js - * // Given - * function MyController($scope, $route) { - * // ... - * } - * - * // Then - * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']); - * ``` - * - * This method does not work with code minification / obfuscation. For this reason the following - * annotation strategies are supported. - * - * # The `$inject` property - * - * If a function has an `$inject` property and its value is an array of strings, then the strings - * represent names of services to be injected into the function. - * ```js - * // Given - * var MyController = function(obfuscatedScope, obfuscatedRoute) { - * // ... - * } - * // Define function dependencies - * MyController['$inject'] = ['$scope', '$route']; - * - * // Then - * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']); - * ``` - * - * # The array notation - * - * It is often desirable to inline Injected functions and that's when setting the `$inject` property - * is very inconvenient. In these situations using the array notation to specify the dependencies in - * a way that survives minification is a better choice: - * - * ```js - * // We wish to write this (not minification / obfuscation safe) - * injector.invoke(function($compile, $rootScope) { - * // ... - * }); - * - * // We are forced to write break inlining - * var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) { - * // ... - * }; - * tmpFn.$inject = ['$compile', '$rootScope']; - * injector.invoke(tmpFn); - * - * // To better support inline function the inline annotation is supported - * injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) { - * // ... - * }]); - * - * // Therefore - * expect(injector.annotate( - * ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}]) - * ).toEqual(['$compile', '$rootScope']); - * ``` - * - * @param {Function|Array.} fn Function for which dependent service names need to - * be retrieved as described above. - * - * @returns {Array.} The names of the services which the function requires. - */ - - - - -/** - * @ngdoc service - * @name $provide - * - * @description - * - * The {@link auto.$provide $provide} service has a number of methods for registering components - * with the {@link auto.$injector $injector}. Many of these functions are also exposed on - * {@link angular.Module}. - * - * An Angular **service** is a singleton object created by a **service factory**. These **service - * factories** are functions which, in turn, are created by a **service provider**. - * The **service providers** are constructor functions. When instantiated they must contain a - * property called `$get`, which holds the **service factory** function. - * - * When you request a service, the {@link auto.$injector $injector} is responsible for finding the - * correct **service provider**, instantiating it and then calling its `$get` **service factory** - * function to get the instance of the **service**. - * - * Often services have no configuration options and there is no need to add methods to the service - * provider. The provider will be no more than a constructor function with a `$get` property. For - * these cases the {@link auto.$provide $provide} service has additional helper methods to register - * services without specifying a provider. - * - * * {@link auto.$provide#provider provider(provider)} - registers a **service provider** with the - * {@link auto.$injector $injector} - * * {@link auto.$provide#constant constant(obj)} - registers a value/object that can be accessed by - * providers and services. - * * {@link auto.$provide#value value(obj)} - registers a value/object that can only be accessed by - * services, not providers. - * * {@link auto.$provide#factory factory(fn)} - registers a service **factory function**, `fn`, - * that will be wrapped in a **service provider** object, whose `$get` property will contain the - * given factory function. - * * {@link auto.$provide#service service(class)} - registers a **constructor function**, `class` - * that will be wrapped in a **service provider** object, whose `$get` property will instantiate - * a new object using the given constructor function. - * - * See the individual methods for more information and examples. - */ - -/** - * @ngdoc method - * @name $provide#provider - * @description - * - * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions - * are constructor functions, whose instances are responsible for "providing" a factory for a - * service. - * - * Service provider names start with the name of the service they provide followed by `Provider`. - * For example, the {@link ng.$log $log} service has a provider called - * {@link ng.$logProvider $logProvider}. - * - * Service provider objects can have additional methods which allow configuration of the provider - * and its service. Importantly, you can configure what kind of service is created by the `$get` - * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a - * method {@link ng.$logProvider#debugEnabled debugEnabled} - * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the - * console or not. - * - * @param {string} name The name of the instance. NOTE: the provider will be available under `name + - 'Provider'` key. - * @param {(Object|function())} provider If the provider is: - * - * - `Object`: then it should have a `$get` method. The `$get` method will be invoked using - * {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created. - * - `Constructor`: a new instance of the provider will be created using - * {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`. - * - * @returns {Object} registered provider instance - - * @example - * - * The following example shows how to create a simple event tracking service and register it using - * {@link auto.$provide#provider $provide.provider()}. - * - * ```js - * // Define the eventTracker provider - * function EventTrackerProvider() { - * var trackingUrl = '/track'; - * - * // A provider method for configuring where the tracked events should been saved - * this.setTrackingUrl = function(url) { - * trackingUrl = url; - * }; - * - * // The service factory function - * this.$get = ['$http', function($http) { - * var trackedEvents = {}; - * return { - * // Call this to track an event - * event: function(event) { - * var count = trackedEvents[event] || 0; - * count += 1; - * trackedEvents[event] = count; - * return count; - * }, - * // Call this to save the tracked events to the trackingUrl - * save: function() { - * $http.post(trackingUrl, trackedEvents); - * } - * }; - * }]; - * } - * - * describe('eventTracker', function() { - * var postSpy; - * - * beforeEach(module(function($provide) { - * // Register the eventTracker provider - * $provide.provider('eventTracker', EventTrackerProvider); - * })); - * - * beforeEach(module(function(eventTrackerProvider) { - * // Configure eventTracker provider - * eventTrackerProvider.setTrackingUrl('/custom-track'); - * })); - * - * it('tracks events', inject(function(eventTracker) { - * expect(eventTracker.event('login')).toEqual(1); - * expect(eventTracker.event('login')).toEqual(2); - * })); - * - * it('saves to the tracking url', inject(function(eventTracker, $http) { - * postSpy = spyOn($http, 'post'); - * eventTracker.event('login'); - * eventTracker.save(); - * expect(postSpy).toHaveBeenCalled(); - * expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track'); - * expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track'); - * expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 }); - * })); - * }); - * ``` - */ - -/** - * @ngdoc method - * @name $provide#factory - * @description - * - * Register a **service factory**, which will be called to return the service instance. - * This is short for registering a service where its provider consists of only a `$get` property, - * which is the given service factory function. - * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to - * configure your service in a provider. - * - * @param {string} name The name of the instance. - * @param {function()} $getFn The $getFn for the instance creation. Internally this is a short hand - * for `$provide.provider(name, {$get: $getFn})`. - * @returns {Object} registered provider instance - * - * @example - * Here is an example of registering a service - * ```js - * $provide.factory('ping', ['$http', function($http) { - * return function ping() { - * return $http.send('/ping'); - * }; - * }]); - * ``` - * You would then inject and use this service like this: - * ```js - * someModule.controller('Ctrl', ['ping', function(ping) { - * ping(); - * }]); - * ``` - */ - - -/** - * @ngdoc method - * @name $provide#service - * @description - * - * Register a **service constructor**, which will be invoked with `new` to create the service - * instance. - * This is short for registering a service where its provider's `$get` property is the service - * constructor function that will be used to instantiate the service instance. - * - * You should use {@link auto.$provide#service $provide.service(class)} if you define your service - * as a type/class. - * - * @param {string} name The name of the instance. - * @param {Function} constructor A class (constructor function) that will be instantiated. - * @returns {Object} registered provider instance - * - * @example - * Here is an example of registering a service using - * {@link auto.$provide#service $provide.service(class)}. - * ```js - * var Ping = function($http) { - * this.$http = $http; - * }; - * - * Ping.$inject = ['$http']; - * - * Ping.prototype.send = function() { - * return this.$http.get('/ping'); - * }; - * $provide.service('ping', Ping); - * ``` - * You would then inject and use this service like this: - * ```js - * someModule.controller('Ctrl', ['ping', function(ping) { - * ping.send(); - * }]); - * ``` - */ - - -/** - * @ngdoc method - * @name $provide#value - * @description - * - * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a - * number, an array, an object or a function. This is short for registering a service where its - * provider's `$get` property is a factory function that takes no arguments and returns the **value - * service**. - * - * Value services are similar to constant services, except that they cannot be injected into a - * module configuration function (see {@link angular.Module#config}) but they can be overridden by - * an Angular - * {@link auto.$provide#decorator decorator}. - * - * @param {string} name The name of the instance. - * @param {*} value The value. - * @returns {Object} registered provider instance - * - * @example - * Here are some examples of creating value services. - * ```js - * $provide.value('ADMIN_USER', 'admin'); - * - * $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 }); - * - * $provide.value('halfOf', function(value) { - * return value / 2; - * }); - * ``` - */ - - -/** - * @ngdoc method - * @name $provide#constant - * @description - * - * Register a **constant service**, such as a string, a number, an array, an object or a function, - * with the {@link auto.$injector $injector}. Unlike {@link auto.$provide#value value} it can be - * injected into a module configuration function (see {@link angular.Module#config}) and it cannot - * be overridden by an Angular {@link auto.$provide#decorator decorator}. - * - * @param {string} name The name of the constant. - * @param {*} value The constant value. - * @returns {Object} registered instance - * - * @example - * Here a some examples of creating constants: - * ```js - * $provide.constant('SHARD_HEIGHT', 306); - * - * $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']); - * - * $provide.constant('double', function(value) { - * return value * 2; - * }); - * ``` - */ - - -/** - * @ngdoc method - * @name $provide#decorator - * @description - * - * Register a **service decorator** with the {@link auto.$injector $injector}. A service decorator - * intercepts the creation of a service, allowing it to override or modify the behaviour of the - * service. The object returned by the decorator may be the original service, or a new service - * object which replaces or wraps and delegates to the original service. - * - * @param {string} name The name of the service to decorate. - * @param {function()} decorator This function will be invoked when the service needs to be - * instantiated and should return the decorated service instance. The function is called using - * the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable. - * Local injection arguments: - * - * * `$delegate` - The original service instance, which can be monkey patched, configured, - * decorated or delegated to. - * - * @example - * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting - * calls to {@link ng.$log#error $log.warn()}. - * ```js - * $provide.decorator('$log', ['$delegate', function($delegate) { - * $delegate.warn = $delegate.error; - * return $delegate; - * }]); - * ``` - */ - - -function createInjector(modulesToLoad, strictDi) { - strictDi = (strictDi === true); - var INSTANTIATING = {}, - providerSuffix = 'Provider', - path = [], - loadedModules = new HashMap([], true), - providerCache = { - $provide: { - provider: supportObject(provider), - factory: supportObject(factory), - service: supportObject(service), - value: supportObject(value), - constant: supportObject(constant), - decorator: decorator - } - }, - providerInjector = (providerCache.$injector = - createInternalInjector(providerCache, function() { - throw $injectorMinErr('unpr', "Unknown provider: {0}", path.join(' <- ')); - })), - instanceCache = {}, - instanceInjector = (instanceCache.$injector = - createInternalInjector(instanceCache, function(servicename) { - var provider = providerInjector.get(servicename + providerSuffix); - return instanceInjector.invoke(provider.$get, provider, undefined, servicename); - })); - - - forEach(loadModules(modulesToLoad), function(fn) { instanceInjector.invoke(fn || noop); }); - - return instanceInjector; - - //////////////////////////////////// - // $provider - //////////////////////////////////// - - function supportObject(delegate) { - return function(key, value) { - if (isObject(key)) { - forEach(key, reverseParams(delegate)); - } else { - return delegate(key, value); - } - }; - } - - function provider(name, provider_) { - assertNotHasOwnProperty(name, 'service'); - if (isFunction(provider_) || isArray(provider_)) { - provider_ = providerInjector.instantiate(provider_); - } - if (!provider_.$get) { - throw $injectorMinErr('pget', "Provider '{0}' must define $get factory method.", name); - } - return providerCache[name + providerSuffix] = provider_; - } - - function enforceReturnValue(name, factory) { - return function enforcedReturnValue() { - var result = instanceInjector.invoke(factory, this, undefined, name); - if (isUndefined(result)) { - throw $injectorMinErr('undef', "Provider '{0}' must return a value from $get factory method.", name); - } - return result; - }; - } - - function factory(name, factoryFn, enforce) { - return provider(name, { - $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn - }); - } - - function service(name, constructor) { - return factory(name, ['$injector', function($injector) { - return $injector.instantiate(constructor); - }]); - } - - function value(name, val) { return factory(name, valueFn(val), false); } - - function constant(name, value) { - assertNotHasOwnProperty(name, 'constant'); - providerCache[name] = value; - instanceCache[name] = value; - } - - function decorator(serviceName, decorFn) { - var origProvider = providerInjector.get(serviceName + providerSuffix), - orig$get = origProvider.$get; - - origProvider.$get = function() { - var origInstance = instanceInjector.invoke(orig$get, origProvider); - return instanceInjector.invoke(decorFn, null, {$delegate: origInstance}); - }; - } - - //////////////////////////////////// - // Module Loading - //////////////////////////////////// - function loadModules(modulesToLoad) { - var runBlocks = [], moduleFn; - forEach(modulesToLoad, function(module) { - if (loadedModules.get(module)) return; - loadedModules.put(module, true); - - function runInvokeQueue(queue) { - var i, ii; - for (i = 0, ii = queue.length; i < ii; i++) { - var invokeArgs = queue[i], - provider = providerInjector.get(invokeArgs[0]); - - provider[invokeArgs[1]].apply(provider, invokeArgs[2]); - } - } - - try { - if (isString(module)) { - moduleFn = angularModule(module); - runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks); - runInvokeQueue(moduleFn._invokeQueue); - runInvokeQueue(moduleFn._configBlocks); - } else if (isFunction(module)) { - runBlocks.push(providerInjector.invoke(module)); - } else if (isArray(module)) { - runBlocks.push(providerInjector.invoke(module)); - } else { - assertArgFn(module, 'module'); - } - } catch (e) { - if (isArray(module)) { - module = module[module.length - 1]; - } - if (e.message && e.stack && e.stack.indexOf(e.message) == -1) { - // Safari & FF's stack traces don't contain error.message content - // unlike those of Chrome and IE - // So if stack doesn't contain message, we create a new string that contains both. - // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here. - /* jshint -W022 */ - e = e.message + '\n' + e.stack; - } - throw $injectorMinErr('modulerr', "Failed to instantiate module {0} due to:\n{1}", - module, e.stack || e.message || e); - } - }); - return runBlocks; - } - - //////////////////////////////////// - // internal Injector - //////////////////////////////////// - - function createInternalInjector(cache, factory) { - - function getService(serviceName) { - if (cache.hasOwnProperty(serviceName)) { - if (cache[serviceName] === INSTANTIATING) { - throw $injectorMinErr('cdep', 'Circular dependency found: {0}', - serviceName + ' <- ' + path.join(' <- ')); - } - return cache[serviceName]; - } else { - try { - path.unshift(serviceName); - cache[serviceName] = INSTANTIATING; - return cache[serviceName] = factory(serviceName); - } catch (err) { - if (cache[serviceName] === INSTANTIATING) { - delete cache[serviceName]; - } - throw err; - } finally { - path.shift(); - } - } - } - - function invoke(fn, self, locals, serviceName) { - if (typeof locals === 'string') { - serviceName = locals; - locals = null; - } - - var args = [], - $inject = annotate(fn, strictDi, serviceName), - length, i, - key; - - for (i = 0, length = $inject.length; i < length; i++) { - key = $inject[i]; - if (typeof key !== 'string') { - throw $injectorMinErr('itkn', - 'Incorrect injection token! Expected service name as string, got {0}', key); - } - args.push( - locals && locals.hasOwnProperty(key) - ? locals[key] - : getService(key) - ); - } - if (isArray(fn)) { - fn = fn[length]; - } - - // http://jsperf.com/angularjs-invoke-apply-vs-switch - // #5388 - return fn.apply(self, args); - } - - function instantiate(Type, locals, serviceName) { - var Constructor = function() {}, - instance, returnedValue; - - // Check if Type is annotated and use just the given function at n-1 as parameter - // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]); - Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype; - instance = new Constructor(); - returnedValue = invoke(Type, instance, locals, serviceName); - - return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance; - } - - return { - invoke: invoke, - instantiate: instantiate, - get: getService, - annotate: annotate, - has: function(name) { - return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name); - } - }; - } -} - -createInjector.$$annotate = annotate; - -/** - * @ngdoc provider - * @name $anchorScrollProvider - * - * @description - * Use `$anchorScrollProvider` to disable automatic scrolling whenever - * {@link ng.$location#hash $location.hash()} changes. - */ -function $AnchorScrollProvider() { - - var autoScrollingEnabled = true; - - /** - * @ngdoc method - * @name $anchorScrollProvider#disableAutoScrolling - * - * @description - * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to - * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.
- * Use this method to disable automatic scrolling. - * - * If automatic scrolling is disabled, one must explicitly call - * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the - * current hash. - */ - this.disableAutoScrolling = function() { - autoScrollingEnabled = false; - }; - - /** - * @ngdoc service - * @name $anchorScroll - * @kind function - * @requires $window - * @requires $location - * @requires $rootScope - * - * @description - * When called, it checks the current value of {@link ng.$location#hash $location.hash()} and - * scrolls to the related element, according to the rules specified in the - * [Html5 spec](http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document). - * - * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to - * match any anchor whenever it changes. This can be disabled by calling - * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}. - * - * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a - * vertical scroll-offset (either fixed or dynamic). - * - * @property {(number|function|jqLite)} yOffset - * If set, specifies a vertical scroll-offset. This is often useful when there are fixed - * positioned elements at the top of the page, such as navbars, headers etc. - * - * `yOffset` can be specified in various ways: - * - **number**: A fixed number of pixels to be used as offset.

- * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return - * a number representing the offset (in pixels).

- * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from - * the top of the page to the element's bottom will be used as offset.
- * **Note**: The element will be taken into account only as long as its `position` is set to - * `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust - * their height and/or positioning according to the viewport's size. - * - *
- *
- * In order for `yOffset` to work properly, scrolling should take place on the document's root and - * not some child element. - *
- * - * @example - - -
- Go to bottom - You're at the bottom! -
-
- - angular.module('anchorScrollExample', []) - .controller('ScrollController', ['$scope', '$location', '$anchorScroll', - function ($scope, $location, $anchorScroll) { - $scope.gotoBottom = function() { - // set the location.hash to the id of - // the element you wish to scroll to. - $location.hash('bottom'); - - // call $anchorScroll() - $anchorScroll(); - }; - }]); - - - #scrollArea { - height: 280px; - overflow: auto; - } - - #bottom { - display: block; - margin-top: 2000px; - } - -
- * - *
- * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value). - * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details. - * - * @example - - - -
- Anchor {{x}} of 5 -
-
- - angular.module('anchorScrollOffsetExample', []) - .run(['$anchorScroll', function($anchorScroll) { - $anchorScroll.yOffset = 50; // always scroll by 50 extra pixels - }]) - .controller('headerCtrl', ['$anchorScroll', '$location', '$scope', - function ($anchorScroll, $location, $scope) { - $scope.gotoAnchor = function(x) { - var newHash = 'anchor' + x; - if ($location.hash() !== newHash) { - // set the $location.hash to `newHash` and - // $anchorScroll will automatically scroll to it - $location.hash('anchor' + x); - } else { - // call $anchorScroll() explicitly, - // since $location.hash hasn't changed - $anchorScroll(); - } - }; - } - ]); - - - body { - padding-top: 50px; - } - - .anchor { - border: 2px dashed DarkOrchid; - padding: 10px 10px 200px 10px; - } - - .fixed-header { - background-color: rgba(0, 0, 0, 0.2); - height: 50px; - position: fixed; - top: 0; left: 0; right: 0; - } - - .fixed-header > a { - display: inline-block; - margin: 5px 15px; - } - -
- */ - this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) { - var document = $window.document; - - // Helper function to get first anchor from a NodeList - // (using `Array#some()` instead of `angular#forEach()` since it's more performant - // and working in all supported browsers.) - function getFirstAnchor(list) { - var result = null; - Array.prototype.some.call(list, function(element) { - if (nodeName_(element) === 'a') { - result = element; - return true; - } - }); - return result; - } - - function getYOffset() { - - var offset = scroll.yOffset; - - if (isFunction(offset)) { - offset = offset(); - } else if (isElement(offset)) { - var elem = offset[0]; - var style = $window.getComputedStyle(elem); - if (style.position !== 'fixed') { - offset = 0; - } else { - offset = elem.getBoundingClientRect().bottom; - } - } else if (!isNumber(offset)) { - offset = 0; - } - - return offset; - } - - function scrollTo(elem) { - if (elem) { - elem.scrollIntoView(); - - var offset = getYOffset(); - - if (offset) { - // `offset` is the number of pixels we should scroll UP in order to align `elem` properly. - // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the - // top of the viewport. - // - // IF the number of pixels from the top of `elem` to the end of the page's content is less - // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some - // way down the page. - // - // This is often the case for elements near the bottom of the page. - // - // In such cases we do not need to scroll the whole `offset` up, just the difference between - // the top of the element and the offset, which is enough to align the top of `elem` at the - // desired position. - var elemTop = elem.getBoundingClientRect().top; - $window.scrollBy(0, elemTop - offset); - } - } else { - $window.scrollTo(0, 0); - } - } - - function scroll() { - var hash = $location.hash(), elm; - - // empty hash, scroll to the top of the page - if (!hash) scrollTo(null); - - // element with given id - else if ((elm = document.getElementById(hash))) scrollTo(elm); - - // first anchor with given name :-D - else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm); - - // no element and hash == 'top', scroll to the top of the page - else if (hash === 'top') scrollTo(null); - } - - // does not scroll when user clicks on anchor link that is currently on - // (no url change, no $location.hash() change), browser native does scroll - if (autoScrollingEnabled) { - $rootScope.$watch(function autoScrollWatch() {return $location.hash();}, - function autoScrollWatchAction(newVal, oldVal) { - // skip the initial scroll if $location.hash is empty - if (newVal === oldVal && newVal === '') return; - - jqLiteDocumentLoaded(function() { - $rootScope.$evalAsync(scroll); - }); - }); - } - - return scroll; - }]; -} - -var $animateMinErr = minErr('$animate'); - -/** - * @ngdoc provider - * @name $animateProvider - * - * @description - * Default implementation of $animate that doesn't perform any animations, instead just - * synchronously performs DOM - * updates and calls done() callbacks. - * - * In order to enable animations the ngAnimate module has to be loaded. - * - * To see the functional implementation check out src/ngAnimate/animate.js - */ -var $AnimateProvider = ['$provide', function($provide) { - - - this.$$selectors = {}; - - - /** - * @ngdoc method - * @name $animateProvider#register - * - * @description - * Registers a new injectable animation factory function. The factory function produces the - * animation object which contains callback functions for each event that is expected to be - * animated. - * - * * `eventFn`: `function(Element, doneFunction)` The element to animate, the `doneFunction` - * must be called once the element animation is complete. If a function is returned then the - * animation service will use this function to cancel the animation whenever a cancel event is - * triggered. - * - * - * ```js - * return { - * eventFn : function(element, done) { - * //code to run the animation - * //once complete, then run done() - * return function cancellationFunction() { - * //code to cancel the animation - * } - * } - * } - * ``` - * - * @param {string} name The name of the animation. - * @param {Function} factory The factory function that will be executed to return the animation - * object. - */ - this.register = function(name, factory) { - var key = name + '-animation'; - if (name && name.charAt(0) != '.') throw $animateMinErr('notcsel', - "Expecting class selector starting with '.' got '{0}'.", name); - this.$$selectors[name.substr(1)] = key; - $provide.factory(key, factory); - }; - - /** - * @ngdoc method - * @name $animateProvider#classNameFilter - * - * @description - * Sets and/or returns the CSS class regular expression that is checked when performing - * an animation. Upon bootstrap the classNameFilter value is not set at all and will - * therefore enable $animate to attempt to perform an animation on any element. - * When setting the classNameFilter value, animations will only be performed on elements - * that successfully match the filter expression. This in turn can boost performance - * for low-powered devices as well as applications containing a lot of structural operations. - * @param {RegExp=} expression The className expression which will be checked against all animations - * @return {RegExp} The current CSS className expression value. If null then there is no expression value - */ - this.classNameFilter = function(expression) { - if (arguments.length === 1) { - this.$$classNameFilter = (expression instanceof RegExp) ? expression : null; - } - return this.$$classNameFilter; - }; - - this.$get = ['$$q', '$$asyncCallback', '$rootScope', function($$q, $$asyncCallback, $rootScope) { - - var currentDefer; - - function runAnimationPostDigest(fn) { - var cancelFn, defer = $$q.defer(); - defer.promise.$$cancelFn = function ngAnimateMaybeCancel() { - cancelFn && cancelFn(); - }; - - $rootScope.$$postDigest(function ngAnimatePostDigest() { - cancelFn = fn(function ngAnimateNotifyComplete() { - defer.resolve(); - }); - }); - - return defer.promise; - } - - function resolveElementClasses(element, classes) { - var toAdd = [], toRemove = []; - - var hasClasses = createMap(); - forEach((element.attr('class') || '').split(/\s+/), function(className) { - hasClasses[className] = true; - }); - - forEach(classes, function(status, className) { - var hasClass = hasClasses[className]; - - // If the most recent class manipulation (via $animate) was to remove the class, and the - // element currently has the class, the class is scheduled for removal. Otherwise, if - // the most recent class manipulation (via $animate) was to add the class, and the - // element does not currently have the class, the class is scheduled to be added. - if (status === false && hasClass) { - toRemove.push(className); - } else if (status === true && !hasClass) { - toAdd.push(className); - } - }); - - return (toAdd.length + toRemove.length) > 0 && - [toAdd.length ? toAdd : null, toRemove.length ? toRemove : null]; - } - - function cachedClassManipulation(cache, classes, op) { - for (var i=0, ii = classes.length; i < ii; ++i) { - var className = classes[i]; - cache[className] = op; - } - } - - function asyncPromise() { - // only serve one instance of a promise in order to save CPU cycles - if (!currentDefer) { - currentDefer = $$q.defer(); - $$asyncCallback(function() { - currentDefer.resolve(); - currentDefer = null; - }); - } - return currentDefer.promise; - } - - function applyStyles(element, options) { - if (angular.isObject(options)) { - var styles = extend(options.from || {}, options.to || {}); - element.css(styles); - } - } - - /** - * - * @ngdoc service - * @name $animate - * @description The $animate service provides rudimentary DOM manipulation functions to - * insert, remove and move elements within the DOM, as well as adding and removing classes. - * This service is the core service used by the ngAnimate $animator service which provides - * high-level animation hooks for CSS and JavaScript. - * - * $animate is available in the AngularJS core, however, the ngAnimate module must be included - * to enable full out animation support. Otherwise, $animate will only perform simple DOM - * manipulation operations. - * - * To learn more about enabling animation support, click here to visit the {@link ngAnimate - * ngAnimate module page} as well as the {@link ngAnimate.$animate ngAnimate $animate service - * page}. - */ - return { - animate: function(element, from, to) { - applyStyles(element, { from: from, to: to }); - return asyncPromise(); - }, - - /** - * - * @ngdoc method - * @name $animate#enter - * @kind function - * @description Inserts the element into the DOM either after the `after` element or - * as the first child within the `parent` element. When the function is called a promise - * is returned that will be resolved at a later time. - * @param {DOMElement} element the element which will be inserted into the DOM - * @param {DOMElement} parent the parent element which will append the element as - * a child (if the after element is not present) - * @param {DOMElement} after the sibling element which will append the element - * after itself - * @param {object=} options an optional collection of styles that will be applied to the element. - * @return {Promise} the animation callback promise - */ - enter: function(element, parent, after, options) { - applyStyles(element, options); - after ? after.after(element) - : parent.prepend(element); - return asyncPromise(); - }, - - /** - * - * @ngdoc method - * @name $animate#leave - * @kind function - * @description Removes the element from the DOM. When the function is called a promise - * is returned that will be resolved at a later time. - * @param {DOMElement} element the element which will be removed from the DOM - * @param {object=} options an optional collection of options that will be applied to the element. - * @return {Promise} the animation callback promise - */ - leave: function(element, options) { - element.remove(); - return asyncPromise(); - }, - - /** - * - * @ngdoc method - * @name $animate#move - * @kind function - * @description Moves the position of the provided element within the DOM to be placed - * either after the `after` element or inside of the `parent` element. When the function - * is called a promise is returned that will be resolved at a later time. - * - * @param {DOMElement} element the element which will be moved around within the - * DOM - * @param {DOMElement} parent the parent element where the element will be - * inserted into (if the after element is not present) - * @param {DOMElement} after the sibling element where the element will be - * positioned next to - * @param {object=} options an optional collection of options that will be applied to the element. - * @return {Promise} the animation callback promise - */ - move: function(element, parent, after, options) { - // Do not remove element before insert. Removing will cause data associated with the - // element to be dropped. Insert will implicitly do the remove. - return this.enter(element, parent, after, options); - }, - - /** - * - * @ngdoc method - * @name $animate#addClass - * @kind function - * @description Adds the provided className CSS class value to the provided element. - * When the function is called a promise is returned that will be resolved at a later time. - * @param {DOMElement} element the element which will have the className value - * added to it - * @param {string} className the CSS class which will be added to the element - * @param {object=} options an optional collection of options that will be applied to the element. - * @return {Promise} the animation callback promise - */ - addClass: function(element, className, options) { - return this.setClass(element, className, [], options); - }, - - $$addClassImmediately: function(element, className, options) { - element = jqLite(element); - className = !isString(className) - ? (isArray(className) ? className.join(' ') : '') - : className; - forEach(element, function(element) { - jqLiteAddClass(element, className); - }); - applyStyles(element, options); - return asyncPromise(); - }, - - /** - * - * @ngdoc method - * @name $animate#removeClass - * @kind function - * @description Removes the provided className CSS class value from the provided element. - * When the function is called a promise is returned that will be resolved at a later time. - * @param {DOMElement} element the element which will have the className value - * removed from it - * @param {string} className the CSS class which will be removed from the element - * @param {object=} options an optional collection of options that will be applied to the element. - * @return {Promise} the animation callback promise - */ - removeClass: function(element, className, options) { - return this.setClass(element, [], className, options); - }, - - $$removeClassImmediately: function(element, className, options) { - element = jqLite(element); - className = !isString(className) - ? (isArray(className) ? className.join(' ') : '') - : className; - forEach(element, function(element) { - jqLiteRemoveClass(element, className); - }); - applyStyles(element, options); - return asyncPromise(); - }, - - /** - * - * @ngdoc method - * @name $animate#setClass - * @kind function - * @description Adds and/or removes the given CSS classes to and from the element. - * When the function is called a promise is returned that will be resolved at a later time. - * @param {DOMElement} element the element which will have its CSS classes changed - * removed from it - * @param {string} add the CSS classes which will be added to the element - * @param {string} remove the CSS class which will be removed from the element - * @param {object=} options an optional collection of options that will be applied to the element. - * @return {Promise} the animation callback promise - */ - setClass: function(element, add, remove, options) { - var self = this; - var STORAGE_KEY = '$$animateClasses'; - var createdCache = false; - element = jqLite(element); - - var cache = element.data(STORAGE_KEY); - if (!cache) { - cache = { - classes: {}, - options: options - }; - createdCache = true; - } else if (options && cache.options) { - cache.options = angular.extend(cache.options || {}, options); - } - - var classes = cache.classes; - - add = isArray(add) ? add : add.split(' '); - remove = isArray(remove) ? remove : remove.split(' '); - cachedClassManipulation(classes, add, true); - cachedClassManipulation(classes, remove, false); - - if (createdCache) { - cache.promise = runAnimationPostDigest(function(done) { - var cache = element.data(STORAGE_KEY); - element.removeData(STORAGE_KEY); - - // in the event that the element is removed before postDigest - // is run then the cache will be undefined and there will be - // no need anymore to add or remove and of the element classes - if (cache) { - var classes = resolveElementClasses(element, cache.classes); - if (classes) { - self.$$setClassImmediately(element, classes[0], classes[1], cache.options); - } - } - - done(); - }); - element.data(STORAGE_KEY, cache); - } - - return cache.promise; - }, - - $$setClassImmediately: function(element, add, remove, options) { - add && this.$$addClassImmediately(element, add); - remove && this.$$removeClassImmediately(element, remove); - applyStyles(element, options); - return asyncPromise(); - }, - - enabled: noop, - cancel: noop - }; - }]; -}]; - -function $$AsyncCallbackProvider() { - this.$get = ['$$rAF', '$timeout', function($$rAF, $timeout) { - return $$rAF.supported - ? function(fn) { return $$rAF(fn); } - : function(fn) { - return $timeout(fn, 0, false); - }; - }]; -} - -/* global stripHash: true */ - -/** - * ! This is a private undocumented service ! - * - * @name $browser - * @requires $log - * @description - * This object has two goals: - * - * - hide all the global state in the browser caused by the window object - * - abstract away all the browser specific features and inconsistencies - * - * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser` - * service, which can be used for convenient testing of the application without the interaction with - * the real browser apis. - */ -/** - * @param {object} window The global window object. - * @param {object} document jQuery wrapped document. - * @param {object} $log window.console or an object with the same interface. - * @param {object} $sniffer $sniffer service - */ -function Browser(window, document, $log, $sniffer) { - var self = this, - rawDocument = document[0], - location = window.location, - history = window.history, - setTimeout = window.setTimeout, - clearTimeout = window.clearTimeout, - pendingDeferIds = {}; - - self.isMock = false; - - var outstandingRequestCount = 0; - var outstandingRequestCallbacks = []; - - // TODO(vojta): remove this temporary api - self.$$completeOutstandingRequest = completeOutstandingRequest; - self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; }; - - /** - * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` - * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. - */ - function completeOutstandingRequest(fn) { - try { - fn.apply(null, sliceArgs(arguments, 1)); - } finally { - outstandingRequestCount--; - if (outstandingRequestCount === 0) { - while (outstandingRequestCallbacks.length) { - try { - outstandingRequestCallbacks.pop()(); - } catch (e) { - $log.error(e); - } - } - } - } - } - - /** - * @private - * Note: this method is used only by scenario runner - * TODO(vojta): prefix this method with $$ ? - * @param {function()} callback Function that will be called when no outstanding request - */ - self.notifyWhenNoOutstandingRequests = function(callback) { - // force browser to execute all pollFns - this is needed so that cookies and other pollers fire - // at some deterministic time in respect to the test runner's actions. Leaving things up to the - // regular poller would result in flaky tests. - forEach(pollFns, function(pollFn) { pollFn(); }); - - if (outstandingRequestCount === 0) { - callback(); - } else { - outstandingRequestCallbacks.push(callback); - } - }; - - ////////////////////////////////////////////////////////////// - // Poll Watcher API - ////////////////////////////////////////////////////////////// - var pollFns = [], - pollTimeout; - - /** - * @name $browser#addPollFn - * - * @param {function()} fn Poll function to add - * - * @description - * Adds a function to the list of functions that poller periodically executes, - * and starts polling if not started yet. - * - * @returns {function()} the added function - */ - self.addPollFn = function(fn) { - if (isUndefined(pollTimeout)) startPoller(100, setTimeout); - pollFns.push(fn); - return fn; - }; - - /** - * @param {number} interval How often should browser call poll functions (ms) - * @param {function()} setTimeout Reference to a real or fake `setTimeout` function. - * - * @description - * Configures the poller to run in the specified intervals, using the specified - * setTimeout fn and kicks it off. - */ - function startPoller(interval, setTimeout) { - (function check() { - forEach(pollFns, function(pollFn) { pollFn(); }); - pollTimeout = setTimeout(check, interval); - })(); - } - - ////////////////////////////////////////////////////////////// - // URL API - ////////////////////////////////////////////////////////////// - - var cachedState, lastHistoryState, - lastBrowserUrl = location.href, - baseElement = document.find('base'), - reloadLocation = null; - - cacheState(); - lastHistoryState = cachedState; - - /** - * @name $browser#url - * - * @description - * GETTER: - * Without any argument, this method just returns current value of location.href. - * - * SETTER: - * With at least one argument, this method sets url to new value. - * If html5 history api supported, pushState/replaceState is used, otherwise - * location.href/location.replace is used. - * Returns its own instance to allow chaining - * - * NOTE: this api is intended for use only by the $location service. Please use the - * {@link ng.$location $location service} to change url. - * - * @param {string} url New url (when used as setter) - * @param {boolean=} replace Should new url replace current history record? - * @param {object=} state object to use with pushState/replaceState - */ - self.url = function(url, replace, state) { - // In modern browsers `history.state` is `null` by default; treating it separately - // from `undefined` would cause `$browser.url('/foo')` to change `history.state` - // to undefined via `pushState`. Instead, let's change `undefined` to `null` here. - if (isUndefined(state)) { - state = null; - } - - // Android Browser BFCache causes location, history reference to become stale. - if (location !== window.location) location = window.location; - if (history !== window.history) history = window.history; - - // setter - if (url) { - var sameState = lastHistoryState === state; - - // Don't change anything if previous and current URLs and states match. This also prevents - // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode. - // See https://github.com/angular/angular.js/commit/ffb2701 - if (lastBrowserUrl === url && (!$sniffer.history || sameState)) { - return; - } - var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url); - lastBrowserUrl = url; - lastHistoryState = state; - // Don't use history API if only the hash changed - // due to a bug in IE10/IE11 which leads - // to not firing a `hashchange` nor `popstate` event - // in some cases (see #9143). - if ($sniffer.history && (!sameBase || !sameState)) { - history[replace ? 'replaceState' : 'pushState'](state, '', url); - cacheState(); - // Do the assignment again so that those two variables are referentially identical. - lastHistoryState = cachedState; - } else { - if (!sameBase) { - reloadLocation = url; - } - if (replace) { - location.replace(url); - } else { - location.href = url; - } - } - return self; - // getter - } else { - // - reloadLocation is needed as browsers don't allow to read out - // the new location.href if a reload happened. - // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172 - return reloadLocation || location.href.replace(/%27/g,"'"); - } - }; - - /** - * @name $browser#state - * - * @description - * This method is a getter. - * - * Return history.state or null if history.state is undefined. - * - * @returns {object} state - */ - self.state = function() { - return cachedState; - }; - - var urlChangeListeners = [], - urlChangeInit = false; - - function cacheStateAndFireUrlChange() { - cacheState(); - fireUrlChange(); - } - - // This variable should be used *only* inside the cacheState function. - var lastCachedState = null; - function cacheState() { - // This should be the only place in $browser where `history.state` is read. - cachedState = window.history.state; - cachedState = isUndefined(cachedState) ? null : cachedState; - - // Prevent callbacks fo fire twice if both hashchange & popstate were fired. - if (equals(cachedState, lastCachedState)) { - cachedState = lastCachedState; - } - lastCachedState = cachedState; - } - - function fireUrlChange() { - if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) { - return; - } - - lastBrowserUrl = self.url(); - lastHistoryState = cachedState; - forEach(urlChangeListeners, function(listener) { - listener(self.url(), cachedState); - }); - } - - /** - * @name $browser#onUrlChange - * - * @description - * Register callback function that will be called, when url changes. - * - * It's only called when the url is changed from outside of angular: - * - user types different url into address bar - * - user clicks on history (forward/back) button - * - user clicks on a link - * - * It's not called when url is changed by $browser.url() method - * - * The listener gets called with new url as parameter. - * - * NOTE: this api is intended for use only by the $location service. Please use the - * {@link ng.$location $location service} to monitor url changes in angular apps. - * - * @param {function(string)} listener Listener function to be called when url changes. - * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous. - */ - self.onUrlChange = function(callback) { - // TODO(vojta): refactor to use node's syntax for events - if (!urlChangeInit) { - // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera) - // don't fire popstate when user change the address bar and don't fire hashchange when url - // changed by push/replaceState - - // html5 history api - popstate event - if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange); - // hashchange event - jqLite(window).on('hashchange', cacheStateAndFireUrlChange); - - urlChangeInit = true; - } - - urlChangeListeners.push(callback); - return callback; - }; - - /** - * Checks whether the url has changed outside of Angular. - * Needs to be exported to be able to check for changes that have been done in sync, - * as hashchange/popstate events fire in async. - */ - self.$$checkUrlChange = fireUrlChange; - - ////////////////////////////////////////////////////////////// - // Misc API - ////////////////////////////////////////////////////////////// - - /** - * @name $browser#baseHref - * - * @description - * Returns current - * (always relative - without domain) - * - * @returns {string} The current base href - */ - self.baseHref = function() { - var href = baseElement.attr('href'); - return href ? href.replace(/^(https?\:)?\/\/[^\/]*/, '') : ''; - }; - - ////////////////////////////////////////////////////////////// - // Cookies API - ////////////////////////////////////////////////////////////// - var lastCookies = {}; - var lastCookieString = ''; - var cookiePath = self.baseHref(); - - function safeDecodeURIComponent(str) { - try { - return decodeURIComponent(str); - } catch (e) { - return str; - } - } - - /** - * @name $browser#cookies - * - * @param {string=} name Cookie name - * @param {string=} value Cookie value - * - * @description - * The cookies method provides a 'private' low level access to browser cookies. - * It is not meant to be used directly, use the $cookie service instead. - * - * The return values vary depending on the arguments that the method was called with as follows: - * - * - cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify - * it - * - cookies(name, value) -> set name to value, if value is undefined delete the cookie - * - cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that - * way) - * - * @returns {Object} Hash of all cookies (if called without any parameter) - */ - self.cookies = function(name, value) { - var cookieLength, cookieArray, cookie, i, index; - - if (name) { - if (value === undefined) { - rawDocument.cookie = encodeURIComponent(name) + "=;path=" + cookiePath + - ";expires=Thu, 01 Jan 1970 00:00:00 GMT"; - } else { - if (isString(value)) { - cookieLength = (rawDocument.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + - ';path=' + cookiePath).length + 1; - - // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum: - // - 300 cookies - // - 20 cookies per unique domain - // - 4096 bytes per cookie - if (cookieLength > 4096) { - $log.warn("Cookie '" + name + - "' possibly not set or overflowed because it was too large (" + - cookieLength + " > 4096 bytes)!"); - } - } - } - } else { - if (rawDocument.cookie !== lastCookieString) { - lastCookieString = rawDocument.cookie; - cookieArray = lastCookieString.split("; "); - lastCookies = {}; - - for (i = 0; i < cookieArray.length; i++) { - cookie = cookieArray[i]; - index = cookie.indexOf('='); - if (index > 0) { //ignore nameless cookies - name = safeDecodeURIComponent(cookie.substring(0, index)); - // the first value that is seen for a cookie is the most - // specific one. values for the same cookie name that - // follow are for less specific paths. - if (lastCookies[name] === undefined) { - lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1)); - } - } - } - } - return lastCookies; - } - }; - - - /** - * @name $browser#defer - * @param {function()} fn A function, who's execution should be deferred. - * @param {number=} [delay=0] of milliseconds to defer the function execution. - * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`. - * - * @description - * Executes a fn asynchronously via `setTimeout(fn, delay)`. - * - * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using - * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed - * via `$browser.defer.flush()`. - * - */ - self.defer = function(fn, delay) { - var timeoutId; - outstandingRequestCount++; - timeoutId = setTimeout(function() { - delete pendingDeferIds[timeoutId]; - completeOutstandingRequest(fn); - }, delay || 0); - pendingDeferIds[timeoutId] = true; - return timeoutId; - }; - - - /** - * @name $browser#defer.cancel - * - * @description - * Cancels a deferred task identified with `deferId`. - * - * @param {*} deferId Token returned by the `$browser.defer` function. - * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully - * canceled. - */ - self.defer.cancel = function(deferId) { - if (pendingDeferIds[deferId]) { - delete pendingDeferIds[deferId]; - clearTimeout(deferId); - completeOutstandingRequest(noop); - return true; - } - return false; - }; - -} - -function $BrowserProvider() { - this.$get = ['$window', '$log', '$sniffer', '$document', - function($window, $log, $sniffer, $document) { - return new Browser($window, $document, $log, $sniffer); - }]; -} - -/** - * @ngdoc service - * @name $cacheFactory - * - * @description - * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to - * them. - * - * ```js - * - * var cache = $cacheFactory('cacheId'); - * expect($cacheFactory.get('cacheId')).toBe(cache); - * expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined(); - * - * cache.put("key", "value"); - * cache.put("another key", "another value"); - * - * // We've specified no options on creation - * expect(cache.info()).toEqual({id: 'cacheId', size: 2}); - * - * ``` - * - * - * @param {string} cacheId Name or id of the newly created cache. - * @param {object=} options Options object that specifies the cache behavior. Properties: - * - * - `{number=}` `capacity` — turns the cache into LRU cache. - * - * @returns {object} Newly created cache object with the following set of methods: - * - * - `{object}` `info()` — Returns id, size, and options of cache. - * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns - * it. - * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss. - * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache. - * - `{void}` `removeAll()` — Removes all cached values. - * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory. - * - * @example - - -
- - - - -

Cached Values

-
- - : - -
- -

Cache Info

-
- - : - -
-
-
- - angular.module('cacheExampleApp', []). - controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) { - $scope.keys = []; - $scope.cache = $cacheFactory('cacheId'); - $scope.put = function(key, value) { - if ($scope.cache.get(key) === undefined) { - $scope.keys.push(key); - } - $scope.cache.put(key, value === undefined ? null : value); - }; - }]); - - - p { - margin: 10px 0 3px; - } - -
- */ -function $CacheFactoryProvider() { - - this.$get = function() { - var caches = {}; - - function cacheFactory(cacheId, options) { - if (cacheId in caches) { - throw minErr('$cacheFactory')('iid', "CacheId '{0}' is already taken!", cacheId); - } - - var size = 0, - stats = extend({}, options, {id: cacheId}), - data = {}, - capacity = (options && options.capacity) || Number.MAX_VALUE, - lruHash = {}, - freshEnd = null, - staleEnd = null; - - /** - * @ngdoc type - * @name $cacheFactory.Cache - * - * @description - * A cache object used to store and retrieve data, primarily used by - * {@link $http $http} and the {@link ng.directive:script script} directive to cache - * templates and other data. - * - * ```js - * angular.module('superCache') - * .factory('superCache', ['$cacheFactory', function($cacheFactory) { - * return $cacheFactory('super-cache'); - * }]); - * ``` - * - * Example test: - * - * ```js - * it('should behave like a cache', inject(function(superCache) { - * superCache.put('key', 'value'); - * superCache.put('another key', 'another value'); - * - * expect(superCache.info()).toEqual({ - * id: 'super-cache', - * size: 2 - * }); - * - * superCache.remove('another key'); - * expect(superCache.get('another key')).toBeUndefined(); - * - * superCache.removeAll(); - * expect(superCache.info()).toEqual({ - * id: 'super-cache', - * size: 0 - * }); - * })); - * ``` - */ - return caches[cacheId] = { - - /** - * @ngdoc method - * @name $cacheFactory.Cache#put - * @kind function - * - * @description - * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be - * retrieved later, and incrementing the size of the cache if the key was not already - * present in the cache. If behaving like an LRU cache, it will also remove stale - * entries from the set. - * - * It will not insert undefined values into the cache. - * - * @param {string} key the key under which the cached data is stored. - * @param {*} value the value to store alongside the key. If it is undefined, the key - * will not be stored. - * @returns {*} the value stored. - */ - put: function(key, value) { - if (capacity < Number.MAX_VALUE) { - var lruEntry = lruHash[key] || (lruHash[key] = {key: key}); - - refresh(lruEntry); - } - - if (isUndefined(value)) return; - if (!(key in data)) size++; - data[key] = value; - - if (size > capacity) { - this.remove(staleEnd.key); - } - - return value; - }, - - /** - * @ngdoc method - * @name $cacheFactory.Cache#get - * @kind function - * - * @description - * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object. - * - * @param {string} key the key of the data to be retrieved - * @returns {*} the value stored. - */ - get: function(key) { - if (capacity < Number.MAX_VALUE) { - var lruEntry = lruHash[key]; - - if (!lruEntry) return; - - refresh(lruEntry); - } - - return data[key]; - }, - - - /** - * @ngdoc method - * @name $cacheFactory.Cache#remove - * @kind function - * - * @description - * Removes an entry from the {@link $cacheFactory.Cache Cache} object. - * - * @param {string} key the key of the entry to be removed - */ - remove: function(key) { - if (capacity < Number.MAX_VALUE) { - var lruEntry = lruHash[key]; - - if (!lruEntry) return; - - if (lruEntry == freshEnd) freshEnd = lruEntry.p; - if (lruEntry == staleEnd) staleEnd = lruEntry.n; - link(lruEntry.n,lruEntry.p); - - delete lruHash[key]; - } - - delete data[key]; - size--; - }, - - - /** - * @ngdoc method - * @name $cacheFactory.Cache#removeAll - * @kind function - * - * @description - * Clears the cache object of any entries. - */ - removeAll: function() { - data = {}; - size = 0; - lruHash = {}; - freshEnd = staleEnd = null; - }, - - - /** - * @ngdoc method - * @name $cacheFactory.Cache#destroy - * @kind function - * - * @description - * Destroys the {@link $cacheFactory.Cache Cache} object entirely, - * removing it from the {@link $cacheFactory $cacheFactory} set. - */ - destroy: function() { - data = null; - stats = null; - lruHash = null; - delete caches[cacheId]; - }, - - - /** - * @ngdoc method - * @name $cacheFactory.Cache#info - * @kind function - * - * @description - * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}. - * - * @returns {object} an object with the following properties: - *
    - *
  • **id**: the id of the cache instance
  • - *
  • **size**: the number of entries kept in the cache instance
  • - *
  • **...**: any additional properties from the options object when creating the - * cache.
  • - *
- */ - info: function() { - return extend({}, stats, {size: size}); - } - }; - - - /** - * makes the `entry` the freshEnd of the LRU linked list - */ - function refresh(entry) { - if (entry != freshEnd) { - if (!staleEnd) { - staleEnd = entry; - } else if (staleEnd == entry) { - staleEnd = entry.n; - } - - link(entry.n, entry.p); - link(entry, freshEnd); - freshEnd = entry; - freshEnd.n = null; - } - } - - - /** - * bidirectionally links two entries of the LRU linked list - */ - function link(nextEntry, prevEntry) { - if (nextEntry != prevEntry) { - if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify - if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify - } - } - } - - - /** - * @ngdoc method - * @name $cacheFactory#info - * - * @description - * Get information about all the caches that have been created - * - * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info` - */ - cacheFactory.info = function() { - var info = {}; - forEach(caches, function(cache, cacheId) { - info[cacheId] = cache.info(); - }); - return info; - }; - - - /** - * @ngdoc method - * @name $cacheFactory#get - * - * @description - * Get access to a cache object by the `cacheId` used when it was created. - * - * @param {string} cacheId Name or id of a cache to access. - * @returns {object} Cache object identified by the cacheId or undefined if no such cache. - */ - cacheFactory.get = function(cacheId) { - return caches[cacheId]; - }; - - - return cacheFactory; - }; -} - -/** - * @ngdoc service - * @name $templateCache - * - * @description - * The first time a template is used, it is loaded in the template cache for quick retrieval. You - * can load templates directly into the cache in a `script` tag, or by consuming the - * `$templateCache` service directly. - * - * Adding via the `script` tag: - * - * ```html - * - * ``` - * - * **Note:** the `script` tag containing the template does not need to be included in the `head` of - * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE, - * element with ng-app attribute), otherwise the template will be ignored. - * - * Adding via the $templateCache service: - * - * ```js - * var myApp = angular.module('myApp', []); - * myApp.run(function($templateCache) { - * $templateCache.put('templateId.html', 'This is the content of the template'); - * }); - * ``` - * - * To retrieve the template later, simply use it in your HTML: - * ```html - *
- * ``` - * - * or get it via Javascript: - * ```js - * $templateCache.get('templateId.html') - * ``` - * - * See {@link ng.$cacheFactory $cacheFactory}. - * - */ -function $TemplateCacheProvider() { - this.$get = ['$cacheFactory', function($cacheFactory) { - return $cacheFactory('templates'); - }]; -} - -/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE! - * - * DOM-related variables: - * - * - "node" - DOM Node - * - "element" - DOM Element or Node - * - "$node" or "$element" - jqLite-wrapped node or element - * - * - * Compiler related stuff: - * - * - "linkFn" - linking fn of a single directive - * - "nodeLinkFn" - function that aggregates all linking fns for a particular node - * - "childLinkFn" - function that aggregates all linking fns for child nodes of a particular node - * - "compositeLinkFn" - function that aggregates all linking fns for a compilation root (nodeList) - */ - - -/** - * @ngdoc service - * @name $compile - * @kind function - * - * @description - * Compiles an HTML string or DOM into a template and produces a template function, which - * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together. - * - * The compilation is a process of walking the DOM tree and matching DOM elements to - * {@link ng.$compileProvider#directive directives}. - * - *
- * **Note:** This document is an in-depth reference of all directive options. - * For a gentle introduction to directives with examples of common use cases, - * see the {@link guide/directive directive guide}. - *
- * - * ## Comprehensive Directive API - * - * There are many different options for a directive. - * - * The difference resides in the return value of the factory function. - * You can either return a "Directive Definition Object" (see below) that defines the directive properties, - * or just the `postLink` function (all other properties will have the default values). - * - *
- * **Best Practice:** It's recommended to use the "directive definition object" form. - *
- * - * Here's an example directive declared with a Directive Definition Object: - * - * ```js - * var myModule = angular.module(...); - * - * myModule.directive('directiveName', function factory(injectables) { - * var directiveDefinitionObject = { - * priority: 0, - * template: '
', // or // function(tElement, tAttrs) { ... }, - * // or - * // templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... }, - * transclude: false, - * restrict: 'A', - * templateNamespace: 'html', - * scope: false, - * controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... }, - * controllerAs: 'stringAlias', - * require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'], - * compile: function compile(tElement, tAttrs, transclude) { - * return { - * pre: function preLink(scope, Element, iAttrs, controller) { ... }, - * post: function postLink(scope, Element, iAttrs, controller) { ... } - * } - * // or - * // return function postLink( ... ) { ... } - * }, - * // or - * // link: { - * // pre: function preLink(scope, Element, iAttrs, controller) { ... }, - * // post: function postLink(scope, Element, iAttrs, controller) { ... } - * // } - * // or - * // link: function postLink( ... ) { ... } - * }; - * return directiveDefinitionObject; - * }); - * ``` - * - *
- * **Note:** Any unspecified options will use the default value. You can see the default values below. - *
- * - * Therefore the above can be simplified as: - * - * ```js - * var myModule = angular.module(...); - * - * myModule.directive('directiveName', function factory(injectables) { - * var directiveDefinitionObject = { - * link: function postLink(scope, Element, iAttrs) { ... } - * }; - * return directiveDefinitionObject; - * // or - * // return function postLink(scope, Element, iAttrs) { ... } - * }); - * ``` - * - * - * - * ### Directive Definition Object - * - * The directive definition object provides instructions to the {@link ng.$compile - * compiler}. The attributes are: - * - * #### `multElement` - * When this property is set to true, the HTML compiler will collect DOM nodes between - * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them - * together as the directive elements. It is recomended that this feature be used on directives - * which are not strictly behavioural (such as {@link ngClick}), and which - * do not manipulate or replace child nodes (such as {@link ngInclude}). - * - * #### `priority` - * When there are multiple directives defined on a single DOM element, sometimes it - * is necessary to specify the order in which the directives are applied. The `priority` is used - * to sort the directives before their `compile` functions get called. Priority is defined as a - * number. Directives with greater numerical `priority` are compiled first. Pre-link functions - * are also run in priority order, but post-link functions are run in reverse order. The order - * of directives with the same priority is undefined. The default priority is `0`. - * - * #### `terminal` - * If set to true then the current `priority` will be the last set of directives - * which will execute (any directives at the current priority will still execute - * as the order of execution on same `priority` is undefined). Note that expressions - * and other directives used in the directive's template will also be excluded from execution. - * - * #### `scope` - * **If set to `true`,** then a new scope will be created for this directive. If multiple directives on the - * same element request a new scope, only one new scope is created. The new scope rule does not - * apply for the root of the template since the root of the template always gets a new scope. - * - * **If set to `{}` (object hash),** then a new "isolate" scope is created. The 'isolate' scope differs from - * normal scope in that it does not prototypically inherit from the parent scope. This is useful - * when creating reusable components, which should not accidentally read or modify data in the - * parent scope. - * - * The 'isolate' scope takes an object hash which defines a set of local scope properties - * derived from the parent scope. These local properties are useful for aliasing values for - * templates. Locals definition is a hash of local scope property to its source: - * - * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is - * always a string since DOM attributes are strings. If no `attr` name is specified then the - * attribute name is assumed to be the same as the local name. - * Given `` and widget definition - * of `scope: { localName:'@myAttr' }`, then widget scope property `localName` will reflect - * the interpolated value of `hello {{name}}`. As the `name` attribute changes so will the - * `localName` property on the widget scope. The `name` is read from the parent scope (not - * component scope). - * - * * `=` or `=attr` - set up bi-directional binding between a local scope property and the - * parent scope property of name defined via the value of the `attr` attribute. If no `attr` - * name is specified then the attribute name is assumed to be the same as the local name. - * Given `` and widget definition of - * `scope: { localModel:'=myAttr' }`, then widget scope property `localModel` will reflect the - * value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected - * in `localModel` and any changes in `localModel` will reflect in `parentModel`. If the parent - * scope property doesn't exist, it will throw a NON_ASSIGNABLE_MODEL_EXPRESSION exception. You - * can avoid this behavior using `=?` or `=?attr` in order to flag the property as optional. If - * you want to shallow watch for changes (i.e. $watchCollection instead of $watch) you can use - * `=*` or `=*attr` (`=*?` or `=*?attr` if the property is optional). - * - * * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope. - * If no `attr` name is specified then the attribute name is assumed to be the same as the - * local name. Given `` and widget definition of - * `scope: { localFn:'&myAttr' }`, then isolate scope property `localFn` will point to - * a function wrapper for the `count = count + value` expression. Often it's desirable to - * pass data from the isolated scope via an expression to the parent scope, this can be - * done by passing a map of local variable names and values into the expression wrapper fn. - * For example, if the expression is `increment(amount)` then we can specify the amount value - * by calling the `localFn` as `localFn({amount: 22})`. - * - * - * #### `bindToController` - * When an isolate scope is used for a component (see above), and `controllerAs` is used, `bindToController: true` will - * allow a component to have its properties bound to the controller, rather than to scope. When the controller - * is instantiated, the initial values of the isolate scope bindings are already available. - * - * #### `controller` - * Controller constructor function. The controller is instantiated before the - * pre-linking phase and it is shared with other directives (see - * `require` attribute). This allows the directives to communicate with each other and augment - * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals: - * - * * `$scope` - Current scope associated with the element - * * `$element` - Current element - * * `$attrs` - Current attributes object for the element - * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope: - * `function([scope], cloneLinkingFn, futureParentElement)`. - * * `scope`: optional argument to override the scope. - * * `cloneLinkingFn`: optional argument to create clones of the original transcluded content. - * * `futureParentElement`: - * * defines the parent to which the `cloneLinkingFn` will add the cloned elements. - * * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`. - * * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements) - * and when the `cloneLinkinFn` is passed, - * as those elements need to created and cloned in a special way when they are defined outside their - * usual containers (e.g. like ``). - * * See also the `directive.templateNamespace` property. - * - * - * #### `require` - * Require another directive and inject its controller as the fourth argument to the linking function. The - * `require` takes a string name (or array of strings) of the directive(s) to pass in. If an array is used, the - * injected argument will be an array in corresponding order. If no such directive can be - * found, or if the directive does not have a controller, then an error is raised. The name can be prefixed with: - * - * * (no prefix) - Locate the required controller on the current element. Throw an error if not found. - * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found. - * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found. - * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found. - * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass - * `null` to the `link` fn if not found. - * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass - * `null` to the `link` fn if not found. - * - * - * #### `controllerAs` - * Controller alias at the directive scope. An alias for the controller so it - * can be referenced at the directive template. The directive needs to define a scope for this - * configuration to be used. Useful in the case when directive is used as component. - * - * - * #### `restrict` - * String of subset of `EACM` which restricts the directive to a specific directive - * declaration style. If omitted, the defaults (elements and attributes) are used. - * - * * `E` - Element name (default): `` - * * `A` - Attribute (default): `
` - * * `C` - Class: `
` - * * `M` - Comment: `` - * - * - * #### `templateNamespace` - * String representing the document type used by the markup in the template. - * AngularJS needs this information as those elements need to be created and cloned - * in a special way when they are defined outside their usual containers like `` and ``. - * - * * `html` - All root nodes in the template are HTML. Root nodes may also be - * top-level elements such as `` or ``. - * * `svg` - The root nodes in the template are SVG elements (excluding ``). - * * `math` - The root nodes in the template are MathML elements (excluding ``). - * - * If no `templateNamespace` is specified, then the namespace is considered to be `html`. - * - * #### `template` - * HTML markup that may: - * * Replace the contents of the directive's element (default). - * * Replace the directive's element itself (if `replace` is true - DEPRECATED). - * * Wrap the contents of the directive's element (if `transclude` is true). - * - * Value may be: - * - * * A string. For example `
{{delete_str}}
`. - * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile` - * function api below) and returns a string value. - * - * - * #### `templateUrl` - * This is similar to `template` but the template is loaded from the specified URL, asynchronously. - * - * Because template loading is asynchronous the compiler will suspend compilation of directives on that element - * for later when the template has been resolved. In the meantime it will continue to compile and link - * sibling and parent elements as though this element had not contained any directives. - * - * The compiler does not suspend the entire compilation to wait for templates to be loaded because this - * would result in the whole app "stalling" until all templates are loaded asynchronously - even in the - * case when only one deeply nested directive has `templateUrl`. - * - * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache} - * - * You can specify `templateUrl` as a string representing the URL or as a function which takes two - * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns - * a string value representing the url. In either case, the template URL is passed through {@link - * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}. - * - * - * #### `replace` ([*DEPRECATED*!], will be removed in next major release - i.e. v2.0) - * specify what the template should replace. Defaults to `false`. - * - * * `true` - the template will replace the directive's element. - * * `false` - the template will replace the contents of the directive's element. - * - * The replacement process migrates all of the attributes / classes from the old element to the new - * one. See the {@link guide/directive#template-expanding-directive - * Directives Guide} for an example. - * - * There are very few scenarios where element replacement is required for the application function, - * the main one being reusable custom components that are used within SVG contexts - * (because SVG doesn't work with custom elements in the DOM tree). - * - * #### `transclude` - * Extract the contents of the element where the directive appears and make it available to the directive. - * The contents are compiled and provided to the directive as a **transclusion function**. See the - * {@link $compile#transclusion Transclusion} section below. - * - * There are two kinds of transclusion depending upon whether you want to transclude just the contents of the - * directive's element or the entire element: - * - * * `true` - transclude the content (i.e. the child nodes) of the directive's element. - * * `'element'` - transclude the whole of the directive's element including any directives on this - * element that defined at a lower priority than this directive. When used, the `template` - * property is ignored. - * - * - * #### `compile` - * - * ```js - * function compile(tElement, tAttrs, transclude) { ... } - * ``` - * - * The compile function deals with transforming the template DOM. Since most directives do not do - * template transformation, it is not used often. The compile function takes the following arguments: - * - * * `tElement` - template element - The element where the directive has been declared. It is - * safe to do template transformation on the element and child elements only. - * - * * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared - * between all directive compile functions. - * - * * `transclude` - [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)` - * - *
- * **Note:** The template instance and the link instance may be different objects if the template has - * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that - * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration - * should be done in a linking function rather than in a compile function. - *
- - *
- * **Note:** The compile function cannot handle directives that recursively use themselves in their - * own templates or compile functions. Compiling these directives results in an infinite loop and a - * stack overflow errors. - * - * This can be avoided by manually using $compile in the postLink function to imperatively compile - * a directive's template instead of relying on automatic template compilation via `template` or - * `templateUrl` declaration or manual compilation inside the compile function. - *
- * - *
- * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it - * e.g. does not know about the right outer scope. Please use the transclude function that is passed - * to the link function instead. - *
- - * A compile function can have a return value which can be either a function or an object. - * - * * returning a (post-link) function - is equivalent to registering the linking function via the - * `link` property of the config object when the compile function is empty. - * - * * returning an object with function(s) registered via `pre` and `post` properties - allows you to - * control when a linking function should be called during the linking phase. See info about - * pre-linking and post-linking functions below. - * - * - * #### `link` - * This property is used only if the `compile` property is not defined. - * - * ```js - * function link(scope, Element, iAttrs, controller, transcludeFn) { ... } - * ``` - * - * The link function is responsible for registering DOM listeners as well as updating the DOM. It is - * executed after the template has been cloned. This is where most of the directive logic will be - * put. - * - * * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the - * directive for registering {@link ng.$rootScope.Scope#$watch watches}. - * - * * `Element` - instance element - The element where the directive is to be used. It is safe to - * manipulate the children of the element only in `postLink` function since the children have - * already been linked. - * - * * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared - * between all directive linking functions. - * - * * `controller` - a controller instance - A controller instance if at least one directive on the - * element defines a controller. The controller is shared among all the directives, which allows - * the directives to use the controllers as a communication channel. - * - * * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope. - * This is the same as the `$transclude` - * parameter of directive controllers, see there for details. - * `function([scope], cloneLinkingFn, futureParentElement)`. - * - * #### Pre-linking function - * - * Executed before the child elements are linked. Not safe to do DOM transformation since the - * compiler linking function will fail to locate the correct elements for linking. - * - * #### Post-linking function - * - * Executed after the child elements are linked. - * - * Note that child elements that contain `templateUrl` directives will not have been compiled - * and linked since they are waiting for their template to load asynchronously and their own - * compilation and linking has been suspended until that occurs. - * - * It is safe to do DOM transformation in the post-linking function on elements that are not waiting - * for their async templates to be resolved. - * - * - * ### Transclusion - * - * Transclusion is the process of extracting a collection of DOM element from one part of the DOM and - * copying them to another part of the DOM, while maintaining their connection to the original AngularJS - * scope from where they were taken. - * - * Transclusion is used (often with {@link ngTransclude}) to insert the - * original contents of a directive's element into a specified place in the template of the directive. - * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded - * content has access to the properties on the scope from which it was taken, even if the directive - * has isolated scope. - * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}. - * - * This makes it possible for the widget to have private state for its template, while the transcluded - * content has access to its originating scope. - * - *
- * **Note:** When testing an element transclude directive you must not place the directive at the root of the - * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives - * Testing Transclusion Directives}. - *
- * - * #### Transclusion Functions - * - * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion - * function** to the directive's `link` function and `controller`. This transclusion function is a special - * **linking function** that will return the compiled contents linked to a new transclusion scope. - * - *
- * If you are just using {@link ngTransclude} then you don't need to worry about this function, since - * ngTransclude will deal with it for us. - *
- * - * If you want to manually control the insertion and removal of the transcluded content in your directive - * then you must use this transclude function. When you call a transclude function it returns a a jqLite/JQuery - * object that contains the compiled DOM, which is linked to the correct transclusion scope. - * - * When you call a transclusion function you can pass in a **clone attach function**. This function accepts - * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded - * content and the `scope` is the newly created transclusion scope, to which the clone is bound. - * - *
- * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a translude function - * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope. - *
- * - * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone - * attach function**: - * - * ```js - * var transcludedContent, transclusionScope; - * - * $transclude(function(clone, scope) { - * element.append(clone); - * transcludedContent = clone; - * transclusionScope = scope; - * }); - * ``` - * - * Later, if you want to remove the transcluded content from your DOM then you should also destroy the - * associated transclusion scope: - * - * ```js - * transcludedContent.remove(); - * transclusionScope.$destroy(); - * ``` - * - *
- * **Best Practice**: if you intend to add and remove transcluded content manually in your directive - * (by calling the transclude function to get the DOM and and calling `element.remove()` to remove it), - * then you are also responsible for calling `$destroy` on the transclusion scope. - *
- * - * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat} - * automatically destroy their transluded clones as necessary so you do not need to worry about this if - * you are simply using {@link ngTransclude} to inject the transclusion into your directive. - * - * - * #### Transclusion Scopes - * - * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion - * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed - * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it - * was taken. - * - * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look - * like this: - * - * ```html - *
- *
- *
- *
- *
- *
- * ``` - * - * The `$parent` scope hierarchy will look like this: - * - * ``` - * - $rootScope - * - isolate - * - transclusion - * ``` - * - * but the scopes will inherit prototypically from different scopes to their `$parent`. - * - * ``` - * - $rootScope - * - transclusion - * - isolate - * ``` - * - * - * ### Attributes - * - * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the - * `link()` or `compile()` functions. It has a variety of uses. - * - * accessing *Normalized attribute names:* - * Directives like 'ngBind' can be expressed in many ways: 'ng:bind', `data-ng-bind`, or 'x-ng-bind'. - * the attributes object allows for normalized access to - * the attributes. - * - * * *Directive inter-communication:* All directives share the same instance of the attributes - * object which allows the directives to use the attributes object as inter directive - * communication. - * - * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object - * allowing other directives to read the interpolated value. - * - * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes - * that contain interpolation (e.g. `src="{{bar}}"`). Not only is this very efficient but it's also - * the only way to easily get the actual value because during the linking phase the interpolation - * hasn't been evaluated yet and so the value is at this time set to `undefined`. - * - * ```js - * function linkingFn(scope, elm, attrs, ctrl) { - * // get the attribute value - * console.log(attrs.ngModel); - * - * // change the attribute - * attrs.$set('ngModel', 'new value'); - * - * // observe changes to interpolated attribute - * attrs.$observe('ngModel', function(value) { - * console.log('ngModel has changed value to ' + value); - * }); - * } - * ``` - * - * ## Example - * - *
- * **Note**: Typically directives are registered with `module.directive`. The example below is - * to illustrate how `$compile` works. - *
- * - - - -
-
-
-
-
-
- - it('should auto compile', function() { - var textarea = $('textarea'); - var output = $('div[compile]'); - // The initial state reads 'Hello Angular'. - expect(output.getText()).toBe('Hello Angular'); - textarea.clear(); - textarea.sendKeys('{{name}}!'); - expect(output.getText()).toBe('Angular!'); - }); - -
- - * - * - * @param {string|DOMElement} element Element or HTML string to compile into a template function. - * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED. - * - *
- * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it - * e.g. will not use the right outer scope. Please pass the transclude function as a - * `parentBoundTranscludeFn` to the link function instead. - *
- * - * @param {number} maxPriority only apply directives lower than given priority (Only effects the - * root element(s), not their children) - * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template - * (a DOM element/tree) to a scope. Where: - * - * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to. - * * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the - * `template` and call the `cloneAttachFn` function allowing the caller to attach the - * cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is - * called as:
`cloneAttachFn(clonedElement, scope)` where: - * - * * `clonedElement` - is a clone of the original `element` passed into the compiler. - * * `scope` - is the current scope with which the linking function is working with. - * - * * `options` - An optional object hash with linking options. If `options` is provided, then the following - * keys may be used to control linking behavior: - * - * * `parentBoundTranscludeFn` - the transclude function made available to - * directives; if given, it will be passed through to the link functions of - * directives found in `element` during compilation. - * * `transcludeControllers` - an object hash with keys that map controller names - * to controller instances; if given, it will make the controllers - * available to directives. - * * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add - * the cloned elements; only needed for transcludes that are allowed to contain non html - * elements (e.g. SVG elements). See also the directive.controller property. - * - * Calling the linking function returns the element of the template. It is either the original - * element passed in, or the clone of the element if the `cloneAttachFn` is provided. - * - * After linking the view is not updated until after a call to $digest which typically is done by - * Angular automatically. - * - * If you need access to the bound view, there are two ways to do it: - * - * - If you are not asking the linking function to clone the template, create the DOM element(s) - * before you send them to the compiler and keep this reference around. - * ```js - * var element = $compile('

{{total}}

')(scope); - * ``` - * - * - if on the other hand, you need the element to be cloned, the view reference from the original - * example would not point to the clone, but rather to the original template that was cloned. In - * this case, you can access the clone via the cloneAttachFn: - * ```js - * var templateElement = angular.element('

{{total}}

'), - * scope = ....; - * - * var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) { - * //attach the clone to DOM document at the right place - * }); - * - * //now we have reference to the cloned DOM via `clonedElement` - * ``` - * - * - * For information on how the compiler works, see the - * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide. - */ - -var $compileMinErr = minErr('$compile'); - -/** - * @ngdoc provider - * @name $compileProvider - * - * @description - */ -$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider']; -function $CompileProvider($provide, $$sanitizeUriProvider) { - var hasDirectives = {}, - Suffix = 'Directive', - COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\w\-]+)\s+(.*)$/, - CLASS_DIRECTIVE_REGEXP = /(([\w\-]+)(?:\:([^;]+))?;?)/, - ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'), - REQUIRE_PREFIX_REGEXP = /^(?:(\^\^?)?(\?)?(\^\^?)?)?/; - - // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes - // The assumption is that future DOM event attribute names will begin with - // 'on' and be composed of only English letters. - var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/; - - function parseIsolateBindings(scope, directiveName) { - var LOCAL_REGEXP = /^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/; - - var bindings = {}; - - forEach(scope, function(definition, scopeName) { - var match = definition.match(LOCAL_REGEXP); - - if (!match) { - throw $compileMinErr('iscp', - "Invalid isolate scope definition for directive '{0}'." + - " Definition: {... {1}: '{2}' ...}", - directiveName, scopeName, definition); - } - - bindings[scopeName] = { - mode: match[1][0], - collection: match[2] === '*', - optional: match[3] === '?', - attrName: match[4] || scopeName - }; - }); - - return bindings; - } - - /** - * @ngdoc method - * @name $compileProvider#directive - * @kind function - * - * @description - * Register a new directive with the compiler. - * - * @param {string|Object} name Name of the directive in camel-case (i.e. ngBind which - * will match as ng-bind), or an object map of directives where the keys are the - * names and the values are the factories. - * @param {Function|Array} directiveFactory An injectable directive factory function. See - * {@link guide/directive} for more info. - * @returns {ng.$compileProvider} Self for chaining. - */ - this.directive = function registerDirective(name, directiveFactory) { - assertNotHasOwnProperty(name, 'directive'); - if (isString(name)) { - assertArg(directiveFactory, 'directiveFactory'); - if (!hasDirectives.hasOwnProperty(name)) { - hasDirectives[name] = []; - $provide.factory(name + Suffix, ['$injector', '$exceptionHandler', - function($injector, $exceptionHandler) { - var directives = []; - forEach(hasDirectives[name], function(directiveFactory, index) { - try { - var directive = $injector.invoke(directiveFactory); - if (isFunction(directive)) { - directive = { compile: valueFn(directive) }; - } else if (!directive.compile && directive.link) { - directive.compile = valueFn(directive.link); - } - directive.priority = directive.priority || 0; - directive.index = index; - directive.name = directive.name || name; - directive.require = directive.require || (directive.controller && directive.name); - directive.restrict = directive.restrict || 'EA'; - if (isObject(directive.scope)) { - directive.$$isolateBindings = parseIsolateBindings(directive.scope, directive.name); - } - directives.push(directive); - } catch (e) { - $exceptionHandler(e); - } - }); - return directives; - }]); - } - hasDirectives[name].push(directiveFactory); - } else { - forEach(name, reverseParams(registerDirective)); - } - return this; - }; - - - /** - * @ngdoc method - * @name $compileProvider#aHrefSanitizationWhitelist - * @kind function - * - * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe - * urls during a[href] sanitization. - * - * The sanitization is a security measure aimed at prevent XSS attacks via html links. - * - * Any url about to be assigned to a[href] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. - * - * @param {RegExp=} regexp New regexp to whitelist urls with. - * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for - * chaining otherwise. - */ - this.aHrefSanitizationWhitelist = function(regexp) { - if (isDefined(regexp)) { - $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp); - return this; - } else { - return $$sanitizeUriProvider.aHrefSanitizationWhitelist(); - } - }; - - - /** - * @ngdoc method - * @name $compileProvider#imgSrcSanitizationWhitelist - * @kind function - * - * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe - * urls during img[src] sanitization. - * - * The sanitization is a security measure aimed at prevent XSS attacks via html links. - * - * Any url about to be assigned to img[src] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. - * - * @param {RegExp=} regexp New regexp to whitelist urls with. - * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for - * chaining otherwise. - */ - this.imgSrcSanitizationWhitelist = function(regexp) { - if (isDefined(regexp)) { - $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp); - return this; - } else { - return $$sanitizeUriProvider.imgSrcSanitizationWhitelist(); - } - }; - - /** - * @ngdoc method - * @name $compileProvider#debugInfoEnabled - * - * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the - * current debugInfoEnabled state - * @returns {*} current value if used as getter or itself (chaining) if used as setter - * - * @kind function - * - * @description - * Call this method to enable/disable various debug runtime information in the compiler such as adding - * binding information and a reference to the current scope on to DOM elements. - * If enabled, the compiler will add the following to DOM elements that have been bound to the scope - * * `ng-binding` CSS class - * * `$binding` data property containing an array of the binding expressions - * - * You may want to use this in production for a significant performance boost. See - * {@link guide/production#disabling-debug-data Disabling Debug Data} for more. - * - * The default value is true. - */ - var debugInfoEnabled = true; - this.debugInfoEnabled = function(enabled) { - if (isDefined(enabled)) { - debugInfoEnabled = enabled; - return this; - } - return debugInfoEnabled; - }; - - this.$get = [ - '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse', - '$controller', '$rootScope', '$document', '$sce', '$animate', '$$sanitizeUri', - function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse, - $controller, $rootScope, $document, $sce, $animate, $$sanitizeUri) { - - var Attributes = function(element, attributesToCopy) { - if (attributesToCopy) { - var keys = Object.keys(attributesToCopy); - var i, l, key; - - for (i = 0, l = keys.length; i < l; i++) { - key = keys[i]; - this[key] = attributesToCopy[key]; - } - } else { - this.$attr = {}; - } - - this.$$element = element; - }; - - Attributes.prototype = { - $normalize: directiveNormalize, - - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$addClass - * @kind function - * - * @description - * Adds the CSS class value specified by the classVal parameter to the element. If animations - * are enabled then an animation will be triggered for the class addition. - * - * @param {string} classVal The className value that will be added to the element - */ - $addClass: function(classVal) { - if (classVal && classVal.length > 0) { - $animate.addClass(this.$$element, classVal); - } - }, - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$removeClass - * @kind function - * - * @description - * Removes the CSS class value specified by the classVal parameter from the element. If - * animations are enabled then an animation will be triggered for the class removal. - * - * @param {string} classVal The className value that will be removed from the element - */ - $removeClass: function(classVal) { - if (classVal && classVal.length > 0) { - $animate.removeClass(this.$$element, classVal); - } - }, - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$updateClass - * @kind function - * - * @description - * Adds and removes the appropriate CSS class values to the element based on the difference - * between the new and old CSS class values (specified as newClasses and oldClasses). - * - * @param {string} newClasses The current CSS className value - * @param {string} oldClasses The former CSS className value - */ - $updateClass: function(newClasses, oldClasses) { - var toAdd = tokenDifference(newClasses, oldClasses); - if (toAdd && toAdd.length) { - $animate.addClass(this.$$element, toAdd); - } - - var toRemove = tokenDifference(oldClasses, newClasses); - if (toRemove && toRemove.length) { - $animate.removeClass(this.$$element, toRemove); - } - }, - - /** - * Set a normalized attribute on the element in a way such that all directives - * can share the attribute. This function properly handles boolean attributes. - * @param {string} key Normalized key. (ie ngAttribute) - * @param {string|boolean} value The value to set. If `null` attribute will be deleted. - * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute. - * Defaults to true. - * @param {string=} attrName Optional none normalized name. Defaults to key. - */ - $set: function(key, value, writeAttr, attrName) { - // TODO: decide whether or not to throw an error if "class" - //is set through this function since it may cause $updateClass to - //become unstable. - - var node = this.$$element[0], - booleanKey = getBooleanAttrName(node, key), - aliasedKey = getAliasedAttrName(node, key), - observer = key, - nodeName; - - if (booleanKey) { - this.$$element.prop(key, value); - attrName = booleanKey; - } else if (aliasedKey) { - this[aliasedKey] = value; - observer = aliasedKey; - } - - this[key] = value; - - // translate normalized key to actual key - if (attrName) { - this.$attr[key] = attrName; - } else { - attrName = this.$attr[key]; - if (!attrName) { - this.$attr[key] = attrName = snake_case(key, '-'); - } - } - - nodeName = nodeName_(this.$$element); - - if ((nodeName === 'a' && key === 'href') || - (nodeName === 'img' && key === 'src')) { - // sanitize a[href] and img[src] values - this[key] = value = $$sanitizeUri(value, key === 'src'); - } else if (nodeName === 'img' && key === 'srcset') { - // sanitize img[srcset] values - var result = ""; - - // first check if there are spaces because it's not the same pattern - var trimmedSrcset = trim(value); - // ( 999x ,| 999w ,| ,|, ) - var srcPattern = /(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/; - var pattern = /\s/.test(trimmedSrcset) ? srcPattern : /(,)/; - - // split srcset into tuple of uri and descriptor except for the last item - var rawUris = trimmedSrcset.split(pattern); - - // for each tuples - var nbrUrisWith2parts = Math.floor(rawUris.length / 2); - for (var i = 0; i < nbrUrisWith2parts; i++) { - var innerIdx = i * 2; - // sanitize the uri - result += $$sanitizeUri(trim(rawUris[innerIdx]), true); - // add the descriptor - result += (" " + trim(rawUris[innerIdx + 1])); - } - - // split the last item into uri and descriptor - var lastTuple = trim(rawUris[i * 2]).split(/\s/); - - // sanitize the last uri - result += $$sanitizeUri(trim(lastTuple[0]), true); - - // and add the last descriptor if any - if (lastTuple.length === 2) { - result += (" " + trim(lastTuple[1])); - } - this[key] = value = result; - } - - if (writeAttr !== false) { - if (value === null || value === undefined) { - this.$$element.removeAttr(attrName); - } else { - this.$$element.attr(attrName, value); - } - } - - // fire observers - var $$observers = this.$$observers; - $$observers && forEach($$observers[observer], function(fn) { - try { - fn(value); - } catch (e) { - $exceptionHandler(e); - } - }); - }, - - - /** - * @ngdoc method - * @name $compile.directive.Attributes#$observe - * @kind function - * - * @description - * Observes an interpolated attribute. - * - * The observer function will be invoked once during the next `$digest` following - * compilation. The observer is then invoked whenever the interpolated value - * changes. - * - * @param {string} key Normalized key. (ie ngAttribute) . - * @param {function(interpolatedValue)} fn Function that will be called whenever - the interpolated value of the attribute changes. - * See the {@link guide/directive#text-and-attribute-bindings Directives} guide for more info. - * @returns {function()} Returns a deregistration function for this observer. - */ - $observe: function(key, fn) { - var attrs = this, - $$observers = (attrs.$$observers || (attrs.$$observers = createMap())), - listeners = ($$observers[key] || ($$observers[key] = [])); - - listeners.push(fn); - $rootScope.$evalAsync(function() { - if (!listeners.$$inter && attrs.hasOwnProperty(key)) { - // no one registered attribute interpolation function, so lets call it manually - fn(attrs[key]); - } - }); - - return function() { - arrayRemove(listeners, fn); - }; - } - }; - - - function safeAddClass($element, className) { - try { - $element.addClass(className); - } catch (e) { - // ignore, since it means that we are trying to set class on - // SVG element, where class name is read-only. - } - } - - - var startSymbol = $interpolate.startSymbol(), - endSymbol = $interpolate.endSymbol(), - denormalizeTemplate = (startSymbol == '{{' || endSymbol == '}}') - ? identity - : function denormalizeTemplate(template) { - return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol); - }, - NG_ATTR_BINDING = /^ngAttr[A-Z]/; - - compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) { - var bindings = $element.data('$binding') || []; - - if (isArray(binding)) { - bindings = bindings.concat(binding); - } else { - bindings.push(binding); - } - - $element.data('$binding', bindings); - } : noop; - - compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) { - safeAddClass($element, 'ng-binding'); - } : noop; - - compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) { - var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope'; - $element.data(dataName, scope); - } : noop; - - compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) { - safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope'); - } : noop; - - return compile; - - //================================ - - function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, - previousCompileContext) { - if (!($compileNodes instanceof jqLite)) { - // jquery always rewraps, whereas we need to preserve the original selector so that we can - // modify it. - $compileNodes = jqLite($compileNodes); - } - // We can not compile top level text elements since text nodes can be merged and we will - // not be able to attach scope data to them, so we will wrap them in - forEach($compileNodes, function(node, index) { - if (node.nodeType == NODE_TYPE_TEXT && node.nodeValue.match(/\S+/) /* non-empty */ ) { - $compileNodes[index] = jqLite(node).wrap('').parent()[0]; - } - }); - var compositeLinkFn = - compileNodes($compileNodes, transcludeFn, $compileNodes, - maxPriority, ignoreDirective, previousCompileContext); - compile.$$addScopeClass($compileNodes); - var namespace = null; - return function publicLinkFn(scope, cloneConnectFn, options) { - assertArg(scope, 'scope'); - - options = options || {}; - var parentBoundTranscludeFn = options.parentBoundTranscludeFn, - transcludeControllers = options.transcludeControllers, - futureParentElement = options.futureParentElement; - - // When `parentBoundTranscludeFn` is passed, it is a - // `controllersBoundTransclude` function (it was previously passed - // as `transclude` to directive.link) so we must unwrap it to get - // its `boundTranscludeFn` - if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) { - parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude; - } - - if (!namespace) { - namespace = detectNamespaceForChildElements(futureParentElement); - } - var $linkNode; - if (namespace !== 'html') { - // When using a directive with replace:true and templateUrl the $compileNodes - // (or a child element inside of them) - // might change, so we need to recreate the namespace adapted compileNodes - // for call to the link function. - // Note: This will already clone the nodes... - $linkNode = jqLite( - wrapTemplate(namespace, jqLite('
').append($compileNodes).html()) - ); - } else if (cloneConnectFn) { - // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart - // and sometimes changes the structure of the DOM. - $linkNode = JQLitePrototype.clone.call($compileNodes); - } else { - $linkNode = $compileNodes; - } - - if (transcludeControllers) { - for (var controllerName in transcludeControllers) { - $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance); - } - } - - compile.$$addScopeInfo($linkNode, scope); - - if (cloneConnectFn) cloneConnectFn($linkNode, scope); - if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn); - return $linkNode; - }; - } - - function detectNamespaceForChildElements(parentElement) { - // TODO: Make this detect MathML as well... - var node = parentElement && parentElement[0]; - if (!node) { - return 'html'; - } else { - return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/) ? 'svg' : 'html'; - } - } - - /** - * Compile function matches each node in nodeList against the directives. Once all directives - * for a particular node are collected their compile functions are executed. The compile - * functions return values - the linking functions - are combined into a composite linking - * function, which is the a linking function for the node. - * - * @param {NodeList} nodeList an array of nodes or NodeList to compile - * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the - * scope argument is auto-generated to the new child of the transcluded parent scope. - * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then - * the rootElement must be set the jqLite collection of the compile root. This is - * needed so that the jqLite collection items can be replaced with widgets. - * @param {number=} maxPriority Max directive priority. - * @returns {Function} A composite linking function of all of the matched directives or null. - */ - function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective, - previousCompileContext) { - var linkFns = [], - attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound; - - for (var i = 0; i < nodeList.length; i++) { - attrs = new Attributes(); - - // we must always refer to nodeList[i] since the nodes can be replaced underneath us. - directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined, - ignoreDirective); - - nodeLinkFn = (directives.length) - ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, - null, [], [], previousCompileContext) - : null; - - if (nodeLinkFn && nodeLinkFn.scope) { - compile.$$addScopeClass(attrs.$$element); - } - - childLinkFn = (nodeLinkFn && nodeLinkFn.terminal || - !(childNodes = nodeList[i].childNodes) || - !childNodes.length) - ? null - : compileNodes(childNodes, - nodeLinkFn ? ( - (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement) - && nodeLinkFn.transclude) : transcludeFn); - - if (nodeLinkFn || childLinkFn) { - linkFns.push(i, nodeLinkFn, childLinkFn); - linkFnFound = true; - nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn; - } - - //use the previous context only for the first element in the virtual group - previousCompileContext = null; - } - - // return a linking function if we have found anything, null otherwise - return linkFnFound ? compositeLinkFn : null; - - function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) { - var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn; - var stableNodeList; - - - if (nodeLinkFnFound) { - // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our - // offsets don't get screwed up - var nodeListLength = nodeList.length; - stableNodeList = new Array(nodeListLength); - - // create a sparse array by only copying the elements which have a linkFn - for (i = 0; i < linkFns.length; i+=3) { - idx = linkFns[i]; - stableNodeList[idx] = nodeList[idx]; - } - } else { - stableNodeList = nodeList; - } - - for (i = 0, ii = linkFns.length; i < ii;) { - node = stableNodeList[linkFns[i++]]; - nodeLinkFn = linkFns[i++]; - childLinkFn = linkFns[i++]; - - if (nodeLinkFn) { - if (nodeLinkFn.scope) { - childScope = scope.$new(); - compile.$$addScopeInfo(jqLite(node), childScope); - } else { - childScope = scope; - } - - if (nodeLinkFn.transcludeOnThisElement) { - childBoundTranscludeFn = createBoundTranscludeFn( - scope, nodeLinkFn.transclude, parentBoundTranscludeFn, - nodeLinkFn.elementTranscludeOnThisElement); - - } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) { - childBoundTranscludeFn = parentBoundTranscludeFn; - - } else if (!parentBoundTranscludeFn && transcludeFn) { - childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn); - - } else { - childBoundTranscludeFn = null; - } - - nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn); - - } else if (childLinkFn) { - childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn); - } - } - } - } - - function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn, elementTransclusion) { - - var boundTranscludeFn = function(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) { - - if (!transcludedScope) { - transcludedScope = scope.$new(false, containingScope); - transcludedScope.$$transcluded = true; - } - - return transcludeFn(transcludedScope, cloneFn, { - parentBoundTranscludeFn: previousBoundTranscludeFn, - transcludeControllers: controllers, - futureParentElement: futureParentElement - }); - }; - - return boundTranscludeFn; - } - - /** - * Looks for directives on the given node and adds them to the directive collection which is - * sorted. - * - * @param node Node to search. - * @param directives An array to which the directives are added to. This array is sorted before - * the function returns. - * @param attrs The shared attrs object which is used to populate the normalized attributes. - * @param {number=} maxPriority Max directive priority. - */ - function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) { - var nodeType = node.nodeType, - attrsMap = attrs.$attr, - match, - className; - - switch (nodeType) { - case NODE_TYPE_ELEMENT: /* Element */ - // use the node name: - addDirective(directives, - directiveNormalize(nodeName_(node)), 'E', maxPriority, ignoreDirective); - - // iterate over the attributes - for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes, - j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) { - var attrStartName = false; - var attrEndName = false; - - attr = nAttrs[j]; - name = attr.name; - value = trim(attr.value); - - // support ngAttr attribute binding - ngAttrName = directiveNormalize(name); - if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) { - name = snake_case(ngAttrName.substr(6), '-'); - } - - var directiveNName = ngAttrName.replace(/(Start|End)$/, ''); - if (directiveIsMultElement(directiveNName)) { - if (ngAttrName === directiveNName + 'Start') { - attrStartName = name; - attrEndName = name.substr(0, name.length - 5) + 'end'; - name = name.substr(0, name.length - 6); - } - } - - nName = directiveNormalize(name.toLowerCase()); - attrsMap[nName] = name; - if (isNgAttr || !attrs.hasOwnProperty(nName)) { - attrs[nName] = value; - if (getBooleanAttrName(node, nName)) { - attrs[nName] = true; // presence means true - } - } - addAttrInterpolateDirective(node, directives, value, nName, isNgAttr); - addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName, - attrEndName); - } - - // use class as directive - className = node.className; - if (isString(className) && className !== '') { - while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) { - nName = directiveNormalize(match[2]); - if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) { - attrs[nName] = trim(match[3]); - } - className = className.substr(match.index + match[0].length); - } - } - break; - case NODE_TYPE_TEXT: /* Text Node */ - addTextInterpolateDirective(directives, node.nodeValue); - break; - case NODE_TYPE_COMMENT: /* Comment */ - try { - match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue); - if (match) { - nName = directiveNormalize(match[1]); - if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) { - attrs[nName] = trim(match[2]); - } - } - } catch (e) { - // turns out that under some circumstances IE9 throws errors when one attempts to read - // comment's node value. - // Just ignore it and continue. (Can't seem to reproduce in test case.) - } - break; - } - - directives.sort(byPriority); - return directives; - } - - /** - * Given a node with an directive-start it collects all of the siblings until it finds - * directive-end. - * @param node - * @param attrStart - * @param attrEnd - * @returns {*} - */ - function groupScan(node, attrStart, attrEnd) { - var nodes = []; - var depth = 0; - if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) { - do { - if (!node) { - throw $compileMinErr('uterdir', - "Unterminated attribute, found '{0}' but no matching '{1}' found.", - attrStart, attrEnd); - } - if (node.nodeType == NODE_TYPE_ELEMENT) { - if (node.hasAttribute(attrStart)) depth++; - if (node.hasAttribute(attrEnd)) depth--; - } - nodes.push(node); - node = node.nextSibling; - } while (depth > 0); - } else { - nodes.push(node); - } - - return jqLite(nodes); - } - - /** - * Wrapper for linking function which converts normal linking function into a grouped - * linking function. - * @param linkFn - * @param attrStart - * @param attrEnd - * @returns {Function} - */ - function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) { - return function(scope, element, attrs, controllers, transcludeFn) { - element = groupScan(element[0], attrStart, attrEnd); - return linkFn(scope, element, attrs, controllers, transcludeFn); - }; - } - - /** - * Once the directives have been collected, their compile functions are executed. This method - * is responsible for inlining directive templates as well as terminating the application - * of the directives if the terminal directive has been reached. - * - * @param {Array} directives Array of collected directives to execute their compile function. - * this needs to be pre-sorted by priority order. - * @param {Node} compileNode The raw DOM node to apply the compile functions to - * @param {Object} templateAttrs The shared attribute function - * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the - * scope argument is auto-generated to the new - * child of the transcluded parent scope. - * @param {JQLite} jqCollection If we are working on the root of the compile tree then this - * argument has the root jqLite array so that we can replace nodes - * on it. - * @param {Object=} originalReplaceDirective An optional directive that will be ignored when - * compiling the transclusion. - * @param {Array.} preLinkFns - * @param {Array.} postLinkFns - * @param {Object} previousCompileContext Context used for previous compilation of the current - * node - * @returns {Function} linkFn - */ - function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn, - jqCollection, originalReplaceDirective, preLinkFns, postLinkFns, - previousCompileContext) { - previousCompileContext = previousCompileContext || {}; - - var terminalPriority = -Number.MAX_VALUE, - newScopeDirective, - controllerDirectives = previousCompileContext.controllerDirectives, - controllers, - newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective, - templateDirective = previousCompileContext.templateDirective, - nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective, - hasTranscludeDirective = false, - hasTemplate = false, - hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective, - $compileNode = templateAttrs.$$element = jqLite(compileNode), - directive, - directiveName, - $template, - replaceDirective = originalReplaceDirective, - childTranscludeFn = transcludeFn, - linkFn, - directiveValue; - - // executes all directives on the current element - for (var i = 0, ii = directives.length; i < ii; i++) { - directive = directives[i]; - var attrStart = directive.$$start; - var attrEnd = directive.$$end; - - // collect multiblock sections - if (attrStart) { - $compileNode = groupScan(compileNode, attrStart, attrEnd); - } - $template = undefined; - - if (terminalPriority > directive.priority) { - break; // prevent further processing of directives - } - - if (directiveValue = directive.scope) { - - // skip the check for directives with async templates, we'll check the derived sync - // directive when the template arrives - if (!directive.templateUrl) { - if (isObject(directiveValue)) { - // This directive is trying to add an isolated scope. - // Check that there is no scope of any kind already - assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective, - directive, $compileNode); - newIsolateScopeDirective = directive; - } else { - // This directive is trying to add a child scope. - // Check that there is no isolated scope already - assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive, - $compileNode); - } - } - - newScopeDirective = newScopeDirective || directive; - } - - directiveName = directive.name; - - if (!directive.templateUrl && directive.controller) { - directiveValue = directive.controller; - controllerDirectives = controllerDirectives || {}; - assertNoDuplicate("'" + directiveName + "' controller", - controllerDirectives[directiveName], directive, $compileNode); - controllerDirectives[directiveName] = directive; - } - - if (directiveValue = directive.transclude) { - hasTranscludeDirective = true; - - // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion. - // This option should only be used by directives that know how to safely handle element transclusion, - // where the transcluded nodes are added or replaced after linking. - if (!directive.$$tlb) { - assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode); - nonTlbTranscludeDirective = directive; - } - - if (directiveValue == 'element') { - hasElementTranscludeDirective = true; - terminalPriority = directive.priority; - $template = $compileNode; - $compileNode = templateAttrs.$$element = - jqLite(document.createComment(' ' + directiveName + ': ' + - templateAttrs[directiveName] + ' ')); - compileNode = $compileNode[0]; - replaceWith(jqCollection, sliceArgs($template), compileNode); - - childTranscludeFn = compile($template, transcludeFn, terminalPriority, - replaceDirective && replaceDirective.name, { - // Don't pass in: - // - controllerDirectives - otherwise we'll create duplicates controllers - // - newIsolateScopeDirective or templateDirective - combining templates with - // element transclusion doesn't make sense. - // - // We need only nonTlbTranscludeDirective so that we prevent putting transclusion - // on the same element more than once. - nonTlbTranscludeDirective: nonTlbTranscludeDirective - }); - } else { - $template = jqLite(jqLiteClone(compileNode)).contents(); - $compileNode.empty(); // clear contents - childTranscludeFn = compile($template, transcludeFn); - } - } - - if (directive.template) { - hasTemplate = true; - assertNoDuplicate('template', templateDirective, directive, $compileNode); - templateDirective = directive; - - directiveValue = (isFunction(directive.template)) - ? directive.template($compileNode, templateAttrs) - : directive.template; - - directiveValue = denormalizeTemplate(directiveValue); - - if (directive.replace) { - replaceDirective = directive; - if (jqLiteIsTextNode(directiveValue)) { - $template = []; - } else { - $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue))); - } - compileNode = $template[0]; - - if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) { - throw $compileMinErr('tplrt', - "Template for directive '{0}' must have exactly one root element. {1}", - directiveName, ''); - } - - replaceWith(jqCollection, $compileNode, compileNode); - - var newTemplateAttrs = {$attr: {}}; - - // combine directives from the original node and from the template: - // - take the array of directives for this element - // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed) - // - collect directives from the template and sort them by priority - // - combine directives as: processed + template + unprocessed - var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs); - var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1)); - - if (newIsolateScopeDirective) { - markDirectivesAsIsolate(templateDirectives); - } - directives = directives.concat(templateDirectives).concat(unprocessedDirectives); - mergeTemplateAttributes(templateAttrs, newTemplateAttrs); - - ii = directives.length; - } else { - $compileNode.html(directiveValue); - } - } - - if (directive.templateUrl) { - hasTemplate = true; - assertNoDuplicate('template', templateDirective, directive, $compileNode); - templateDirective = directive; - - if (directive.replace) { - replaceDirective = directive; - } - - nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode, - templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, { - controllerDirectives: controllerDirectives, - newIsolateScopeDirective: newIsolateScopeDirective, - templateDirective: templateDirective, - nonTlbTranscludeDirective: nonTlbTranscludeDirective - }); - ii = directives.length; - } else if (directive.compile) { - try { - linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn); - if (isFunction(linkFn)) { - addLinkFns(null, linkFn, attrStart, attrEnd); - } else if (linkFn) { - addLinkFns(linkFn.pre, linkFn.post, attrStart, attrEnd); - } - } catch (e) { - $exceptionHandler(e, startingTag($compileNode)); - } - } - - if (directive.terminal) { - nodeLinkFn.terminal = true; - terminalPriority = Math.max(terminalPriority, directive.priority); - } - - } - - nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true; - nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective; - nodeLinkFn.elementTranscludeOnThisElement = hasElementTranscludeDirective; - nodeLinkFn.templateOnThisElement = hasTemplate; - nodeLinkFn.transclude = childTranscludeFn; - - previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective; - - // might be normal or delayed nodeLinkFn depending on if templateUrl is present - return nodeLinkFn; - - //////////////////// - - function addLinkFns(pre, post, attrStart, attrEnd) { - if (pre) { - if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd); - pre.require = directive.require; - pre.directiveName = directiveName; - if (newIsolateScopeDirective === directive || directive.$$isolateScope) { - pre = cloneAndAnnotateFn(pre, {isolateScope: true}); - } - preLinkFns.push(pre); - } - if (post) { - if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd); - post.require = directive.require; - post.directiveName = directiveName; - if (newIsolateScopeDirective === directive || directive.$$isolateScope) { - post = cloneAndAnnotateFn(post, {isolateScope: true}); - } - postLinkFns.push(post); - } - } - - - function getControllers(directiveName, require, $element, elementControllers) { - var value, retrievalMethod = 'data', optional = false; - var $searchElement = $element; - var match; - if (isString(require)) { - match = require.match(REQUIRE_PREFIX_REGEXP); - require = require.substring(match[0].length); - - if (match[3]) { - if (match[1]) match[3] = null; - else match[1] = match[3]; - } - if (match[1] === '^') { - retrievalMethod = 'inheritedData'; - } else if (match[1] === '^^') { - retrievalMethod = 'inheritedData'; - $searchElement = $element.parent(); - } - if (match[2] === '?') { - optional = true; - } - - value = null; - - if (elementControllers && retrievalMethod === 'data') { - if (value = elementControllers[require]) { - value = value.instance; - } - } - value = value || $searchElement[retrievalMethod]('$' + require + 'Controller'); - - if (!value && !optional) { - throw $compileMinErr('ctreq', - "Controller '{0}', required by directive '{1}', can't be found!", - require, directiveName); - } - return value || null; - } else if (isArray(require)) { - value = []; - forEach(require, function(require) { - value.push(getControllers(directiveName, require, $element, elementControllers)); - }); - } - return value; - } - - - function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) { - var i, ii, linkFn, controller, isolateScope, elementControllers, transcludeFn, $element, - attrs; - - if (compileNode === linkNode) { - attrs = templateAttrs; - $element = templateAttrs.$$element; - } else { - $element = jqLite(linkNode); - attrs = new Attributes($element, templateAttrs); - } - - if (newIsolateScopeDirective) { - isolateScope = scope.$new(true); - } - - if (boundTranscludeFn) { - // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn` - // is later passed as `parentBoundTranscludeFn` to `publicLinkFn` - transcludeFn = controllersBoundTransclude; - transcludeFn.$$boundTransclude = boundTranscludeFn; - } - - if (controllerDirectives) { - // TODO: merge `controllers` and `elementControllers` into single object. - controllers = {}; - elementControllers = {}; - forEach(controllerDirectives, function(directive) { - var locals = { - $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope, - $element: $element, - $attrs: attrs, - $transclude: transcludeFn - }, controllerInstance; - - controller = directive.controller; - if (controller == '@') { - controller = attrs[directive.name]; - } - - controllerInstance = $controller(controller, locals, true, directive.controllerAs); - - // For directives with element transclusion the element is a comment, - // but jQuery .data doesn't support attaching data to comment nodes as it's hard to - // clean up (http://bugs.jquery.com/ticket/8335). - // Instead, we save the controllers for the element in a local hash and attach to .data - // later, once we have the actual element. - elementControllers[directive.name] = controllerInstance; - if (!hasElementTranscludeDirective) { - $element.data('$' + directive.name + 'Controller', controllerInstance.instance); - } - - controllers[directive.name] = controllerInstance; - }); - } - - if (newIsolateScopeDirective) { - compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective || - templateDirective === newIsolateScopeDirective.$$originalDirective))); - compile.$$addScopeClass($element, true); - - var isolateScopeController = controllers && controllers[newIsolateScopeDirective.name]; - var isolateBindingContext = isolateScope; - if (isolateScopeController && isolateScopeController.identifier && - newIsolateScopeDirective.bindToController === true) { - isolateBindingContext = isolateScopeController.instance; - } - - forEach(isolateScope.$$isolateBindings = newIsolateScopeDirective.$$isolateBindings, function(definition, scopeName) { - var attrName = definition.attrName, - optional = definition.optional, - mode = definition.mode, // @, =, or & - lastValue, - parentGet, parentSet, compare; - - switch (mode) { - - case '@': - attrs.$observe(attrName, function(value) { - isolateBindingContext[scopeName] = value; - }); - attrs.$$observers[attrName].$$scope = scope; - if (attrs[attrName]) { - // If the attribute has been provided then we trigger an interpolation to ensure - // the value is there for use in the link fn - isolateBindingContext[scopeName] = $interpolate(attrs[attrName])(scope); - } - break; - - case '=': - if (optional && !attrs[attrName]) { - return; - } - parentGet = $parse(attrs[attrName]); - if (parentGet.literal) { - compare = equals; - } else { - compare = function(a, b) { return a === b || (a !== a && b !== b); }; - } - parentSet = parentGet.assign || function() { - // reset the change, or we will throw this exception on every $digest - lastValue = isolateBindingContext[scopeName] = parentGet(scope); - throw $compileMinErr('nonassign', - "Expression '{0}' used with directive '{1}' is non-assignable!", - attrs[attrName], newIsolateScopeDirective.name); - }; - lastValue = isolateBindingContext[scopeName] = parentGet(scope); - var parentValueWatch = function parentValueWatch(parentValue) { - if (!compare(parentValue, isolateBindingContext[scopeName])) { - // we are out of sync and need to copy - if (!compare(parentValue, lastValue)) { - // parent changed and it has precedence - isolateBindingContext[scopeName] = parentValue; - } else { - // if the parent can be assigned then do so - parentSet(scope, parentValue = isolateBindingContext[scopeName]); - } - } - return lastValue = parentValue; - }; - parentValueWatch.$stateful = true; - var unwatch; - if (definition.collection) { - unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch); - } else { - unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal); - } - isolateScope.$on('$destroy', unwatch); - break; - - case '&': - parentGet = $parse(attrs[attrName]); - isolateBindingContext[scopeName] = function(locals) { - return parentGet(scope, locals); - }; - break; - } - }); - } - if (controllers) { - forEach(controllers, function(controller) { - controller(); - }); - controllers = null; - } - - // PRELINKING - for (i = 0, ii = preLinkFns.length; i < ii; i++) { - linkFn = preLinkFns[i]; - invokeLinkFn(linkFn, - linkFn.isolateScope ? isolateScope : scope, - $element, - attrs, - linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), - transcludeFn - ); - } - - // RECURSION - // We only pass the isolate scope, if the isolate directive has a template, - // otherwise the child elements do not belong to the isolate directive. - var scopeToChild = scope; - if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) { - scopeToChild = isolateScope; - } - childLinkFn && childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn); - - // POSTLINKING - for (i = postLinkFns.length - 1; i >= 0; i--) { - linkFn = postLinkFns[i]; - invokeLinkFn(linkFn, - linkFn.isolateScope ? isolateScope : scope, - $element, - attrs, - linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), - transcludeFn - ); - } - - // This is the function that is injected as `$transclude`. - // Note: all arguments are optional! - function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) { - var transcludeControllers; - - // No scope passed in: - if (!isScope(scope)) { - futureParentElement = cloneAttachFn; - cloneAttachFn = scope; - scope = undefined; - } - - if (hasElementTranscludeDirective) { - transcludeControllers = elementControllers; - } - if (!futureParentElement) { - futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element; - } - return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild); - } - } - } - - function markDirectivesAsIsolate(directives) { - // mark all directives as needing isolate scope. - for (var j = 0, jj = directives.length; j < jj; j++) { - directives[j] = inherit(directives[j], {$$isolateScope: true}); - } - } - - /** - * looks up the directive and decorates it with exception handling and proper parameters. We - * call this the boundDirective. - * - * @param {string} name name of the directive to look up. - * @param {string} location The directive must be found in specific format. - * String containing any of theses characters: - * - * * `E`: element name - * * `A': attribute - * * `C`: class - * * `M`: comment - * @returns {boolean} true if directive was added. - */ - function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, - endAttrName) { - if (name === ignoreDirective) return null; - var match = null; - if (hasDirectives.hasOwnProperty(name)) { - for (var directive, directives = $injector.get(name + Suffix), - i = 0, ii = directives.length; i < ii; i++) { - try { - directive = directives[i]; - if ((maxPriority === undefined || maxPriority > directive.priority) && - directive.restrict.indexOf(location) != -1) { - if (startAttrName) { - directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName}); - } - tDirectives.push(directive); - match = directive; - } - } catch (e) { $exceptionHandler(e); } - } - } - return match; - } - - - /** - * looks up the directive and returns true if it is a multi-element directive, - * and therefore requires DOM nodes between -start and -end markers to be grouped - * together. - * - * @param {string} name name of the directive to look up. - * @returns true if directive was registered as multi-element. - */ - function directiveIsMultElement(name) { - if (hasDirectives.hasOwnProperty(name)) { - for (var directive, directives = $injector.get(name + Suffix), - i = 0, ii = directives.length; i < ii; i++) { - directive = directives[i]; - if (directive.multElement) { - return true; - } - } - } - return false; - } - - /** - * When the element is replaced with HTML template then the new attributes - * on the template need to be merged with the existing attributes in the DOM. - * The desired effect is to have both of the attributes present. - * - * @param {object} dst destination attributes (original DOM) - * @param {object} src source attributes (from the directive template) - */ - function mergeTemplateAttributes(dst, src) { - var srcAttr = src.$attr, - dstAttr = dst.$attr, - $element = dst.$$element; - - // reapply the old attributes to the new element - forEach(dst, function(value, key) { - if (key.charAt(0) != '$') { - if (src[key] && src[key] !== value) { - value += (key === 'style' ? ';' : ' ') + src[key]; - } - dst.$set(key, value, true, srcAttr[key]); - } - }); - - // copy the new attributes on the old attrs object - forEach(src, function(value, key) { - if (key == 'class') { - safeAddClass($element, value); - dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value; - } else if (key == 'style') { - $element.attr('style', $element.attr('style') + ';' + value); - dst['style'] = (dst['style'] ? dst['style'] + ';' : '') + value; - // `dst` will never contain hasOwnProperty as DOM parser won't let it. - // You will get an "InvalidCharacterError: DOM Exception 5" error if you - // have an attribute like "has-own-property" or "data-has-own-property", etc. - } else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) { - dst[key] = value; - dstAttr[key] = srcAttr[key]; - } - }); - } - - - function compileTemplateUrl(directives, $compileNode, tAttrs, - $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) { - var linkQueue = [], - afterTemplateNodeLinkFn, - afterTemplateChildLinkFn, - beforeTemplateCompileNode = $compileNode[0], - origAsyncDirective = directives.shift(), - // The fact that we have to copy and patch the directive seems wrong! - derivedSyncDirective = extend({}, origAsyncDirective, { - templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective - }), - templateUrl = (isFunction(origAsyncDirective.templateUrl)) - ? origAsyncDirective.templateUrl($compileNode, tAttrs) - : origAsyncDirective.templateUrl, - templateNamespace = origAsyncDirective.templateNamespace; - - $compileNode.empty(); - - $templateRequest($sce.getTrustedResourceUrl(templateUrl)) - .then(function(content) { - var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn; - - content = denormalizeTemplate(content); - - if (origAsyncDirective.replace) { - if (jqLiteIsTextNode(content)) { - $template = []; - } else { - $template = removeComments(wrapTemplate(templateNamespace, trim(content))); - } - compileNode = $template[0]; - - if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) { - throw $compileMinErr('tplrt', - "Template for directive '{0}' must have exactly one root element. {1}", - origAsyncDirective.name, templateUrl); - } - - tempTemplateAttrs = {$attr: {}}; - replaceWith($rootElement, $compileNode, compileNode); - var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs); - - if (isObject(origAsyncDirective.scope)) { - markDirectivesAsIsolate(templateDirectives); - } - directives = templateDirectives.concat(directives); - mergeTemplateAttributes(tAttrs, tempTemplateAttrs); - } else { - compileNode = beforeTemplateCompileNode; - $compileNode.html(content); - } - - directives.unshift(derivedSyncDirective); - - afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs, - childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns, - previousCompileContext); - forEach($rootElement, function(node, i) { - if (node == compileNode) { - $rootElement[i] = $compileNode[0]; - } - }); - afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn); - - while (linkQueue.length) { - var scope = linkQueue.shift(), - beforeTemplateLinkNode = linkQueue.shift(), - linkRootElement = linkQueue.shift(), - boundTranscludeFn = linkQueue.shift(), - linkNode = $compileNode[0]; - - if (scope.$$destroyed) continue; - - if (beforeTemplateLinkNode !== beforeTemplateCompileNode) { - var oldClasses = beforeTemplateLinkNode.className; - - if (!(previousCompileContext.hasElementTranscludeDirective && - origAsyncDirective.replace)) { - // it was cloned therefore we have to clone as well. - linkNode = jqLiteClone(compileNode); - } - replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode); - - // Copy in CSS classes from original node - safeAddClass(jqLite(linkNode), oldClasses); - } - if (afterTemplateNodeLinkFn.transcludeOnThisElement) { - childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn); - } else { - childBoundTranscludeFn = boundTranscludeFn; - } - afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement, - childBoundTranscludeFn); - } - linkQueue = null; - }); - - return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) { - var childBoundTranscludeFn = boundTranscludeFn; - if (scope.$$destroyed) return; - if (linkQueue) { - linkQueue.push(scope); - linkQueue.push(node); - linkQueue.push(rootElement); - linkQueue.push(childBoundTranscludeFn); - } else { - if (afterTemplateNodeLinkFn.transcludeOnThisElement) { - childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn); - } - afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn); - } - }; - } - - - /** - * Sorting function for bound directives. - */ - function byPriority(a, b) { - var diff = b.priority - a.priority; - if (diff !== 0) return diff; - if (a.name !== b.name) return (a.name < b.name) ? -1 : 1; - return a.index - b.index; - } - - - function assertNoDuplicate(what, previousDirective, directive, element) { - if (previousDirective) { - throw $compileMinErr('multidir', 'Multiple directives [{0}, {1}] asking for {2} on: {3}', - previousDirective.name, directive.name, what, startingTag(element)); - } - } - - - function addTextInterpolateDirective(directives, text) { - var interpolateFn = $interpolate(text, true); - if (interpolateFn) { - directives.push({ - priority: 0, - compile: function textInterpolateCompileFn(templateNode) { - var templateNodeParent = templateNode.parent(), - hasCompileParent = !!templateNodeParent.length; - - // When transcluding a template that has bindings in the root - // we don't have a parent and thus need to add the class during linking fn. - if (hasCompileParent) compile.$$addBindingClass(templateNodeParent); - - return function textInterpolateLinkFn(scope, node) { - var parent = node.parent(); - if (!hasCompileParent) compile.$$addBindingClass(parent); - compile.$$addBindingInfo(parent, interpolateFn.expressions); - scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { - node[0].nodeValue = value; - }); - }; - } - }); - } - } - - - function wrapTemplate(type, template) { - type = lowercase(type || 'html'); - switch (type) { - case 'svg': - case 'math': - var wrapper = document.createElement('div'); - wrapper.innerHTML = '<' + type + '>' + template + ''; - return wrapper.childNodes[0].childNodes; - default: - return template; - } - } - - - function getTrustedContext(node, attrNormalizedName) { - if (attrNormalizedName == "srcdoc") { - return $sce.HTML; - } - var tag = nodeName_(node); - // maction[xlink:href] can source SVG. It's not limited to . - if (attrNormalizedName == "xlinkHref" || - (tag == "form" && attrNormalizedName == "action") || - (tag != "img" && (attrNormalizedName == "src" || - attrNormalizedName == "ngSrc"))) { - return $sce.RESOURCE_URL; - } - } - - - function addAttrInterpolateDirective(node, directives, value, name, allOrNothing) { - var interpolateFn = $interpolate(value, true); - - // no interpolation found -> ignore - if (!interpolateFn) return; - - - if (name === "multiple" && nodeName_(node) === "select") { - throw $compileMinErr("selmulti", - "Binding to the 'multiple' attribute is not supported. Element: {0}", - startingTag(node)); - } - - directives.push({ - priority: 100, - compile: function() { - return { - pre: function attrInterpolatePreLinkFn(scope, element, attr) { - var $$observers = (attr.$$observers || (attr.$$observers = {})); - - if (EVENT_HANDLER_ATTR_REGEXP.test(name)) { - throw $compileMinErr('nodomevents', - "Interpolations for HTML DOM event attributes are disallowed. Please use the " + - "ng- versions (such as ng-click instead of onclick) instead."); - } - - // If the attribute was removed, then we are done - if (!attr[name]) { - return; - } - - // we need to interpolate again, in case the attribute value has been updated - // (e.g. by another directive's compile function) - interpolateFn = $interpolate(attr[name], true, getTrustedContext(node, name), - ALL_OR_NOTHING_ATTRS[name] || allOrNothing); - - // if attribute was updated so that there is no interpolation going on we don't want to - // register any observers - if (!interpolateFn) return; - - // initialize attr object so that it's ready in case we need the value for isolate - // scope initialization, otherwise the value would not be available from isolate - // directive's linking fn during linking phase - attr[name] = interpolateFn(scope); - - ($$observers[name] || ($$observers[name] = [])).$$inter = true; - (attr.$$observers && attr.$$observers[name].$$scope || scope). - $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) { - //special case for class attribute addition + removal - //so that class changes can tap into the animation - //hooks provided by the $animate service. Be sure to - //skip animations when the first digest occurs (when - //both the new and the old values are the same) since - //the CSS classes are the non-interpolated values - if (name === 'class' && newValue != oldValue) { - attr.$updateClass(newValue, oldValue); - } else { - attr.$set(name, newValue); - } - }); - } - }; - } - }); - } - - - /** - * This is a special jqLite.replaceWith, which can replace items which - * have no parents, provided that the containing jqLite collection is provided. - * - * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes - * in the root of the tree. - * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep - * the shell, but replace its DOM node reference. - * @param {Node} newNode The new DOM node. - */ - function replaceWith($rootElement, elementsToRemove, newNode) { - var firstElementToRemove = elementsToRemove[0], - removeCount = elementsToRemove.length, - parent = firstElementToRemove.parentNode, - i, ii; - - if ($rootElement) { - for (i = 0, ii = $rootElement.length; i < ii; i++) { - if ($rootElement[i] == firstElementToRemove) { - $rootElement[i++] = newNode; - for (var j = i, j2 = j + removeCount - 1, - jj = $rootElement.length; - j < jj; j++, j2++) { - if (j2 < jj) { - $rootElement[j] = $rootElement[j2]; - } else { - delete $rootElement[j]; - } - } - $rootElement.length -= removeCount - 1; - - // If the replaced element is also the jQuery .context then replace it - // .context is a deprecated jQuery api, so we should set it only when jQuery set it - // http://api.jquery.com/context/ - if ($rootElement.context === firstElementToRemove) { - $rootElement.context = newNode; - } - break; - } - } - } - - if (parent) { - parent.replaceChild(newNode, firstElementToRemove); - } - - // TODO(perf): what's this document fragment for? is it needed? can we at least reuse it? - var fragment = document.createDocumentFragment(); - fragment.appendChild(firstElementToRemove); - - // Copy over user data (that includes Angular's $scope etc.). Don't copy private - // data here because there's no public interface in jQuery to do that and copying over - // event listeners (which is the main use of private data) wouldn't work anyway. - jqLite(newNode).data(jqLite(firstElementToRemove).data()); - - // Remove data of the replaced element. We cannot just call .remove() - // on the element it since that would deallocate scope that is needed - // for the new node. Instead, remove the data "manually". - if (!jQuery) { - delete jqLite.cache[firstElementToRemove[jqLite.expando]]; - } else { - // jQuery 2.x doesn't expose the data storage. Use jQuery.cleanData to clean up after - // the replaced element. The cleanData version monkey-patched by Angular would cause - // the scope to be trashed and we do need the very same scope to work with the new - // element. However, we cannot just cache the non-patched version and use it here as - // that would break if another library patches the method after Angular does (one - // example is jQuery UI). Instead, set a flag indicating scope destroying should be - // skipped this one time. - skipDestroyOnNextJQueryCleanData = true; - jQuery.cleanData([firstElementToRemove]); - } - - for (var k = 1, kk = elementsToRemove.length; k < kk; k++) { - var element = elementsToRemove[k]; - jqLite(element).remove(); // must do this way to clean up expando - fragment.appendChild(element); - delete elementsToRemove[k]; - } - - elementsToRemove[0] = newNode; - elementsToRemove.length = 1; - } - - - function cloneAndAnnotateFn(fn, annotation) { - return extend(function() { return fn.apply(null, arguments); }, fn, annotation); - } - - - function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) { - try { - linkFn(scope, $element, attrs, controllers, transcludeFn); - } catch (e) { - $exceptionHandler(e, startingTag($element)); - } - } - }]; -} - -var PREFIX_REGEXP = /^((?:x|data)[\:\-_])/i; -/** - * Converts all accepted directives format into proper directive name. - * All of these will become 'myDirective': - * my:Directive - * my-directive - * x-my-directive - * data-my:directive - * - * Also there is special case for Moz prefix starting with upper case letter. - * @param name Name to normalize - */ -function directiveNormalize(name) { - return camelCase(name.replace(PREFIX_REGEXP, '')); -} - -/** - * @ngdoc type - * @name $compile.directive.Attributes - * - * @description - * A shared object between directive compile / linking functions which contains normalized DOM - * element attributes. The values reflect current binding state `{{ }}`. The normalization is - * needed since all of these are treated as equivalent in Angular: - * - * ``` - * - * ``` - */ - -/** - * @ngdoc property - * @name $compile.directive.Attributes#$attr - * - * @description - * A map of DOM element attribute names to the normalized name. This is - * needed to do reverse lookup from normalized name back to actual name. - */ - - -/** - * @ngdoc method - * @name $compile.directive.Attributes#$set - * @kind function - * - * @description - * Set DOM element attribute value. - * - * - * @param {string} name Normalized element attribute name of the property to modify. The name is - * reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr} - * property to the original name. - * @param {string} value Value to set the attribute to. The value can be an interpolated string. - */ - - - -/** - * Closure compiler type information - */ - -function nodesetLinkingFn( - /* angular.Scope */ scope, - /* NodeList */ nodeList, - /* Element */ rootElement, - /* function(Function) */ boundTranscludeFn -) {} - -function directiveLinkingFn( - /* nodesetLinkingFn */ nodesetLinkingFn, - /* angular.Scope */ scope, - /* Node */ node, - /* Element */ rootElement, - /* function(Function) */ boundTranscludeFn -) {} - -function tokenDifference(str1, str2) { - var values = '', - tokens1 = str1.split(/\s+/), - tokens2 = str2.split(/\s+/); - - outer: - for (var i = 0; i < tokens1.length; i++) { - var token = tokens1[i]; - for (var j = 0; j < tokens2.length; j++) { - if (token == tokens2[j]) continue outer; - } - values += (values.length > 0 ? ' ' : '') + token; - } - return values; -} - -function removeComments(jqNodes) { - jqNodes = jqLite(jqNodes); - var i = jqNodes.length; - - if (i <= 1) { - return jqNodes; - } - - while (i--) { - var node = jqNodes[i]; - if (node.nodeType === NODE_TYPE_COMMENT) { - splice.call(jqNodes, i, 1); - } - } - return jqNodes; -} - -/** - * @ngdoc provider - * @name $controllerProvider - * @description - * The {@link ng.$controller $controller service} is used by Angular to create new - * controllers. - * - * This provider allows controller registration via the - * {@link ng.$controllerProvider#register register} method. - */ -function $ControllerProvider() { - var controllers = {}, - globals = false, - CNTRL_REG = /^(\S+)(\s+as\s+(\w+))?$/; - - - /** - * @ngdoc method - * @name $controllerProvider#register - * @param {string|Object} name Controller name, or an object map of controllers where the keys are - * the names and the values are the constructors. - * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI - * annotations in the array notation). - */ - this.register = function(name, constructor) { - assertNotHasOwnProperty(name, 'controller'); - if (isObject(name)) { - extend(controllers, name); - } else { - controllers[name] = constructor; - } - }; - - /** - * @ngdoc method - * @name $controllerProvider#allowGlobals - * @description If called, allows `$controller` to find controller constructors on `window` - */ - this.allowGlobals = function() { - globals = true; - }; - - - this.$get = ['$injector', '$window', function($injector, $window) { - - /** - * @ngdoc service - * @name $controller - * @requires $injector - * - * @param {Function|string} constructor If called with a function then it's considered to be the - * controller constructor function. Otherwise it's considered to be a string which is used - * to retrieve the controller constructor using the following steps: - * - * * check if a controller with given name is registered via `$controllerProvider` - * * check if evaluating the string on the current scope returns a constructor - * * if $controllerProvider#allowGlobals, check `window[constructor]` on the global - * `window` object (not recommended) - * - * The string can use the `controller as property` syntax, where the controller instance is published - * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this - * to work correctly. - * - * @param {Object} locals Injection locals for Controller. - * @return {Object} Instance of given controller. - * - * @description - * `$controller` service is responsible for instantiating controllers. - * - * It's just a simple call to {@link auto.$injector $injector}, but extracted into - * a service, so that one can override this service with [BC version](https://gist.github.com/1649788). - */ - return function(expression, locals, later, ident) { - // PRIVATE API: - // param `later` --- indicates that the controller's constructor is invoked at a later time. - // If true, $controller will allocate the object with the correct - // prototype chain, but will not invoke the controller until a returned - // callback is invoked. - // param `ident` --- An optional label which overrides the label parsed from the controller - // expression, if any. - var instance, match, constructor, identifier; - later = later === true; - if (ident && isString(ident)) { - identifier = ident; - } - - if (isString(expression)) { - match = expression.match(CNTRL_REG), - constructor = match[1], - identifier = identifier || match[3]; - expression = controllers.hasOwnProperty(constructor) - ? controllers[constructor] - : getter(locals.$scope, constructor, true) || - (globals ? getter($window, constructor, true) : undefined); - - assertArgFn(expression, constructor, true); - } - - if (later) { - // Instantiate controller later: - // This machinery is used to create an instance of the object before calling the - // controller's constructor itself. - // - // This allows properties to be added to the controller before the constructor is - // invoked. Primarily, this is used for isolate scope bindings in $compile. - // - // This feature is not intended for use by applications, and is thus not documented - // publicly. - var Constructor = function() {}; - Constructor.prototype = (isArray(expression) ? - expression[expression.length - 1] : expression).prototype; - instance = new Constructor(); - - if (identifier) { - addIdentifier(locals, identifier, instance, constructor || expression.name); - } - - return extend(function() { - $injector.invoke(expression, instance, locals, constructor); - return instance; - }, { - instance: instance, - identifier: identifier - }); - } - - instance = $injector.instantiate(expression, locals, constructor); - - if (identifier) { - addIdentifier(locals, identifier, instance, constructor || expression.name); - } - - return instance; - }; - - function addIdentifier(locals, identifier, instance, name) { - if (!(locals && isObject(locals.$scope))) { - throw minErr('$controller')('noscp', - "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.", - name, identifier); - } - - locals.$scope[identifier] = instance; - } - }]; -} - -/** - * @ngdoc service - * @name $document - * @requires $window - * - * @description - * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object. - * - * @example - - -
-

$document title:

-

window.document title:

-
-
- - angular.module('documentExample', []) - .controller('ExampleController', ['$scope', '$document', function($scope, $document) { - $scope.title = $document[0].title; - $scope.windowTitle = angular.element(window.document)[0].title; - }]); - -
- */ -function $DocumentProvider() { - this.$get = ['$window', function(window) { - return jqLite(window.document); - }]; -} - -/** - * @ngdoc service - * @name $exceptionHandler - * @requires ng.$log - * - * @description - * Any uncaught exception in angular expressions is delegated to this service. - * The default implementation simply delegates to `$log.error` which logs it into - * the browser console. - * - * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by - * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing. - * - * ## Example: - * - * ```js - * angular.module('exceptionOverride', []).factory('$exceptionHandler', function() { - * return function(exception, cause) { - * exception.message += ' (caused by "' + cause + '")'; - * throw exception; - * }; - * }); - * ``` - * - * This example will override the normal action of `$exceptionHandler`, to make angular - * exceptions fail hard when they happen, instead of just logging to the console. - * - *
- * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind` - * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler} - * (unless executed during a digest). - * - * If you wish, you can manually delegate exceptions, e.g. - * `try { ... } catch(e) { $exceptionHandler(e); }` - * - * @param {Error} exception Exception associated with the error. - * @param {string=} cause optional information about the context in which - * the error was thrown. - * - */ -function $ExceptionHandlerProvider() { - this.$get = ['$log', function($log) { - return function(exception, cause) { - $log.error.apply($log, arguments); - }; - }]; -} - -var APPLICATION_JSON = 'application/json'; -var CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'}; -var JSON_START = /^\s*(\[|\{[^\{])/; -var JSON_END = /[\}\]]\s*$/; -var JSON_PROTECTION_PREFIX = /^\)\]\}',?\n/; - -function defaultHttpResponseTransform(data, headers) { - if (isString(data)) { - // strip json vulnerability protection prefix - data = data.replace(JSON_PROTECTION_PREFIX, ''); - var contentType = headers('Content-Type'); - if ((contentType && contentType.indexOf(APPLICATION_JSON) === 0 && data.trim()) || - (JSON_START.test(data) && JSON_END.test(data))) { - data = fromJson(data); - } - } - return data; -} - -/** - * Parse headers into key value object - * - * @param {string} headers Raw headers as a string - * @returns {Object} Parsed headers as key value object - */ -function parseHeaders(headers) { - var parsed = {}, key, val, i; - - if (!headers) return parsed; - - forEach(headers.split('\n'), function(line) { - i = line.indexOf(':'); - key = lowercase(trim(line.substr(0, i))); - val = trim(line.substr(i + 1)); - - if (key) { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; - } - }); - - return parsed; -} - - -/** - * Returns a function that provides access to parsed headers. - * - * Headers are lazy parsed when first requested. - * @see parseHeaders - * - * @param {(string|Object)} headers Headers to provide access to. - * @returns {function(string=)} Returns a getter function which if called with: - * - * - if called with single an argument returns a single header value or null - * - if called with no arguments returns an object containing all headers. - */ -function headersGetter(headers) { - var headersObj = isObject(headers) ? headers : undefined; - - return function(name) { - if (!headersObj) headersObj = parseHeaders(headers); - - if (name) { - return headersObj[lowercase(name)] || null; - } - - return headersObj; - }; -} - - -/** - * Chain all given functions - * - * This function is used for both request and response transforming - * - * @param {*} data Data to transform. - * @param {function(string=)} headers Http headers getter fn. - * @param {(Function|Array.)} fns Function or an array of functions. - * @returns {*} Transformed data. - */ -function transformData(data, headers, fns) { - if (isFunction(fns)) - return fns(data, headers); - - forEach(fns, function(fn) { - data = fn(data, headers); - }); - - return data; -} - - -function isSuccess(status) { - return 200 <= status && status < 300; -} - - -/** - * @ngdoc provider - * @name $httpProvider - * @description - * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service. - * */ -function $HttpProvider() { - /** - * @ngdoc property - * @name $httpProvider#defaults - * @description - * - * Object containing default values for all {@link ng.$http $http} requests. - * - * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token. - * Defaults value is `'XSRF-TOKEN'`. - * - * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the - * XSRF token. Defaults value is `'X-XSRF-TOKEN'`. - * - * - **`defaults.headers`** - {Object} - Default headers for all $http requests. - * Refer to {@link ng.$http#setting-http-headers $http} for documentation on - * setting default headers. - * - **`defaults.headers.common`** - * - **`defaults.headers.post`** - * - **`defaults.headers.put`** - * - **`defaults.headers.patch`** - **/ - var defaults = this.defaults = { - // transform incoming response data - transformResponse: [defaultHttpResponseTransform], - - // transform outgoing request data - transformRequest: [function(d) { - return isObject(d) && !isFile(d) && !isBlob(d) ? toJson(d) : d; - }], - - // default headers - headers: { - common: { - 'Accept': 'application/json, text/plain, */*' - }, - post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), - put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), - patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON) - }, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN' - }; - - var useApplyAsync = false; - /** - * @ngdoc method - * @name $httpProvider#useApplyAsync - * @description - * - * Configure $http service to combine processing of multiple http responses received at around - * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in - * significant performance improvement for bigger applications that make many HTTP requests - * concurrently (common during application bootstrap). - * - * Defaults to false. If no value is specifed, returns the current configured value. - * - * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred - * "apply" on the next tick, giving time for subsequent requests in a roughly ~10ms window - * to load and share the same digest cycle. - * - * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining. - * otherwise, returns the current configured value. - **/ - this.useApplyAsync = function(value) { - if (isDefined(value)) { - useApplyAsync = !!value; - return this; - } - return useApplyAsync; - }; - - /** - * @ngdoc property - * @name $httpProvider#interceptors - * @description - * - * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http} - * pre-processing of request or postprocessing of responses. - * - * These service factories are ordered by request, i.e. they are applied in the same order as the - * array, on request, but reverse order, on response. - * - * {@link ng.$http#interceptors Interceptors detailed info} - **/ - var interceptorFactories = this.interceptors = []; - - this.$get = ['$httpBackend', '$browser', '$cacheFactory', '$rootScope', '$q', '$injector', - function($httpBackend, $browser, $cacheFactory, $rootScope, $q, $injector) { - - var defaultCache = $cacheFactory('$http'); - - /** - * Interceptors stored in reverse order. Inner interceptors before outer interceptors. - * The reversal is needed so that we can build up the interception chain around the - * server request. - */ - var reversedInterceptors = []; - - forEach(interceptorFactories, function(interceptorFactory) { - reversedInterceptors.unshift(isString(interceptorFactory) - ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory)); - }); - - /** - * @ngdoc service - * @kind function - * @name $http - * @requires ng.$httpBackend - * @requires $cacheFactory - * @requires $rootScope - * @requires $q - * @requires $injector - * - * @description - * The `$http` service is a core Angular service that facilitates communication with the remote - * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest) - * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP). - * - * For unit testing applications that use `$http` service, see - * {@link ngMock.$httpBackend $httpBackend mock}. - * - * For a higher level of abstraction, please check out the {@link ngResource.$resource - * $resource} service. - * - * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by - * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage - * it is important to familiarize yourself with these APIs and the guarantees they provide. - * - * - * ## General usage - * The `$http` service is a function which takes a single argument — a configuration object — - * that is used to generate an HTTP request and returns a {@link ng.$q promise} - * with two $http specific methods: `success` and `error`. - * - * ```js - * // Simple GET request example : - * $http.get('/someUrl'). - * success(function(data, status, headers, config) { - * // this callback will be called asynchronously - * // when the response is available - * }). - * error(function(data, status, headers, config) { - * // called asynchronously if an error occurs - * // or server returns response with an error status. - * }); - * ``` - * - * ```js - * // Simple POST request example (passing data) : - * $http.post('/someUrl', {msg:'hello word!'}). - * success(function(data, status, headers, config) { - * // this callback will be called asynchronously - * // when the response is available - * }). - * error(function(data, status, headers, config) { - * // called asynchronously if an error occurs - * // or server returns response with an error status. - * }); - * ``` - * - * - * Since the returned value of calling the $http function is a `promise`, you can also use - * the `then` method to register callbacks, and these callbacks will receive a single argument – - * an object representing the response. See the API signature and type info below for more - * details. - * - * A response status code between 200 and 299 is considered a success status and - * will result in the success callback being called. Note that if the response is a redirect, - * XMLHttpRequest will transparently follow it, meaning that the error callback will not be - * called for such responses. - * - * ## Writing Unit Tests that use $http - * When unit testing (using {@link ngMock ngMock}), it is necessary to call - * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending - * request using trained responses. - * - * ``` - * $httpBackend.expectGET(...); - * $http.get(...); - * $httpBackend.flush(); - * ``` - * - * ## Shortcut methods - * - * Shortcut methods are also available. All shortcut methods require passing in the URL, and - * request data must be passed in for POST/PUT requests. - * - * ```js - * $http.get('/someUrl').success(successCallback); - * $http.post('/someUrl', data).success(successCallback); - * ``` - * - * Complete list of shortcut methods: - * - * - {@link ng.$http#get $http.get} - * - {@link ng.$http#head $http.head} - * - {@link ng.$http#post $http.post} - * - {@link ng.$http#put $http.put} - * - {@link ng.$http#delete $http.delete} - * - {@link ng.$http#jsonp $http.jsonp} - * - {@link ng.$http#patch $http.patch} - * - * - * ## Setting HTTP Headers - * - * The $http service will automatically add certain HTTP headers to all requests. These defaults - * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration - * object, which currently contains this default configuration: - * - * - `$httpProvider.defaults.headers.common` (headers that are common for all requests): - * - `Accept: application/json, text/plain, * / *` - * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests) - * - `Content-Type: application/json` - * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests) - * - `Content-Type: application/json` - * - * To add or overwrite these defaults, simply add or remove a property from these configuration - * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object - * with the lowercased HTTP method name as the key, e.g. - * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }. - * - * The defaults can also be set at runtime via the `$http.defaults` object in the same - * fashion. For example: - * - * ``` - * module.run(function($http) { - * $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w' - * }); - * ``` - * - * In addition, you can supply a `headers` property in the config object passed when - * calling `$http(config)`, which overrides the defaults without changing them globally. - * - * - * ## Transforming Requests and Responses - * - * Both requests and responses can be transformed using transformation functions: `transformRequest` - * and `transformResponse`. These properties can be a single function that returns - * the transformed value (`{function(data, headersGetter)`) or an array of such transformation functions, - * which allows you to `push` or `unshift` a new transformation function into the transformation chain. - * - * ### Default Transformations - * - * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and - * `defaults.transformResponse` properties. If a request does not provide its own transformations - * then these will be applied. - * - * You can augment or replace the default transformations by modifying these properties by adding to or - * replacing the array. - * - * Angular provides the following default transformations: - * - * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`): - * - * - If the `data` property of the request configuration object contains an object, serialize it - * into JSON format. - * - * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`): - * - * - If XSRF prefix is detected, strip it (see Security Considerations section below). - * - If JSON response is detected, deserialize it using a JSON parser. - * - * - * ### Overriding the Default Transformations Per Request - * - * If you wish override the request/response transformations only for a single request then provide - * `transformRequest` and/or `transformResponse` properties on the configuration object passed - * into `$http`. - * - * Note that if you provide these properties on the config object the default transformations will be - * overwritten. If you wish to augment the default transformations then you must include them in your - * local transformation array. - * - * The following code demonstrates adding a new response transformation to be run after the default response - * transformations have been run. - * - * ```js - * function appendTransform(defaults, transform) { - * - * // We can't guarantee that the default transformation is an array - * defaults = angular.isArray(defaults) ? defaults : [defaults]; - * - * // Append the new transformation to the defaults - * return defaults.concat(transform); - * } - * - * $http({ - * url: '...', - * method: 'GET', - * transformResponse: appendTransform($http.defaults.transformResponse, function(value) { - * return doTransform(value); - * }) - * }); - * ``` - * - * - * ## Caching - * - * To enable caching, set the request configuration `cache` property to `true` (to use default - * cache) or to a custom cache object (built with {@link ng.$cacheFactory `$cacheFactory`}). - * When the cache is enabled, `$http` stores the response from the server in the specified - * cache. The next time the same request is made, the response is served from the cache without - * sending a request to the server. - * - * Note that even if the response is served from cache, delivery of the data is asynchronous in - * the same way that real requests are. - * - * If there are multiple GET requests for the same URL that should be cached using the same - * cache, but the cache is not populated yet, only one request to the server will be made and - * the remaining requests will be fulfilled using the response from the first request. - * - * You can change the default cache to a new object (built with - * {@link ng.$cacheFactory `$cacheFactory`}) by updating the - * {@link ng.$http#defaults `$http.defaults.cache`} property. All requests who set - * their `cache` property to `true` will now use this cache object. - * - * If you set the default cache to `false` then only requests that specify their own custom - * cache object will be cached. - * - * ## Interceptors - * - * Before you start creating interceptors, be sure to understand the - * {@link ng.$q $q and deferred/promise APIs}. - * - * For purposes of global error handling, authentication, or any kind of synchronous or - * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be - * able to intercept requests before they are handed to the server and - * responses before they are handed over to the application code that - * initiated these requests. The interceptors leverage the {@link ng.$q - * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing. - * - * The interceptors are service factories that are registered with the `$httpProvider` by - * adding them to the `$httpProvider.interceptors` array. The factory is called and - * injected with dependencies (if specified) and returns the interceptor. - * - * There are two kinds of interceptors (and two kinds of rejection interceptors): - * - * * `request`: interceptors get called with a http `config` object. The function is free to - * modify the `config` object or create a new one. The function needs to return the `config` - * object directly, or a promise containing the `config` or a new `config` object. - * * `requestError`: interceptor gets called when a previous interceptor threw an error or - * resolved with a rejection. - * * `response`: interceptors get called with http `response` object. The function is free to - * modify the `response` object or create a new one. The function needs to return the `response` - * object directly, or as a promise containing the `response` or a new `response` object. - * * `responseError`: interceptor gets called when a previous interceptor threw an error or - * resolved with a rejection. - * - * - * ```js - * // register the interceptor as a service - * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) { - * return { - * // optional method - * 'request': function(config) { - * // do something on success - * return config; - * }, - * - * // optional method - * 'requestError': function(rejection) { - * // do something on error - * if (canRecover(rejection)) { - * return responseOrNewPromise - * } - * return $q.reject(rejection); - * }, - * - * - * - * // optional method - * 'response': function(response) { - * // do something on success - * return response; - * }, - * - * // optional method - * 'responseError': function(rejection) { - * // do something on error - * if (canRecover(rejection)) { - * return responseOrNewPromise - * } - * return $q.reject(rejection); - * } - * }; - * }); - * - * $httpProvider.interceptors.push('myHttpInterceptor'); - * - * - * // alternatively, register the interceptor via an anonymous factory - * $httpProvider.interceptors.push(function($q, dependency1, dependency2) { - * return { - * 'request': function(config) { - * // same as above - * }, - * - * 'response': function(response) { - * // same as above - * } - * }; - * }); - * ``` - * - * ## Security Considerations - * - * When designing web applications, consider security threats from: - * - * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx) - * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) - * - * Both server and the client must cooperate in order to eliminate these threats. Angular comes - * pre-configured with strategies that address these issues, but for this to work backend server - * cooperation is required. - * - * ### JSON Vulnerability Protection - * - * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx) - * allows third party website to turn your JSON resource URL into - * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To - * counter this your server can prefix all JSON requests with following string `")]}',\n"`. - * Angular will automatically strip the prefix before processing it as JSON. - * - * For example if your server needs to return: - * ```js - * ['one','two'] - * ``` - * - * which is vulnerable to attack, your server can return: - * ```js - * )]}', - * ['one','two'] - * ``` - * - * Angular will strip the prefix, before processing the JSON. - * - * - * ### Cross Site Request Forgery (XSRF) Protection - * - * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is a technique by which - * an unauthorized site can gain your user's private data. Angular provides a mechanism - * to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie - * (by default, `XSRF-TOKEN`) and sets it as an HTTP header (`X-XSRF-TOKEN`). Since only - * JavaScript that runs on your domain could read the cookie, your server can be assured that - * the XHR came from JavaScript running on your domain. The header will not be set for - * cross-domain requests. - * - * To take advantage of this, your server needs to set a token in a JavaScript readable session - * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the - * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure - * that only JavaScript running on your domain could have sent the request. The token must be - * unique for each user and must be verifiable by the server (to prevent the JavaScript from - * making up its own tokens). We recommend that the token is a digest of your site's - * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography)) - * for added security. - * - * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName - * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time, - * or the per-request config object. - * - * - * @param {object} config Object describing the request to be made and how it should be - * processed. The object has following properties: - * - * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc) - * - **url** – `{string}` – Absolute or relative URL of the resource that is being requested. - * - **params** – `{Object.}` – Map of strings or objects which will be turned - * to `?key1=value1&key2=value2` after the url. If the value is not a string, it will be - * JSONified. - * - **data** – `{string|Object}` – Data to be sent as the request message data. - * - **headers** – `{Object}` – Map of strings or functions which return strings representing - * HTTP headers to send to the server. If the return value of a function is null, the - * header will not be sent. - * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token. - * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token. - * - **transformRequest** – - * `{function(data, headersGetter)|Array.}` – - * transform function or an array of such functions. The transform function takes the http - * request body and headers and returns its transformed (typically serialized) version. - * See {@link #overriding-the-default-transformations-per-request Overriding the Default Transformations} - * - **transformResponse** – - * `{function(data, headersGetter)|Array.}` – - * transform function or an array of such functions. The transform function takes the http - * response body and headers and returns its transformed (typically deserialized) version. - * See {@link #overriding-the-default-transformations-per-request Overriding the Default Transformations} - * - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the - * GET request, otherwise if a cache instance built with - * {@link ng.$cacheFactory $cacheFactory}, this cache will be used for - * caching. - * - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} - * that should abort the request when resolved. - * - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the - * XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials) - * for more information. - * - **responseType** - `{string}` - see - * [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType). - * - * @returns {HttpPromise} Returns a {@link ng.$q promise} object with the - * standard `then` method and two http specific methods: `success` and `error`. The `then` - * method takes two arguments a success and an error callback which will be called with a - * response object. The `success` and `error` methods take a single argument - a function that - * will be called when the request succeeds or fails respectively. The arguments passed into - * these functions are destructured representation of the response object passed into the - * `then` method. The response object has these properties: - * - * - **data** – `{string|Object}` – The response body transformed with the transform - * functions. - * - **status** – `{number}` – HTTP status code of the response. - * - **headers** – `{function([headerName])}` – Header getter function. - * - **config** – `{Object}` – The configuration object that was used to generate the request. - * - **statusText** – `{string}` – HTTP status text of the response. - * - * @property {Array.} pendingRequests Array of config objects for currently pending - * requests. This is primarily meant to be used for debugging purposes. - * - * - * @example - - -
- - -
- - - -
http status code: {{status}}
-
http response data: {{data}}
-
-
- - angular.module('httpExample', []) - .controller('FetchController', ['$scope', '$http', '$templateCache', - function($scope, $http, $templateCache) { - $scope.method = 'GET'; - $scope.url = 'http-hello.html'; - - $scope.fetch = function() { - $scope.code = null; - $scope.response = null; - - $http({method: $scope.method, url: $scope.url, cache: $templateCache}). - success(function(data, status) { - $scope.status = status; - $scope.data = data; - }). - error(function(data, status) { - $scope.data = data || "Request failed"; - $scope.status = status; - }); - }; - - $scope.updateModel = function(method, url) { - $scope.method = method; - $scope.url = url; - }; - }]); - - - Hello, $http! - - - var status = element(by.binding('status')); - var data = element(by.binding('data')); - var fetchBtn = element(by.id('fetchbtn')); - var sampleGetBtn = element(by.id('samplegetbtn')); - var sampleJsonpBtn = element(by.id('samplejsonpbtn')); - var invalidJsonpBtn = element(by.id('invalidjsonpbtn')); - - it('should make an xhr GET request', function() { - sampleGetBtn.click(); - fetchBtn.click(); - expect(status.getText()).toMatch('200'); - expect(data.getText()).toMatch(/Hello, \$http!/); - }); - -// Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185 -// it('should make a JSONP request to angularjs.org', function() { -// sampleJsonpBtn.click(); -// fetchBtn.click(); -// expect(status.getText()).toMatch('200'); -// expect(data.getText()).toMatch(/Super Hero!/); -// }); - - it('should make JSONP request to invalid URL and invoke the error handler', - function() { - invalidJsonpBtn.click(); - fetchBtn.click(); - expect(status.getText()).toMatch('0'); - expect(data.getText()).toMatch('Request failed'); - }); - -
- */ - function $http(requestConfig) { - var config = { - method: 'get', - transformRequest: defaults.transformRequest, - transformResponse: defaults.transformResponse - }; - var headers = mergeHeaders(requestConfig); - - extend(config, requestConfig); - config.headers = headers; - config.method = uppercase(config.method); - - var serverRequest = function(config) { - headers = config.headers; - var reqData = transformData(config.data, headersGetter(headers), config.transformRequest); - - // strip content-type if data is undefined - if (isUndefined(reqData)) { - forEach(headers, function(value, header) { - if (lowercase(header) === 'content-type') { - delete headers[header]; - } - }); - } - - if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) { - config.withCredentials = defaults.withCredentials; - } - - // send request - return sendReq(config, reqData, headers).then(transformResponse, transformResponse); - }; - - var chain = [serverRequest, undefined]; - var promise = $q.when(config); - - // apply interceptors - forEach(reversedInterceptors, function(interceptor) { - if (interceptor.request || interceptor.requestError) { - chain.unshift(interceptor.request, interceptor.requestError); - } - if (interceptor.response || interceptor.responseError) { - chain.push(interceptor.response, interceptor.responseError); - } - }); - - while (chain.length) { - var thenFn = chain.shift(); - var rejectFn = chain.shift(); - - promise = promise.then(thenFn, rejectFn); - } - - promise.success = function(fn) { - promise.then(function(response) { - fn(response.data, response.status, response.headers, config); - }); - return promise; - }; - - promise.error = function(fn) { - promise.then(null, function(response) { - fn(response.data, response.status, response.headers, config); - }); - return promise; - }; - - return promise; - - function transformResponse(response) { - // make a copy since the response must be cacheable - var resp = extend({}, response); - if (!response.data) { - resp.data = response.data; - } else { - resp.data = transformData(response.data, response.headers, config.transformResponse); - } - return (isSuccess(response.status)) - ? resp - : $q.reject(resp); - } - - function mergeHeaders(config) { - var defHeaders = defaults.headers, - reqHeaders = extend({}, config.headers), - defHeaderName, lowercaseDefHeaderName, reqHeaderName; - - defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]); - - // using for-in instead of forEach to avoid unecessary iteration after header has been found - defaultHeadersIteration: - for (defHeaderName in defHeaders) { - lowercaseDefHeaderName = lowercase(defHeaderName); - - for (reqHeaderName in reqHeaders) { - if (lowercase(reqHeaderName) === lowercaseDefHeaderName) { - continue defaultHeadersIteration; - } - } - - reqHeaders[defHeaderName] = defHeaders[defHeaderName]; - } - - // execute if header value is a function for merged headers - execHeaders(reqHeaders); - return reqHeaders; - - function execHeaders(headers) { - var headerContent; - - forEach(headers, function(headerFn, header) { - if (isFunction(headerFn)) { - headerContent = headerFn(); - if (headerContent != null) { - headers[header] = headerContent; - } else { - delete headers[header]; - } - } - }); - } - } - } - - $http.pendingRequests = []; - - /** - * @ngdoc method - * @name $http#get - * - * @description - * Shortcut method to perform `GET` request. - * - * @param {string} url Relative or absolute URL specifying the destination of the request - * @param {Object=} config Optional configuration object - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#delete - * - * @description - * Shortcut method to perform `DELETE` request. - * - * @param {string} url Relative or absolute URL specifying the destination of the request - * @param {Object=} config Optional configuration object - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#head - * - * @description - * Shortcut method to perform `HEAD` request. - * - * @param {string} url Relative or absolute URL specifying the destination of the request - * @param {Object=} config Optional configuration object - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#jsonp - * - * @description - * Shortcut method to perform `JSONP` request. - * - * @param {string} url Relative or absolute URL specifying the destination of the request. - * The name of the callback should be the string `JSON_CALLBACK`. - * @param {Object=} config Optional configuration object - * @returns {HttpPromise} Future object - */ - createShortMethods('get', 'delete', 'head', 'jsonp'); - - /** - * @ngdoc method - * @name $http#post - * - * @description - * Shortcut method to perform `POST` request. - * - * @param {string} url Relative or absolute URL specifying the destination of the request - * @param {*} data Request content - * @param {Object=} config Optional configuration object - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#put - * - * @description - * Shortcut method to perform `PUT` request. - * - * @param {string} url Relative or absolute URL specifying the destination of the request - * @param {*} data Request content - * @param {Object=} config Optional configuration object - * @returns {HttpPromise} Future object - */ - - /** - * @ngdoc method - * @name $http#patch - * - * @description - * Shortcut method to perform `PATCH` request. - * - * @param {string} url Relative or absolute URL specifying the destination of the request - * @param {*} data Request content - * @param {Object=} config Optional configuration object - * @returns {HttpPromise} Future object - */ - createShortMethodsWithData('post', 'put', 'patch'); - - /** - * @ngdoc property - * @name $http#defaults - * - * @description - * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of - * default headers, withCredentials as well as request and response transformations. - * - * See "Setting HTTP Headers" and "Transforming Requests and Responses" sections above. - */ - $http.defaults = defaults; - - - return $http; - - - function createShortMethods(names) { - forEach(arguments, function(name) { - $http[name] = function(url, config) { - return $http(extend(config || {}, { - method: name, - url: url - })); - }; - }); - } - - - function createShortMethodsWithData(name) { - forEach(arguments, function(name) { - $http[name] = function(url, data, config) { - return $http(extend(config || {}, { - method: name, - url: url, - data: data - })); - }; - }); - } - - - /** - * Makes the request. - * - * !!! ACCESSES CLOSURE VARS: - * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests - */ - function sendReq(config, reqData, reqHeaders) { - var deferred = $q.defer(), - promise = deferred.promise, - cache, - cachedResp, - url = buildUrl(config.url, config.params); - - $http.pendingRequests.push(config); - promise.then(removePendingReq, removePendingReq); - - - if ((config.cache || defaults.cache) && config.cache !== false && - (config.method === 'GET' || config.method === 'JSONP')) { - cache = isObject(config.cache) ? config.cache - : isObject(defaults.cache) ? defaults.cache - : defaultCache; - } - - if (cache) { - cachedResp = cache.get(url); - if (isDefined(cachedResp)) { - if (isPromiseLike(cachedResp)) { - // cached request has already been sent, but there is no response yet - cachedResp.then(removePendingReq, removePendingReq); - return cachedResp; - } else { - // serving from cache - if (isArray(cachedResp)) { - resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]); - } else { - resolvePromise(cachedResp, 200, {}, 'OK'); - } - } - } else { - // put the promise for the non-transformed response into cache as a placeholder - cache.put(url, promise); - } - } - - - // if we won't have the response in cache, set the xsrf headers and - // send the request to the backend - if (isUndefined(cachedResp)) { - var xsrfValue = urlIsSameOrigin(config.url) - ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName] - : undefined; - if (xsrfValue) { - reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue; - } - - $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, - config.withCredentials, config.responseType); - } - - return promise; - - - /** - * Callback registered to $httpBackend(): - * - caches the response if desired - * - resolves the raw $http promise - * - calls $apply - */ - function done(status, response, headersString, statusText) { - if (cache) { - if (isSuccess(status)) { - cache.put(url, [status, response, parseHeaders(headersString), statusText]); - } else { - // remove promise from the cache - cache.remove(url); - } - } - - function resolveHttpPromise() { - resolvePromise(response, status, headersString, statusText); - } - - if (useApplyAsync) { - $rootScope.$applyAsync(resolveHttpPromise); - } else { - resolveHttpPromise(); - if (!$rootScope.$$phase) $rootScope.$apply(); - } - } - - - /** - * Resolves the raw $http promise. - */ - function resolvePromise(response, status, headers, statusText) { - // normalize internal statuses to 0 - status = Math.max(status, 0); - - (isSuccess(status) ? deferred.resolve : deferred.reject)({ - data: response, - status: status, - headers: headersGetter(headers), - config: config, - statusText: statusText - }); - } - - - function removePendingReq() { - var idx = $http.pendingRequests.indexOf(config); - if (idx !== -1) $http.pendingRequests.splice(idx, 1); - } - } - - - function buildUrl(url, params) { - if (!params) return url; - var parts = []; - forEachSorted(params, function(value, key) { - if (value === null || isUndefined(value)) return; - if (!isArray(value)) value = [value]; - - forEach(value, function(v) { - if (isObject(v)) { - if (isDate(v)) { - v = v.toISOString(); - } else { - v = toJson(v); - } - } - parts.push(encodeUriQuery(key) + '=' + - encodeUriQuery(v)); - }); - }); - if (parts.length > 0) { - url += ((url.indexOf('?') == -1) ? '?' : '&') + parts.join('&'); - } - return url; - } - }]; -} - -function createXhr() { - return new window.XMLHttpRequest(); -} - -/** - * @ngdoc service - * @name $httpBackend - * @requires $window - * @requires $document - * - * @description - * HTTP backend used by the {@link ng.$http service} that delegates to - * XMLHttpRequest object or JSONP and deals with browser incompatibilities. - * - * You should never need to use this service directly, instead use the higher-level abstractions: - * {@link ng.$http $http} or {@link ngResource.$resource $resource}. - * - * During testing this implementation is swapped with {@link ngMock.$httpBackend mock - * $httpBackend} which can be trained with responses. - */ -function $HttpBackendProvider() { - this.$get = ['$browser', '$window', '$document', function($browser, $window, $document) { - return createHttpBackend($browser, createXhr, $browser.defer, $window.angular.callbacks, $document[0]); - }]; -} - -function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) { - // TODO(vojta): fix the signature - return function(method, url, post, callback, headers, timeout, withCredentials, responseType) { - $browser.$$incOutstandingRequestCount(); - url = url || $browser.url(); - - if (lowercase(method) == 'jsonp') { - var callbackId = '_' + (callbacks.counter++).toString(36); - callbacks[callbackId] = function(data) { - callbacks[callbackId].data = data; - callbacks[callbackId].called = true; - }; - - var jsonpDone = jsonpReq(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId), - callbackId, function(status, text) { - completeRequest(callback, status, callbacks[callbackId].data, "", text); - callbacks[callbackId] = noop; - }); - } else { - - var xhr = createXhr(); - - xhr.open(method, url, true); - forEach(headers, function(value, key) { - if (isDefined(value)) { - xhr.setRequestHeader(key, value); - } - }); - - xhr.onload = function requestLoaded() { - var statusText = xhr.statusText || ''; - - // responseText is the old-school way of retrieving response (supported by IE8 & 9) - // response/responseType properties were introduced in XHR Level2 spec (supported by IE10) - var response = ('response' in xhr) ? xhr.response : xhr.responseText; - - // normalize IE9 bug (http://bugs.jquery.com/ticket/1450) - var status = xhr.status === 1223 ? 204 : xhr.status; - - // fix status code when it is 0 (0 status is undocumented). - // Occurs when accessing file resources or on Android 4.1 stock browser - // while retrieving files from application cache. - if (status === 0) { - status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0; - } - - completeRequest(callback, - status, - response, - xhr.getAllResponseHeaders(), - statusText); - }; - - var requestError = function() { - // The response is always empty - // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error - completeRequest(callback, -1, null, null, ''); - }; - - xhr.onerror = requestError; - xhr.onabort = requestError; - - if (withCredentials) { - xhr.withCredentials = true; - } - - if (responseType) { - try { - xhr.responseType = responseType; - } catch (e) { - // WebKit added support for the json responseType value on 09/03/2013 - // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are - // known to throw when setting the value "json" as the response type. Other older - // browsers implementing the responseType - // - // The json response type can be ignored if not supported, because JSON payloads are - // parsed on the client-side regardless. - if (responseType !== 'json') { - throw e; - } - } - } - - xhr.send(post || null); - } - - if (timeout > 0) { - var timeoutId = $browserDefer(timeoutRequest, timeout); - } else if (isPromiseLike(timeout)) { - timeout.then(timeoutRequest); - } - - - function timeoutRequest() { - jsonpDone && jsonpDone(); - xhr && xhr.abort(); - } - - function completeRequest(callback, status, response, headersString, statusText) { - // cancel timeout and subsequent timeout promise resolution - timeoutId && $browserDefer.cancel(timeoutId); - jsonpDone = xhr = null; - - callback(status, response, headersString, statusText); - $browser.$$completeOutstandingRequest(noop); - } - }; - - function jsonpReq(url, callbackId, done) { - // we can't use jQuery/jqLite here because jQuery does crazy shit with script elements, e.g.: - // - fetches local scripts via XHR and evals them - // - adds and immediately removes script elements from the document - var script = rawDocument.createElement('script'), callback = null; - script.type = "text/javascript"; - script.src = url; - script.async = true; - - callback = function(event) { - removeEventListenerFn(script, "load", callback); - removeEventListenerFn(script, "error", callback); - rawDocument.body.removeChild(script); - script = null; - var status = -1; - var text = "unknown"; - - if (event) { - if (event.type === "load" && !callbacks[callbackId].called) { - event = { type: "error" }; - } - text = event.type; - status = event.type === "error" ? 404 : 200; - } - - if (done) { - done(status, text); - } - }; - - addEventListenerFn(script, "load", callback); - addEventListenerFn(script, "error", callback); - rawDocument.body.appendChild(script); - return callback; - } -} - -var $interpolateMinErr = minErr('$interpolate'); - -/** - * @ngdoc provider - * @name $interpolateProvider - * - * @description - * - * Used for configuring the interpolation markup. Defaults to `{{` and `}}`. - * - * @example - - - -
- //demo.label// -
-
- - it('should interpolate binding with custom symbols', function() { - expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.'); - }); - -
- */ -function $InterpolateProvider() { - var startSymbol = '{{'; - var endSymbol = '}}'; - - /** - * @ngdoc method - * @name $interpolateProvider#startSymbol - * @description - * Symbol to denote start of expression in the interpolated string. Defaults to `{{`. - * - * @param {string=} value new value to set the starting symbol to. - * @returns {string|self} Returns the symbol when used as getter and self if used as setter. - */ - this.startSymbol = function(value) { - if (value) { - startSymbol = value; - return this; - } else { - return startSymbol; - } - }; - - /** - * @ngdoc method - * @name $interpolateProvider#endSymbol - * @description - * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. - * - * @param {string=} value new value to set the ending symbol to. - * @returns {string|self} Returns the symbol when used as getter and self if used as setter. - */ - this.endSymbol = function(value) { - if (value) { - endSymbol = value; - return this; - } else { - return endSymbol; - } - }; - - - this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) { - var startSymbolLength = startSymbol.length, - endSymbolLength = endSymbol.length, - escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'), - escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g'); - - function escape(ch) { - return '\\\\\\' + ch; - } - - /** - * @ngdoc service - * @name $interpolate - * @kind function - * - * @requires $parse - * @requires $sce - * - * @description - * - * Compiles a string with markup into an interpolation function. This service is used by the - * HTML {@link ng.$compile $compile} service for data binding. See - * {@link ng.$interpolateProvider $interpolateProvider} for configuring the - * interpolation markup. - * - * - * ```js - * var $interpolate = ...; // injected - * var exp = $interpolate('Hello {{name | uppercase}}!'); - * expect(exp({name:'Angular'}).toEqual('Hello ANGULAR!'); - * ``` - * - * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is - * `true`, the interpolation function will return `undefined` unless all embedded expressions - * evaluate to a value other than `undefined`. - * - * ```js - * var $interpolate = ...; // injected - * var context = {greeting: 'Hello', name: undefined }; - * - * // default "forgiving" mode - * var exp = $interpolate('{{greeting}} {{name}}!'); - * expect(exp(context)).toEqual('Hello !'); - * - * // "allOrNothing" mode - * exp = $interpolate('{{greeting}} {{name}}!', false, null, true); - * expect(exp(context)).toBeUndefined(); - * context.name = 'Angular'; - * expect(exp(context)).toEqual('Hello Angular!'); - * ``` - * - * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior. - * - * ####Escaped Interpolation - * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers - * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash). - * It will be rendered as a regular start/end marker, and will not be interpreted as an expression - * or binding. - * - * This enables web-servers to prevent script injection attacks and defacing attacks, to some - * degree, while also enabling code examples to work without relying on the - * {@link ng.directive:ngNonBindable ngNonBindable} directive. - * - * **For security purposes, it is strongly encouraged that web servers escape user-supplied data, - * replacing angle brackets (<, >) with &lt; and &gt; respectively, and replacing all - * interpolation start/end markers with their escaped counterparts.** - * - * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered - * output when the $interpolate service processes the text. So, for HTML elements interpolated - * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter - * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such, - * this is typically useful only when user-data is used in rendering a template from the server, or - * when otherwise untrusted data is used by a directive. - * - * - * - *
- *

{{apptitle}}: \{\{ username = "defaced value"; \}\} - *

- *

{{username}} attempts to inject code which will deface the - * application, but fails to accomplish their task, because the server has correctly - * escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash) - * characters.

- *

Instead, the result of the attempted script injection is visible, and can be removed - * from the database by an administrator.

- *
- *
- *
- * - * @param {string} text The text with markup to interpolate. - * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have - * embedded expression in order to return an interpolation function. Strings with no - * embedded expression will return null for the interpolation function. - * @param {string=} trustedContext when provided, the returned function passes the interpolated - * result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult, - * trustedContext)} before returning it. Refer to the {@link ng.$sce $sce} service that - * provides Strict Contextual Escaping for details. - * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined - * unless all embedded expressions evaluate to a value other than `undefined`. - * @returns {function(context)} an interpolation function which is used to compute the - * interpolated string. The function has these parameters: - * - * - `context`: evaluation context for all expressions embedded in the interpolated text - */ - function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) { - allOrNothing = !!allOrNothing; - var startIndex, - endIndex, - index = 0, - expressions = [], - parseFns = [], - textLength = text.length, - exp, - concat = [], - expressionPositions = []; - - while (index < textLength) { - if (((startIndex = text.indexOf(startSymbol, index)) != -1) && - ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1)) { - if (index !== startIndex) { - concat.push(unescapeText(text.substring(index, startIndex))); - } - exp = text.substring(startIndex + startSymbolLength, endIndex); - expressions.push(exp); - parseFns.push($parse(exp, parseStringifyInterceptor)); - index = endIndex + endSymbolLength; - expressionPositions.push(concat.length); - concat.push(''); - } else { - // we did not find an interpolation, so we have to add the remainder to the separators array - if (index !== textLength) { - concat.push(unescapeText(text.substring(index))); - } - break; - } - } - - // Concatenating expressions makes it hard to reason about whether some combination of - // concatenated values are unsafe to use and could easily lead to XSS. By requiring that a - // single expression be used for iframe[src], object[src], etc., we ensure that the value - // that's used is assigned or constructed by some JS code somewhere that is more testable or - // make it obvious that you bound the value to some user controlled value. This helps reduce - // the load when auditing for XSS issues. - if (trustedContext && concat.length > 1) { - throw $interpolateMinErr('noconcat', - "Error while interpolating: {0}\nStrict Contextual Escaping disallows " + - "interpolations that concatenate multiple expressions when a trusted value is " + - "required. See http://docs.angularjs.org/api/ng.$sce", text); - } - - if (!mustHaveExpression || expressions.length) { - var compute = function(values) { - for (var i = 0, ii = expressions.length; i < ii; i++) { - if (allOrNothing && isUndefined(values[i])) return; - concat[expressionPositions[i]] = values[i]; - } - return concat.join(''); - }; - - var getValue = function(value) { - return trustedContext ? - $sce.getTrusted(trustedContext, value) : - $sce.valueOf(value); - }; - - var stringify = function(value) { - if (value == null) { // null || undefined - return ''; - } - switch (typeof value) { - case 'string': - break; - case 'number': - value = '' + value; - break; - default: - value = toJson(value); - } - - return value; - }; - - return extend(function interpolationFn(context) { - var i = 0; - var ii = expressions.length; - var values = new Array(ii); - - try { - for (; i < ii; i++) { - values[i] = parseFns[i](context); - } - - return compute(values); - } catch (err) { - var newErr = $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, - err.toString()); - $exceptionHandler(newErr); - } - - }, { - // all of these properties are undocumented for now - exp: text, //just for compatibility with regular watchers created via $watch - expressions: expressions, - $$watchDelegate: function(scope, listener, objectEquality) { - var lastValue; - return scope.$watchGroup(parseFns, function interpolateFnWatcher(values, oldValues) { - var currValue = compute(values); - if (isFunction(listener)) { - listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope); - } - lastValue = currValue; - }, objectEquality); - } - }); - } - - function unescapeText(text) { - return text.replace(escapedStartRegexp, startSymbol). - replace(escapedEndRegexp, endSymbol); - } - - function parseStringifyInterceptor(value) { - try { - value = getValue(value); - return allOrNothing && !isDefined(value) ? value : stringify(value); - } catch (err) { - var newErr = $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, - err.toString()); - $exceptionHandler(newErr); - } - } - } - - - /** - * @ngdoc method - * @name $interpolate#startSymbol - * @description - * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`. - * - * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change - * the symbol. - * - * @returns {string} start symbol. - */ - $interpolate.startSymbol = function() { - return startSymbol; - }; - - - /** - * @ngdoc method - * @name $interpolate#endSymbol - * @description - * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. - * - * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change - * the symbol. - * - * @returns {string} end symbol. - */ - $interpolate.endSymbol = function() { - return endSymbol; - }; - - return $interpolate; - }]; -} - -function $IntervalProvider() { - this.$get = ['$rootScope', '$window', '$q', '$$q', - function($rootScope, $window, $q, $$q) { - var intervals = {}; - - - /** - * @ngdoc service - * @name $interval - * - * @description - * Angular's wrapper for `window.setInterval`. The `fn` function is executed every `delay` - * milliseconds. - * - * The return value of registering an interval function is a promise. This promise will be - * notified upon each tick of the interval, and will be resolved after `count` iterations, or - * run indefinitely if `count` is not defined. The value of the notification will be the - * number of iterations that have run. - * To cancel an interval, call `$interval.cancel(promise)`. - * - * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to - * move forward by `millis` milliseconds and trigger any functions scheduled to run in that - * time. - * - *
- * **Note**: Intervals created by this service must be explicitly destroyed when you are finished - * with them. In particular they are not automatically destroyed when a controller's scope or a - * directive's element are destroyed. - * You should take this into consideration and make sure to always cancel the interval at the - * appropriate moment. See the example below for more details on how and when to do this. - *
- * - * @param {function()} fn A function that should be called repeatedly. - * @param {number} delay Number of milliseconds between each function call. - * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat - * indefinitely. - * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise - * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. - * @returns {promise} A promise which will be notified on each iteration. - * - * @example - * - * - * - * - *
- *
- * Date format:
- * Current time is: - *
- * Blood 1 : {{blood_1}} - * Blood 2 : {{blood_2}} - * - * - * - *
- *
- * - *
- *
- */ - function interval(fn, delay, count, invokeApply) { - var setInterval = $window.setInterval, - clearInterval = $window.clearInterval, - iteration = 0, - skipApply = (isDefined(invokeApply) && !invokeApply), - deferred = (skipApply ? $$q : $q).defer(), - promise = deferred.promise; - - count = isDefined(count) ? count : 0; - - promise.then(null, null, fn); - - promise.$$intervalId = setInterval(function tick() { - deferred.notify(iteration++); - - if (count > 0 && iteration >= count) { - deferred.resolve(iteration); - clearInterval(promise.$$intervalId); - delete intervals[promise.$$intervalId]; - } - - if (!skipApply) $rootScope.$apply(); - - }, delay); - - intervals[promise.$$intervalId] = deferred; - - return promise; - } - - - /** - * @ngdoc method - * @name $interval#cancel - * - * @description - * Cancels a task associated with the `promise`. - * - * @param {promise} promise returned by the `$interval` function. - * @returns {boolean} Returns `true` if the task was successfully canceled. - */ - interval.cancel = function(promise) { - if (promise && promise.$$intervalId in intervals) { - intervals[promise.$$intervalId].reject('canceled'); - $window.clearInterval(promise.$$intervalId); - delete intervals[promise.$$intervalId]; - return true; - } - return false; - }; - - return interval; - }]; -} - -/** - * @ngdoc service - * @name $locale - * - * @description - * $locale service provides localization rules for various Angular components. As of right now the - * only public api is: - * - * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`) - */ -function $LocaleProvider() { - this.$get = function() { - return { - id: 'en-us', - - NUMBER_FORMATS: { - DECIMAL_SEP: '.', - GROUP_SEP: ',', - PATTERNS: [ - { // Decimal Pattern - minInt: 1, - minFrac: 0, - maxFrac: 3, - posPre: '', - posSuf: '', - negPre: '-', - negSuf: '', - gSize: 3, - lgSize: 3 - },{ //Currency Pattern - minInt: 1, - minFrac: 2, - maxFrac: 2, - posPre: '\u00A4', - posSuf: '', - negPre: '(\u00A4', - negSuf: ')', - gSize: 3, - lgSize: 3 - } - ], - CURRENCY_SYM: '$' - }, - - DATETIME_FORMATS: { - MONTH: - 'January,February,March,April,May,June,July,August,September,October,November,December' - .split(','), - SHORTMONTH: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','), - DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','), - SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','), - AMPMS: ['AM','PM'], - medium: 'MMM d, y h:mm:ss a', - 'short': 'M/d/yy h:mm a', - fullDate: 'EEEE, MMMM d, y', - longDate: 'MMMM d, y', - mediumDate: 'MMM d, y', - shortDate: 'M/d/yy', - mediumTime: 'h:mm:ss a', - shortTime: 'h:mm a' - }, - - pluralCat: function(num) { - if (num === 1) { - return 'one'; - } - return 'other'; - } - }; - }; -} - -var PATH_MATCH = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/, - DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21}; -var $locationMinErr = minErr('$location'); - - -/** - * Encode path using encodeUriSegment, ignoring forward slashes - * - * @param {string} path Path to encode - * @returns {string} - */ -function encodePath(path) { - var segments = path.split('/'), - i = segments.length; - - while (i--) { - segments[i] = encodeUriSegment(segments[i]); - } - - return segments.join('/'); -} - -function parseAbsoluteUrl(absoluteUrl, locationObj) { - var parsedUrl = urlResolve(absoluteUrl); - - locationObj.$$protocol = parsedUrl.protocol; - locationObj.$$host = parsedUrl.hostname; - locationObj.$$port = int(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null; -} - - -function parseAppUrl(relativeUrl, locationObj) { - var prefixed = (relativeUrl.charAt(0) !== '/'); - if (prefixed) { - relativeUrl = '/' + relativeUrl; - } - var match = urlResolve(relativeUrl); - locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ? - match.pathname.substring(1) : match.pathname); - locationObj.$$search = parseKeyValue(match.search); - locationObj.$$hash = decodeURIComponent(match.hash); - - // make sure path starts with '/'; - if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') { - locationObj.$$path = '/' + locationObj.$$path; - } -} - - -/** - * - * @param {string} begin - * @param {string} whole - * @returns {string} returns text from whole after begin or undefined if it does not begin with - * expected string. - */ -function beginsWith(begin, whole) { - if (whole.indexOf(begin) === 0) { - return whole.substr(begin.length); - } -} - - -function stripHash(url) { - var index = url.indexOf('#'); - return index == -1 ? url : url.substr(0, index); -} - - -function stripFile(url) { - return url.substr(0, stripHash(url).lastIndexOf('/') + 1); -} - -/* return the server only (scheme://host:port) */ -function serverBase(url) { - return url.substring(0, url.indexOf('/', url.indexOf('//') + 2)); -} - - -/** - * LocationHtml5Url represents an url - * This object is exposed as $location service when HTML5 mode is enabled and supported - * - * @constructor - * @param {string} appBase application base URL - * @param {string} basePrefix url path prefix - */ -function LocationHtml5Url(appBase, basePrefix) { - this.$$html5 = true; - basePrefix = basePrefix || ''; - var appBaseNoFile = stripFile(appBase); - parseAbsoluteUrl(appBase, this); - - - /** - * Parse given html5 (regular) url string into properties - * @param {string} url HTML5 url - * @private - */ - this.$$parse = function(url) { - var pathUrl = beginsWith(appBaseNoFile, url); - if (!isString(pathUrl)) { - throw $locationMinErr('ipthprfx', 'Invalid url "{0}", missing path prefix "{1}".', url, - appBaseNoFile); - } - - parseAppUrl(pathUrl, this); - - if (!this.$$path) { - this.$$path = '/'; - } - - this.$$compose(); - }; - - /** - * Compose url and update `absUrl` property - * @private - */ - this.$$compose = function() { - var search = toKeyValue(this.$$search), - hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; - - this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; - this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/' - }; - - this.$$parseLinkUrl = function(url, relHref) { - if (relHref && relHref[0] === '#') { - // special case for links to hash fragments: - // keep the old url and only replace the hash fragment - this.hash(relHref.slice(1)); - return true; - } - var appUrl, prevAppUrl; - var rewrittenUrl; - - if ((appUrl = beginsWith(appBase, url)) !== undefined) { - prevAppUrl = appUrl; - if ((appUrl = beginsWith(basePrefix, appUrl)) !== undefined) { - rewrittenUrl = appBaseNoFile + (beginsWith('/', appUrl) || appUrl); - } else { - rewrittenUrl = appBase + prevAppUrl; - } - } else if ((appUrl = beginsWith(appBaseNoFile, url)) !== undefined) { - rewrittenUrl = appBaseNoFile + appUrl; - } else if (appBaseNoFile == url + '/') { - rewrittenUrl = appBaseNoFile; - } - if (rewrittenUrl) { - this.$$parse(rewrittenUrl); - } - return !!rewrittenUrl; - }; -} - - -/** - * LocationHashbangUrl represents url - * This object is exposed as $location service when developer doesn't opt into html5 mode. - * It also serves as the base class for html5 mode fallback on legacy browsers. - * - * @constructor - * @param {string} appBase application base URL - * @param {string} hashPrefix hashbang prefix - */ -function LocationHashbangUrl(appBase, hashPrefix) { - var appBaseNoFile = stripFile(appBase); - - parseAbsoluteUrl(appBase, this); - - - /** - * Parse given hashbang url into properties - * @param {string} url Hashbang url - * @private - */ - this.$$parse = function(url) { - var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url); - var withoutHashUrl = withoutBaseUrl.charAt(0) == '#' - ? beginsWith(hashPrefix, withoutBaseUrl) - : (this.$$html5) - ? withoutBaseUrl - : ''; - - if (!isString(withoutHashUrl)) { - throw $locationMinErr('ihshprfx', 'Invalid url "{0}", missing hash prefix "{1}".', url, - hashPrefix); - } - parseAppUrl(withoutHashUrl, this); - - this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase); - - this.$$compose(); - - /* - * In Windows, on an anchor node on documents loaded from - * the filesystem, the browser will return a pathname - * prefixed with the drive name ('/C:/path') when a - * pathname without a drive is set: - * * a.setAttribute('href', '/foo') - * * a.pathname === '/C:/foo' //true - * - * Inside of Angular, we're always using pathnames that - * do not include drive names for routing. - */ - function removeWindowsDriveName(path, url, base) { - /* - Matches paths for file protocol on windows, - such as /C:/foo/bar, and captures only /foo/bar. - */ - var windowsFilePathExp = /^\/[A-Z]:(\/.*)/; - - var firstPathSegmentMatch; - - //Get the relative path from the input URL. - if (url.indexOf(base) === 0) { - url = url.replace(base, ''); - } - - // The input URL intentionally contains a first path segment that ends with a colon. - if (windowsFilePathExp.exec(url)) { - return path; - } - - firstPathSegmentMatch = windowsFilePathExp.exec(path); - return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path; - } - }; - - /** - * Compose hashbang url and update `absUrl` property - * @private - */ - this.$$compose = function() { - var search = toKeyValue(this.$$search), - hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; - - this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; - this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : ''); - }; - - this.$$parseLinkUrl = function(url, relHref) { - if (stripHash(appBase) == stripHash(url)) { - this.$$parse(url); - return true; - } - return false; - }; -} - - -/** - * LocationHashbangUrl represents url - * This object is exposed as $location service when html5 history api is enabled but the browser - * does not support it. - * - * @constructor - * @param {string} appBase application base URL - * @param {string} hashPrefix hashbang prefix - */ -function LocationHashbangInHtml5Url(appBase, hashPrefix) { - this.$$html5 = true; - LocationHashbangUrl.apply(this, arguments); - - var appBaseNoFile = stripFile(appBase); - - this.$$parseLinkUrl = function(url, relHref) { - if (relHref && relHref[0] === '#') { - // special case for links to hash fragments: - // keep the old url and only replace the hash fragment - this.hash(relHref.slice(1)); - return true; - } - - var rewrittenUrl; - var appUrl; - - if (appBase == stripHash(url)) { - rewrittenUrl = url; - } else if ((appUrl = beginsWith(appBaseNoFile, url))) { - rewrittenUrl = appBase + hashPrefix + appUrl; - } else if (appBaseNoFile === url + '/') { - rewrittenUrl = appBaseNoFile; - } - if (rewrittenUrl) { - this.$$parse(rewrittenUrl); - } - return !!rewrittenUrl; - }; - - this.$$compose = function() { - var search = toKeyValue(this.$$search), - hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; - - this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; - // include hashPrefix in $$absUrl when $$url is empty so IE8 & 9 do not reload page because of removal of '#' - this.$$absUrl = appBase + hashPrefix + this.$$url; - }; - -} - - -var locationPrototype = { - - /** - * Are we in html5 mode? - * @private - */ - $$html5: false, - - /** - * Has any change been replacing? - * @private - */ - $$replace: false, - - /** - * @ngdoc method - * @name $location#absUrl - * - * @description - * This method is getter only. - * - * Return full url representation with all segments encoded according to rules specified in - * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt). - * - * @return {string} full url - */ - absUrl: locationGetter('$$absUrl'), - - /** - * @ngdoc method - * @name $location#url - * - * @description - * This method is getter / setter. - * - * Return url (e.g. `/path?a=b#hash`) when called without any parameter. - * - * Change path, search and hash, when called with parameter and return `$location`. - * - * @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`) - * @return {string} url - */ - url: function(url) { - if (isUndefined(url)) - return this.$$url; - - var match = PATH_MATCH.exec(url); - if (match[1]) this.path(decodeURIComponent(match[1])); - if (match[2] || match[1]) this.search(match[3] || ''); - this.hash(match[5] || ''); - - return this; - }, - - /** - * @ngdoc method - * @name $location#protocol - * - * @description - * This method is getter only. - * - * Return protocol of current url. - * - * @return {string} protocol of current url - */ - protocol: locationGetter('$$protocol'), - - /** - * @ngdoc method - * @name $location#host - * - * @description - * This method is getter only. - * - * Return host of current url. - * - * @return {string} host of current url. - */ - host: locationGetter('$$host'), - - /** - * @ngdoc method - * @name $location#port - * - * @description - * This method is getter only. - * - * Return port of current url. - * - * @return {Number} port - */ - port: locationGetter('$$port'), - - /** - * @ngdoc method - * @name $location#path - * - * @description - * This method is getter / setter. - * - * Return path of current url when called without any parameter. - * - * Change path when called with parameter and return `$location`. - * - * Note: Path should always begin with forward slash (/), this method will add the forward slash - * if it is missing. - * - * @param {(string|number)=} path New path - * @return {string} path - */ - path: locationGetterSetter('$$path', function(path) { - path = path !== null ? path.toString() : ''; - return path.charAt(0) == '/' ? path : '/' + path; - }), - - /** - * @ngdoc method - * @name $location#search - * - * @description - * This method is getter / setter. - * - * Return search part (as object) of current url when called without any parameter. - * - * Change search part when called with parameter and return `$location`. - * - * - * ```js - * // given url http://example.com/#/some/path?foo=bar&baz=xoxo - * var searchObject = $location.search(); - * // => {foo: 'bar', baz: 'xoxo'} - * - * - * // set foo to 'yipee' - * $location.search('foo', 'yipee'); - * // => $location - * ``` - * - * @param {string|Object.|Object.>} search New search params - string or - * hash object. - * - * When called with a single argument the method acts as a setter, setting the `search` component - * of `$location` to the specified value. - * - * If the argument is a hash object containing an array of values, these values will be encoded - * as duplicate search parameters in the url. - * - * @param {(string|Number|Array|boolean)=} paramValue If `search` is a string or number, then `paramValue` - * will override only a single search property. - * - * If `paramValue` is an array, it will override the property of the `search` component of - * `$location` specified via the first argument. - * - * If `paramValue` is `null`, the property specified via the first argument will be deleted. - * - * If `paramValue` is `true`, the property specified via the first argument will be added with no - * value nor trailing equal sign. - * - * @return {Object} If called with no arguments returns the parsed `search` object. If called with - * one or more arguments returns `$location` object itself. - */ - search: function(search, paramValue) { - switch (arguments.length) { - case 0: - return this.$$search; - case 1: - if (isString(search) || isNumber(search)) { - search = search.toString(); - this.$$search = parseKeyValue(search); - } else if (isObject(search)) { - search = copy(search, {}); - // remove object undefined or null properties - forEach(search, function(value, key) { - if (value == null) delete search[key]; - }); - - this.$$search = search; - } else { - throw $locationMinErr('isrcharg', - 'The first argument of the `$location#search()` call must be a string or an object.'); - } - break; - default: - if (isUndefined(paramValue) || paramValue === null) { - delete this.$$search[search]; - } else { - this.$$search[search] = paramValue; - } - } - - this.$$compose(); - return this; - }, - - /** - * @ngdoc method - * @name $location#hash - * - * @description - * This method is getter / setter. - * - * Return hash fragment when called without any parameter. - * - * Change hash fragment when called with parameter and return `$location`. - * - * @param {(string|number)=} hash New hash fragment - * @return {string} hash - */ - hash: locationGetterSetter('$$hash', function(hash) { - return hash !== null ? hash.toString() : ''; - }), - - /** - * @ngdoc method - * @name $location#replace - * - * @description - * If called, all changes to $location during current `$digest` will be replacing current history - * record, instead of adding new one. - */ - replace: function() { - this.$$replace = true; - return this; - } -}; - -forEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) { - Location.prototype = Object.create(locationPrototype); - - /** - * @ngdoc method - * @name $location#state - * - * @description - * This method is getter / setter. - * - * Return the history state object when called without any parameter. - * - * Change the history state object when called with one parameter and return `$location`. - * The state object is later passed to `pushState` or `replaceState`. - * - * NOTE: This method is supported only in HTML5 mode and only in browsers supporting - * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support - * older browsers (like IE9 or Android < 4.0), don't use this method. - * - * @param {object=} state State object for pushState or replaceState - * @return {object} state - */ - Location.prototype.state = function(state) { - if (!arguments.length) - return this.$$state; - - if (Location !== LocationHtml5Url || !this.$$html5) { - throw $locationMinErr('nostate', 'History API state support is available only ' + - 'in HTML5 mode and only in browsers supporting HTML5 History API'); - } - // The user might modify `stateObject` after invoking `$location.state(stateObject)` - // but we're changing the $$state reference to $browser.state() during the $digest - // so the modification window is narrow. - this.$$state = isUndefined(state) ? null : state; - - return this; - }; -}); - - -function locationGetter(property) { - return function() { - return this[property]; - }; -} - - -function locationGetterSetter(property, preprocess) { - return function(value) { - if (isUndefined(value)) - return this[property]; - - this[property] = preprocess(value); - this.$$compose(); - - return this; - }; -} - - -/** - * @ngdoc service - * @name $location - * - * @requires $rootElement - * - * @description - * The $location service parses the URL in the browser address bar (based on the - * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL - * available to your application. Changes to the URL in the address bar are reflected into - * $location service and changes to $location are reflected into the browser address bar. - * - * **The $location service:** - * - * - Exposes the current URL in the browser address bar, so you can - * - Watch and observe the URL. - * - Change the URL. - * - Synchronizes the URL with the browser when the user - * - Changes the address bar. - * - Clicks the back or forward button (or clicks a History link). - * - Clicks on a link. - * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash). - * - * For more information see {@link guide/$location Developer Guide: Using $location} - */ - -/** - * @ngdoc provider - * @name $locationProvider - * @description - * Use the `$locationProvider` to configure how the application deep linking paths are stored. - */ -function $LocationProvider() { - var hashPrefix = '', - html5Mode = { - enabled: false, - requireBase: true, - rewriteLinks: true - }; - - /** - * @ngdoc method - * @name $locationProvider#hashPrefix - * @description - * @param {string=} prefix Prefix for hash part (containing path and search) - * @returns {*} current value if used as getter or itself (chaining) if used as setter - */ - this.hashPrefix = function(prefix) { - if (isDefined(prefix)) { - hashPrefix = prefix; - return this; - } else { - return hashPrefix; - } - }; - - /** - * @ngdoc method - * @name $locationProvider#html5Mode - * @description - * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value. - * If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported - * properties: - * - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to - * change urls where supported. Will fall back to hash-prefixed paths in browsers that do not - * support `pushState`. - * - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies - * whether or not a tag is required to be present. If `enabled` and `requireBase` are - * true, and a base tag is not present, an error will be thrown when `$location` is injected. - * See the {@link guide/$location $location guide for more information} - * - **rewriteLinks** - `{boolean}` - (default: `true`) When html5Mode is enabled, - * enables/disables url rewriting for relative links. - * - * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter - */ - this.html5Mode = function(mode) { - if (isBoolean(mode)) { - html5Mode.enabled = mode; - return this; - } else if (isObject(mode)) { - - if (isBoolean(mode.enabled)) { - html5Mode.enabled = mode.enabled; - } - - if (isBoolean(mode.requireBase)) { - html5Mode.requireBase = mode.requireBase; - } - - if (isBoolean(mode.rewriteLinks)) { - html5Mode.rewriteLinks = mode.rewriteLinks; - } - - return this; - } else { - return html5Mode; - } - }; - - /** - * @ngdoc event - * @name $location#$locationChangeStart - * @eventType broadcast on root scope - * @description - * Broadcasted before a URL will change. - * - * This change can be prevented by calling - * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more - * details about event object. Upon successful change - * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired. - * - * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when - * the browser supports the HTML5 History API. - * - * @param {Object} angularEvent Synthetic event object. - * @param {string} newUrl New URL - * @param {string=} oldUrl URL that was before it was changed. - * @param {string=} newState New history state object - * @param {string=} oldState History state object that was before it was changed. - */ - - /** - * @ngdoc event - * @name $location#$locationChangeSuccess - * @eventType broadcast on root scope - * @description - * Broadcasted after a URL was changed. - * - * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when - * the browser supports the HTML5 History API. - * - * @param {Object} angularEvent Synthetic event object. - * @param {string} newUrl New URL - * @param {string=} oldUrl URL that was before it was changed. - * @param {string=} newState New history state object - * @param {string=} oldState History state object that was before it was changed. - */ - - this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', - function($rootScope, $browser, $sniffer, $rootElement) { - var $location, - LocationMode, - baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to '' - initialUrl = $browser.url(), - appBase; - - if (html5Mode.enabled) { - if (!baseHref && html5Mode.requireBase) { - throw $locationMinErr('nobase', - "$location in HTML5 mode requires a tag to be present!"); - } - appBase = serverBase(initialUrl) + (baseHref || '/'); - LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url; - } else { - appBase = stripHash(initialUrl); - LocationMode = LocationHashbangUrl; - } - $location = new LocationMode(appBase, '#' + hashPrefix); - $location.$$parseLinkUrl(initialUrl, initialUrl); - - $location.$$state = $browser.state(); - - var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i; - - function setBrowserUrlWithFallback(url, replace, state) { - var oldUrl = $location.url(); - var oldState = $location.$$state; - try { - $browser.url(url, replace, state); - - // Make sure $location.state() returns referentially identical (not just deeply equal) - // state object; this makes possible quick checking if the state changed in the digest - // loop. Checking deep equality would be too expensive. - $location.$$state = $browser.state(); - } catch (e) { - // Restore old values if pushState fails - $location.url(oldUrl); - $location.$$state = oldState; - - throw e; - } - } - - $rootElement.on('click', function(event) { - // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser) - // currently we open nice url link and redirect then - - if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.which == 2) return; - - var elm = jqLite(event.target); - - // traverse the DOM up to find first A tag - while (nodeName_(elm[0]) !== 'a') { - // ignore rewriting if no A tag (reached root element, or no parent - removed from document) - if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return; - } - - var absHref = elm.prop('href'); - // get the actual href attribute - see - // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx - var relHref = elm.attr('href') || elm.attr('xlink:href'); - - if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') { - // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during - // an animation. - absHref = urlResolve(absHref.animVal).href; - } - - // Ignore when url is started with javascript: or mailto: - if (IGNORE_URI_REGEXP.test(absHref)) return; - - if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) { - if ($location.$$parseLinkUrl(absHref, relHref)) { - // We do a preventDefault for all urls that are part of the angular application, - // in html5mode and also without, so that we are able to abort navigation without - // getting double entries in the location history. - event.preventDefault(); - // update location manually - if ($location.absUrl() != $browser.url()) { - $rootScope.$apply(); - // hack to work around FF6 bug 684208 when scenario runner clicks on links - window.angular['ff-684208-preventDefault'] = true; - } - } - } - }); - - - // rewrite hashbang url <> html5 url - if ($location.absUrl() != initialUrl) { - $browser.url($location.absUrl(), true); - } - - var initializing = true; - - // update $location when $browser url changes - $browser.onUrlChange(function(newUrl, newState) { - $rootScope.$evalAsync(function() { - var oldUrl = $location.absUrl(); - var oldState = $location.$$state; - var defaultPrevented; - - $location.$$parse(newUrl); - $location.$$state = newState; - - defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, - newState, oldState).defaultPrevented; - - // if the location was changed by a `$locationChangeStart` handler then stop - // processing this location change - if ($location.absUrl() !== newUrl) return; - - if (defaultPrevented) { - $location.$$parse(oldUrl); - $location.$$state = oldState; - setBrowserUrlWithFallback(oldUrl, false, oldState); - } else { - initializing = false; - afterLocationChange(oldUrl, oldState); - } - }); - if (!$rootScope.$$phase) $rootScope.$digest(); - }); - - // update browser - $rootScope.$watch(function $locationWatch() { - var oldUrl = $browser.url(); - var oldState = $browser.state(); - var currentReplace = $location.$$replace; - var urlOrStateChanged = oldUrl !== $location.absUrl() || - ($location.$$html5 && $sniffer.history && oldState !== $location.$$state); - - if (initializing || urlOrStateChanged) { - initializing = false; - - $rootScope.$evalAsync(function() { - var newUrl = $location.absUrl(); - var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, - $location.$$state, oldState).defaultPrevented; - - // if the location was changed by a `$locationChangeStart` handler then stop - // processing this location change - if ($location.absUrl() !== newUrl) return; - - if (defaultPrevented) { - $location.$$parse(oldUrl); - $location.$$state = oldState; - } else { - if (urlOrStateChanged) { - setBrowserUrlWithFallback(newUrl, currentReplace, - oldState === $location.$$state ? null : $location.$$state); - } - afterLocationChange(oldUrl, oldState); - } - }); - } - - $location.$$replace = false; - - // we don't need to return anything because $evalAsync will make the digest loop dirty when - // there is a change - }); - - return $location; - - function afterLocationChange(oldUrl, oldState) { - $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl, - $location.$$state, oldState); - } -}]; -} - -/** - * @ngdoc service - * @name $log - * @requires $window - * - * @description - * Simple service for logging. Default implementation safely writes the message - * into the browser's console (if present). - * - * The main purpose of this service is to simplify debugging and troubleshooting. - * - * The default is to log `debug` messages. You can use - * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this. - * - * @example - - - angular.module('logExample', []) - .controller('LogController', ['$scope', '$log', function($scope, $log) { - $scope.$log = $log; - $scope.message = 'Hello World!'; - }]); - - -
-

Reload this page with open console, enter text and hit the log button...

- Message: - - - - - -
-
-
- */ - -/** - * @ngdoc provider - * @name $logProvider - * @description - * Use the `$logProvider` to configure how the application logs messages - */ -function $LogProvider() { - var debug = true, - self = this; - - /** - * @ngdoc method - * @name $logProvider#debugEnabled - * @description - * @param {boolean=} flag enable or disable debug level messages - * @returns {*} current value if used as getter or itself (chaining) if used as setter - */ - this.debugEnabled = function(flag) { - if (isDefined(flag)) { - debug = flag; - return this; - } else { - return debug; - } - }; - - this.$get = ['$window', function($window) { - return { - /** - * @ngdoc method - * @name $log#log - * - * @description - * Write a log message - */ - log: consoleLog('log'), - - /** - * @ngdoc method - * @name $log#info - * - * @description - * Write an information message - */ - info: consoleLog('info'), - - /** - * @ngdoc method - * @name $log#warn - * - * @description - * Write a warning message - */ - warn: consoleLog('warn'), - - /** - * @ngdoc method - * @name $log#error - * - * @description - * Write an error message - */ - error: consoleLog('error'), - - /** - * @ngdoc method - * @name $log#debug - * - * @description - * Write a debug message - */ - debug: (function() { - var fn = consoleLog('debug'); - - return function() { - if (debug) { - fn.apply(self, arguments); - } - }; - }()) - }; - - function formatError(arg) { - if (arg instanceof Error) { - if (arg.stack) { - arg = (arg.message && arg.stack.indexOf(arg.message) === -1) - ? 'Error: ' + arg.message + '\n' + arg.stack - : arg.stack; - } else if (arg.sourceURL) { - arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line; - } - } - return arg; - } - - function consoleLog(type) { - var console = $window.console || {}, - logFn = console[type] || console.log || noop, - hasApply = false; - - // Note: reading logFn.apply throws an error in IE11 in IE8 document mode. - // The reason behind this is that console.log has type "object" in IE8... - try { - hasApply = !!logFn.apply; - } catch (e) {} - - if (hasApply) { - return function() { - var args = []; - forEach(arguments, function(arg) { - args.push(formatError(arg)); - }); - return logFn.apply(console, args); - }; - } - - // we are IE which either doesn't have window.console => this is noop and we do nothing, - // or we are IE where console.log doesn't have apply so we log at least first 2 args - return function(arg1, arg2) { - logFn(arg1, arg2 == null ? '' : arg2); - }; - } - }]; -} - -var $parseMinErr = minErr('$parse'); - -// Sandboxing Angular Expressions -// ------------------------------ -// Angular expressions are generally considered safe because these expressions only have direct -// access to `$scope` and locals. However, one can obtain the ability to execute arbitrary JS code by -// obtaining a reference to native JS functions such as the Function constructor. -// -// As an example, consider the following Angular expression: -// -// {}.toString.constructor('alert("evil JS code")') -// -// This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits -// against the expression language, but not to prevent exploits that were enabled by exposing -// sensitive JavaScript or browser APIs on Scope. Exposing such objects on a Scope is never a good -// practice and therefore we are not even trying to protect against interaction with an object -// explicitly exposed in this way. -// -// In general, it is not possible to access a Window object from an angular expression unless a -// window or some DOM object that has a reference to window is published onto a Scope. -// Similarly we prevent invocations of function known to be dangerous, as well as assignments to -// native objects. -// -// See https://docs.angularjs.org/guide/security - - -function ensureSafeMemberName(name, fullExpression) { - if (name === "__defineGetter__" || name === "__defineSetter__" - || name === "__lookupGetter__" || name === "__lookupSetter__" - || name === "__proto__") { - throw $parseMinErr('isecfld', - 'Attempting to access a disallowed field in Angular expressions! ' - + 'Expression: {0}', fullExpression); - } - return name; -} - -function ensureSafeObject(obj, fullExpression) { - // nifty check if obj is Function that is fast and works across iframes and other contexts - if (obj) { - if (obj.constructor === obj) { - throw $parseMinErr('isecfn', - 'Referencing Function in Angular expressions is disallowed! Expression: {0}', - fullExpression); - } else if (// isWindow(obj) - obj.window === obj) { - throw $parseMinErr('isecwindow', - 'Referencing the Window in Angular expressions is disallowed! Expression: {0}', - fullExpression); - } else if (// isElement(obj) - obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) { - throw $parseMinErr('isecdom', - 'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}', - fullExpression); - } else if (// block Object so that we can't get hold of dangerous Object.* methods - obj === Object) { - throw $parseMinErr('isecobj', - 'Referencing Object in Angular expressions is disallowed! Expression: {0}', - fullExpression); - } - } - return obj; -} - -var CALL = Function.prototype.call; -var APPLY = Function.prototype.apply; -var BIND = Function.prototype.bind; - -function ensureSafeFunction(obj, fullExpression) { - if (obj) { - if (obj.constructor === obj) { - throw $parseMinErr('isecfn', - 'Referencing Function in Angular expressions is disallowed! Expression: {0}', - fullExpression); - } else if (obj === CALL || obj === APPLY || obj === BIND) { - throw $parseMinErr('isecff', - 'Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}', - fullExpression); - } - } -} - -//Keyword constants -var CONSTANTS = createMap(); -forEach({ - 'null': function() { return null; }, - 'true': function() { return true; }, - 'false': function() { return false; }, - 'undefined': function() {} -}, function(constantGetter, name) { - constantGetter.constant = constantGetter.literal = constantGetter.sharedGetter = true; - CONSTANTS[name] = constantGetter; -}); - -//Not quite a constant, but can be lex/parsed the same -CONSTANTS['this'] = function(self) { return self; }; -CONSTANTS['this'].sharedGetter = true; - - -//Operators - will be wrapped by binaryFn/unaryFn/assignment/filter -var OPERATORS = extend(createMap(), { - '+':function(self, locals, a, b) { - a=a(self, locals); b=b(self, locals); - if (isDefined(a)) { - if (isDefined(b)) { - return a + b; - } - return a; - } - return isDefined(b) ? b : undefined;}, - '-':function(self, locals, a, b) { - a=a(self, locals); b=b(self, locals); - return (isDefined(a) ? a : 0) - (isDefined(b) ? b : 0); - }, - '*':function(self, locals, a, b) {return a(self, locals) * b(self, locals);}, - '/':function(self, locals, a, b) {return a(self, locals) / b(self, locals);}, - '%':function(self, locals, a, b) {return a(self, locals) % b(self, locals);}, - '===':function(self, locals, a, b) {return a(self, locals) === b(self, locals);}, - '!==':function(self, locals, a, b) {return a(self, locals) !== b(self, locals);}, - '==':function(self, locals, a, b) {return a(self, locals) == b(self, locals);}, - '!=':function(self, locals, a, b) {return a(self, locals) != b(self, locals);}, - '<':function(self, locals, a, b) {return a(self, locals) < b(self, locals);}, - '>':function(self, locals, a, b) {return a(self, locals) > b(self, locals);}, - '<=':function(self, locals, a, b) {return a(self, locals) <= b(self, locals);}, - '>=':function(self, locals, a, b) {return a(self, locals) >= b(self, locals);}, - '&&':function(self, locals, a, b) {return a(self, locals) && b(self, locals);}, - '||':function(self, locals, a, b) {return a(self, locals) || b(self, locals);}, - '!':function(self, locals, a) {return !a(self, locals);}, - - //Tokenized as operators but parsed as assignment/filters - '=':true, - '|':true -}); -var ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'}; - - -///////////////////////////////////////// - - -/** - * @constructor - */ -var Lexer = function(options) { - this.options = options; -}; - -Lexer.prototype = { - constructor: Lexer, - - lex: function(text) { - this.text = text; - this.index = 0; - this.tokens = []; - - while (this.index < this.text.length) { - var ch = this.text.charAt(this.index); - if (ch === '"' || ch === "'") { - this.readString(ch); - } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) { - this.readNumber(); - } else if (this.isIdent(ch)) { - this.readIdent(); - } else if (this.is(ch, '(){}[].,;:?')) { - this.tokens.push({index: this.index, text: ch}); - this.index++; - } else if (this.isWhitespace(ch)) { - this.index++; - } else { - var ch2 = ch + this.peek(); - var ch3 = ch2 + this.peek(2); - var op1 = OPERATORS[ch]; - var op2 = OPERATORS[ch2]; - var op3 = OPERATORS[ch3]; - if (op1 || op2 || op3) { - var token = op3 ? ch3 : (op2 ? ch2 : ch); - this.tokens.push({index: this.index, text: token, operator: true}); - this.index += token.length; - } else { - this.throwError('Unexpected next character ', this.index, this.index + 1); - } - } - } - return this.tokens; - }, - - is: function(ch, chars) { - return chars.indexOf(ch) !== -1; - }, - - peek: function(i) { - var num = i || 1; - return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false; - }, - - isNumber: function(ch) { - return ('0' <= ch && ch <= '9') && typeof ch === "string"; - }, - - isWhitespace: function(ch) { - // IE treats non-breaking space as \u00A0 - return (ch === ' ' || ch === '\r' || ch === '\t' || - ch === '\n' || ch === '\v' || ch === '\u00A0'); - }, - - isIdent: function(ch) { - return ('a' <= ch && ch <= 'z' || - 'A' <= ch && ch <= 'Z' || - '_' === ch || ch === '$'); - }, - - isExpOperator: function(ch) { - return (ch === '-' || ch === '+' || this.isNumber(ch)); - }, - - throwError: function(error, start, end) { - end = end || this.index; - var colStr = (isDefined(start) - ? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']' - : ' ' + end); - throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].', - error, colStr, this.text); - }, - - readNumber: function() { - var number = ''; - var start = this.index; - while (this.index < this.text.length) { - var ch = lowercase(this.text.charAt(this.index)); - if (ch == '.' || this.isNumber(ch)) { - number += ch; - } else { - var peekCh = this.peek(); - if (ch == 'e' && this.isExpOperator(peekCh)) { - number += ch; - } else if (this.isExpOperator(ch) && - peekCh && this.isNumber(peekCh) && - number.charAt(number.length - 1) == 'e') { - number += ch; - } else if (this.isExpOperator(ch) && - (!peekCh || !this.isNumber(peekCh)) && - number.charAt(number.length - 1) == 'e') { - this.throwError('Invalid exponent'); - } else { - break; - } - } - this.index++; - } - this.tokens.push({ - index: start, - text: number, - constant: true, - value: Number(number) - }); - }, - - readIdent: function() { - var start = this.index; - while (this.index < this.text.length) { - var ch = this.text.charAt(this.index); - if (!(this.isIdent(ch) || this.isNumber(ch))) { - break; - } - this.index++; - } - this.tokens.push({ - index: start, - text: this.text.slice(start, this.index), - identifier: true - }); - }, - - readString: function(quote) { - var start = this.index; - this.index++; - var string = ''; - var rawString = quote; - var escape = false; - while (this.index < this.text.length) { - var ch = this.text.charAt(this.index); - rawString += ch; - if (escape) { - if (ch === 'u') { - var hex = this.text.substring(this.index + 1, this.index + 5); - if (!hex.match(/[\da-f]{4}/i)) - this.throwError('Invalid unicode escape [\\u' + hex + ']'); - this.index += 4; - string += String.fromCharCode(parseInt(hex, 16)); - } else { - var rep = ESCAPE[ch]; - string = string + (rep || ch); - } - escape = false; - } else if (ch === '\\') { - escape = true; - } else if (ch === quote) { - this.index++; - this.tokens.push({ - index: start, - text: rawString, - constant: true, - value: string - }); - return; - } else { - string += ch; - } - this.index++; - } - this.throwError('Unterminated quote', start); - } -}; - - -function isConstant(exp) { - return exp.constant; -} - -/** - * @constructor - */ -var Parser = function(lexer, $filter, options) { - this.lexer = lexer; - this.$filter = $filter; - this.options = options; -}; - -Parser.ZERO = extend(function() { - return 0; -}, { - sharedGetter: true, - constant: true -}); - -Parser.prototype = { - constructor: Parser, - - parse: function(text) { - this.text = text; - this.tokens = this.lexer.lex(text); - - var value = this.statements(); - - if (this.tokens.length !== 0) { - this.throwError('is an unexpected token', this.tokens[0]); - } - - value.literal = !!value.literal; - value.constant = !!value.constant; - - return value; - }, - - primary: function() { - var primary; - if (this.expect('(')) { - primary = this.filterChain(); - this.consume(')'); - } else if (this.expect('[')) { - primary = this.arrayDeclaration(); - } else if (this.expect('{')) { - primary = this.object(); - } else if (this.peek().identifier) { - primary = this.identifier(); - } else if (this.peek().constant) { - primary = this.constant(); - } else { - this.throwError('not a primary expression', this.peek()); - } - - var next, context; - while ((next = this.expect('(', '[', '.'))) { - if (next.text === '(') { - primary = this.functionCall(primary, context); - context = null; - } else if (next.text === '[') { - context = primary; - primary = this.objectIndex(primary); - } else if (next.text === '.') { - context = primary; - primary = this.fieldAccess(primary); - } else { - this.throwError('IMPOSSIBLE'); - } - } - return primary; - }, - - throwError: function(msg, token) { - throw $parseMinErr('syntax', - 'Syntax Error: Token \'{0}\' {1} at column {2} of the expression [{3}] starting at [{4}].', - token.text, msg, (token.index + 1), this.text, this.text.substring(token.index)); - }, - - peekToken: function() { - if (this.tokens.length === 0) - throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text); - return this.tokens[0]; - }, - - peek: function(e1, e2, e3, e4) { - return this.peekAhead(0, e1, e2, e3, e4); - }, - peekAhead: function(i, e1, e2, e3, e4) { - if (this.tokens.length > i) { - var token = this.tokens[i]; - var t = token.text; - if (t === e1 || t === e2 || t === e3 || t === e4 || - (!e1 && !e2 && !e3 && !e4)) { - return token; - } - } - return false; - }, - - expect: function(e1, e2, e3, e4) { - var token = this.peek(e1, e2, e3, e4); - if (token) { - this.tokens.shift(); - return token; - } - return false; - }, - - consume: function(e1) { - if (this.tokens.length === 0) { - throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text); - } - - var token = this.expect(e1); - if (!token) { - this.throwError('is unexpected, expecting [' + e1 + ']', this.peek()); - } - return token; - }, - - unaryFn: function(op, right) { - var fn = OPERATORS[op]; - return extend(function $parseUnaryFn(self, locals) { - return fn(self, locals, right); - }, { - constant:right.constant, - inputs: [right] - }); - }, - - binaryFn: function(left, op, right, isBranching) { - var fn = OPERATORS[op]; - return extend(function $parseBinaryFn(self, locals) { - return fn(self, locals, left, right); - }, { - constant: left.constant && right.constant, - inputs: !isBranching && [left, right] - }); - }, - - identifier: function() { - var id = this.consume().text; - - //Continue reading each `.identifier` unless it is a method invocation - while (this.peek('.') && this.peekAhead(1).identifier && !this.peekAhead(2, '(')) { - id += this.consume().text + this.consume().text; - } - - return CONSTANTS[id] || getterFn(id, this.options, this.text); - }, - - constant: function() { - var value = this.consume().value; - - return extend(function $parseConstant() { - return value; - }, { - constant: true, - literal: true - }); - }, - - statements: function() { - var statements = []; - while (true) { - if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']')) - statements.push(this.filterChain()); - if (!this.expect(';')) { - // optimize for the common case where there is only one statement. - // TODO(size): maybe we should not support multiple statements? - return (statements.length === 1) - ? statements[0] - : function $parseStatements(self, locals) { - var value; - for (var i = 0, ii = statements.length; i < ii; i++) { - value = statements[i](self, locals); - } - return value; - }; - } - } - }, - - filterChain: function() { - var left = this.expression(); - var token; - while ((token = this.expect('|'))) { - left = this.filter(left); - } - return left; - }, - - filter: function(inputFn) { - var fn = this.$filter(this.consume().text); - var argsFn; - var args; - - if (this.peek(':')) { - argsFn = []; - args = []; // we can safely reuse the array - while (this.expect(':')) { - argsFn.push(this.expression()); - } - } - - var inputs = [inputFn].concat(argsFn || []); - - return extend(function $parseFilter(self, locals) { - var input = inputFn(self, locals); - if (args) { - args[0] = input; - - var i = argsFn.length; - while (i--) { - args[i + 1] = argsFn[i](self, locals); - } - - return fn.apply(undefined, args); - } - - return fn(input); - }, { - constant: !fn.$stateful && inputs.every(isConstant), - inputs: !fn.$stateful && inputs - }); - }, - - expression: function() { - return this.assignment(); - }, - - assignment: function() { - var left = this.ternary(); - var right; - var token; - if ((token = this.expect('='))) { - if (!left.assign) { - this.throwError('implies assignment but [' + - this.text.substring(0, token.index) + '] can not be assigned to', token); - } - right = this.ternary(); - return extend(function $parseAssignment(scope, locals) { - return left.assign(scope, right(scope, locals), locals); - }, { - inputs: [left, right] - }); - } - return left; - }, - - ternary: function() { - var left = this.logicalOR(); - var middle; - var token; - if ((token = this.expect('?'))) { - middle = this.assignment(); - if (this.consume(':')) { - var right = this.assignment(); - - return extend(function $parseTernary(self, locals) { - return left(self, locals) ? middle(self, locals) : right(self, locals); - }, { - constant: left.constant && middle.constant && right.constant - }); - } - } - - return left; - }, - - logicalOR: function() { - var left = this.logicalAND(); - var token; - while ((token = this.expect('||'))) { - left = this.binaryFn(left, token.text, this.logicalAND(), true); - } - return left; - }, - - logicalAND: function() { - var left = this.equality(); - var token; - if ((token = this.expect('&&'))) { - left = this.binaryFn(left, token.text, this.logicalAND(), true); - } - return left; - }, - - equality: function() { - var left = this.relational(); - var token; - if ((token = this.expect('==','!=','===','!=='))) { - left = this.binaryFn(left, token.text, this.equality()); - } - return left; - }, - - relational: function() { - var left = this.additive(); - var token; - if ((token = this.expect('<', '>', '<=', '>='))) { - left = this.binaryFn(left, token.text, this.relational()); - } - return left; - }, - - additive: function() { - var left = this.multiplicative(); - var token; - while ((token = this.expect('+','-'))) { - left = this.binaryFn(left, token.text, this.multiplicative()); - } - return left; - }, - - multiplicative: function() { - var left = this.unary(); - var token; - while ((token = this.expect('*','/','%'))) { - left = this.binaryFn(left, token.text, this.unary()); - } - return left; - }, - - unary: function() { - var token; - if (this.expect('+')) { - return this.primary(); - } else if ((token = this.expect('-'))) { - return this.binaryFn(Parser.ZERO, token.text, this.unary()); - } else if ((token = this.expect('!'))) { - return this.unaryFn(token.text, this.unary()); - } else { - return this.primary(); - } - }, - - fieldAccess: function(object) { - var expression = this.text; - var field = this.consume().text; - var getter = getterFn(field, this.options, expression); - - return extend(function $parseFieldAccess(scope, locals, self) { - return getter(self || object(scope, locals)); - }, { - assign: function(scope, value, locals) { - var o = object(scope, locals); - if (!o) object.assign(scope, o = {}); - return setter(o, field, value, expression); - } - }); - }, - - objectIndex: function(obj) { - var expression = this.text; - - var indexFn = this.expression(); - this.consume(']'); - - return extend(function $parseObjectIndex(self, locals) { - var o = obj(self, locals), - i = indexFn(self, locals), - v; - - ensureSafeMemberName(i, expression); - if (!o) return undefined; - v = ensureSafeObject(o[i], expression); - return v; - }, { - assign: function(self, value, locals) { - var key = ensureSafeMemberName(indexFn(self, locals), expression); - // prevent overwriting of Function.constructor which would break ensureSafeObject check - var o = ensureSafeObject(obj(self, locals), expression); - if (!o) obj.assign(self, o = {}); - return o[key] = value; - } - }); - }, - - functionCall: function(fnGetter, contextGetter) { - var argsFn = []; - if (this.peekToken().text !== ')') { - do { - argsFn.push(this.expression()); - } while (this.expect(',')); - } - this.consume(')'); - - var expressionText = this.text; - // we can safely reuse the array across invocations - var args = argsFn.length ? [] : null; - - return function $parseFunctionCall(scope, locals) { - var context = contextGetter ? contextGetter(scope, locals) : scope; - var fn = fnGetter(scope, locals, context) || noop; - - if (args) { - var i = argsFn.length; - while (i--) { - args[i] = ensureSafeObject(argsFn[i](scope, locals), expressionText); - } - } - - ensureSafeObject(context, expressionText); - ensureSafeFunction(fn, expressionText); - - // IE stupidity! (IE doesn't have apply for some native functions) - var v = fn.apply - ? fn.apply(context, args) - : fn(args[0], args[1], args[2], args[3], args[4]); - - return ensureSafeObject(v, expressionText); - }; - }, - - // This is used with json array declaration - arrayDeclaration: function() { - var elementFns = []; - if (this.peekToken().text !== ']') { - do { - if (this.peek(']')) { - // Support trailing commas per ES5.1. - break; - } - elementFns.push(this.expression()); - } while (this.expect(',')); - } - this.consume(']'); - - return extend(function $parseArrayLiteral(self, locals) { - var array = []; - for (var i = 0, ii = elementFns.length; i < ii; i++) { - array.push(elementFns[i](self, locals)); - } - return array; - }, { - literal: true, - constant: elementFns.every(isConstant), - inputs: elementFns - }); - }, - - object: function() { - var keys = [], valueFns = []; - if (this.peekToken().text !== '}') { - do { - if (this.peek('}')) { - // Support trailing commas per ES5.1. - break; - } - var token = this.consume(); - if (token.constant) { - keys.push(token.value); - } else if (token.identifier) { - keys.push(token.text); - } else { - this.throwError("invalid key", token); - } - this.consume(':'); - valueFns.push(this.expression()); - } while (this.expect(',')); - } - this.consume('}'); - - return extend(function $parseObjectLiteral(self, locals) { - var object = {}; - for (var i = 0, ii = valueFns.length; i < ii; i++) { - object[keys[i]] = valueFns[i](self, locals); - } - return object; - }, { - literal: true, - constant: valueFns.every(isConstant), - inputs: valueFns - }); - } -}; - - -////////////////////////////////////////////////// -// Parser helper functions -////////////////////////////////////////////////// - -function setter(obj, path, setValue, fullExp) { - ensureSafeObject(obj, fullExp); - - var element = path.split('.'), key; - for (var i = 0; element.length > 1; i++) { - key = ensureSafeMemberName(element.shift(), fullExp); - var propertyObj = ensureSafeObject(obj[key], fullExp); - if (!propertyObj) { - propertyObj = {}; - obj[key] = propertyObj; - } - obj = propertyObj; - } - key = ensureSafeMemberName(element.shift(), fullExp); - ensureSafeObject(obj[key], fullExp); - obj[key] = setValue; - return setValue; -} - -var getterFnCacheDefault = createMap(); -var getterFnCacheExpensive = createMap(); - -function isPossiblyDangerousMemberName(name) { - return name == 'constructor'; -} - -/** - * Implementation of the "Black Hole" variant from: - * - http://jsperf.com/angularjs-parse-getter/4 - * - http://jsperf.com/path-evaluation-simplified/7 - */ -function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, expensiveChecks) { - ensureSafeMemberName(key0, fullExp); - ensureSafeMemberName(key1, fullExp); - ensureSafeMemberName(key2, fullExp); - ensureSafeMemberName(key3, fullExp); - ensureSafeMemberName(key4, fullExp); - var eso = function(o) { - return ensureSafeObject(o, fullExp); - }; - var eso0 = (expensiveChecks || isPossiblyDangerousMemberName(key0)) ? eso : identity; - var eso1 = (expensiveChecks || isPossiblyDangerousMemberName(key1)) ? eso : identity; - var eso2 = (expensiveChecks || isPossiblyDangerousMemberName(key2)) ? eso : identity; - var eso3 = (expensiveChecks || isPossiblyDangerousMemberName(key3)) ? eso : identity; - var eso4 = (expensiveChecks || isPossiblyDangerousMemberName(key4)) ? eso : identity; - - return function cspSafeGetter(scope, locals) { - var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope; - - if (pathVal == null) return pathVal; - pathVal = eso0(pathVal[key0]); - - if (!key1) return pathVal; - if (pathVal == null) return undefined; - pathVal = eso1(pathVal[key1]); - - if (!key2) return pathVal; - if (pathVal == null) return undefined; - pathVal = eso2(pathVal[key2]); - - if (!key3) return pathVal; - if (pathVal == null) return undefined; - pathVal = eso3(pathVal[key3]); - - if (!key4) return pathVal; - if (pathVal == null) return undefined; - pathVal = eso4(pathVal[key4]); - - return pathVal; - }; -} - -function getterFnWithEnsureSafeObject(fn, fullExpression) { - return function(s, l) { - return fn(s, l, ensureSafeObject, fullExpression); - }; -} - -function getterFn(path, options, fullExp) { - var expensiveChecks = options.expensiveChecks; - var getterFnCache = (expensiveChecks ? getterFnCacheExpensive : getterFnCacheDefault); - var fn = getterFnCache[path]; - if (fn) return fn; - - - var pathKeys = path.split('.'), - pathKeysLength = pathKeys.length; - - // http://jsperf.com/angularjs-parse-getter/6 - if (options.csp) { - if (pathKeysLength < 6) { - fn = cspSafeGetterFn(pathKeys[0], pathKeys[1], pathKeys[2], pathKeys[3], pathKeys[4], fullExp, expensiveChecks); - } else { - fn = function cspSafeGetter(scope, locals) { - var i = 0, val; - do { - val = cspSafeGetterFn(pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++], - pathKeys[i++], fullExp, expensiveChecks)(scope, locals); - - locals = undefined; // clear after first iteration - scope = val; - } while (i < pathKeysLength); - return val; - }; - } - } else { - var code = ''; - if (expensiveChecks) { - code += 's = eso(s, fe);\nl = eso(l, fe);\n'; - } - var needsEnsureSafeObject = expensiveChecks; - forEach(pathKeys, function(key, index) { - ensureSafeMemberName(key, fullExp); - var lookupJs = (index - // we simply dereference 's' on any .dot notation - ? 's' - // but if we are first then we check locals first, and if so read it first - : '((l&&l.hasOwnProperty("' + key + '"))?l:s)') + '.' + key; - if (expensiveChecks || isPossiblyDangerousMemberName(key)) { - lookupJs = 'eso(' + lookupJs + ', fe)'; - needsEnsureSafeObject = true; - } - code += 'if(s == null) return undefined;\n' + - 's=' + lookupJs + ';\n'; - }); - code += 'return s;'; - - /* jshint -W054 */ - var evaledFnGetter = new Function('s', 'l', 'eso', 'fe', code); // s=scope, l=locals, eso=ensureSafeObject - /* jshint +W054 */ - evaledFnGetter.toString = valueFn(code); - if (needsEnsureSafeObject) { - evaledFnGetter = getterFnWithEnsureSafeObject(evaledFnGetter, fullExp); - } - fn = evaledFnGetter; - } - - fn.sharedGetter = true; - fn.assign = function(self, value) { - return setter(self, path, value, path); - }; - getterFnCache[path] = fn; - return fn; -} - -var objectValueOf = Object.prototype.valueOf; - -function getValueOf(value) { - return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value); -} - -/////////////////////////////////// - -/** - * @ngdoc service - * @name $parse - * @kind function - * - * @description - * - * Converts Angular {@link guide/expression expression} into a function. - * - * ```js - * var getter = $parse('user.name'); - * var setter = getter.assign; - * var context = {user:{name:'angular'}}; - * var locals = {user:{name:'local'}}; - * - * expect(getter(context)).toEqual('angular'); - * setter(context, 'newValue'); - * expect(context.user.name).toEqual('newValue'); - * expect(getter(context, locals)).toEqual('local'); - * ``` - * - * - * @param {string} expression String expression to compile. - * @returns {function(context, locals)} a function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the strings - * are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values in - * `context`. - * - * The returned function also has the following properties: - * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript - * literal. - * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript - * constant literals. - * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be - * set to a function to change its value on the given context. - * - */ - - -/** - * @ngdoc provider - * @name $parseProvider - * - * @description - * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse} - * service. - */ -function $ParseProvider() { - var cacheDefault = createMap(); - var cacheExpensive = createMap(); - - - - this.$get = ['$filter', '$sniffer', function($filter, $sniffer) { - var $parseOptions = { - csp: $sniffer.csp, - expensiveChecks: false - }, - $parseOptionsExpensive = { - csp: $sniffer.csp, - expensiveChecks: true - }; - - function wrapSharedExpression(exp) { - var wrapped = exp; - - if (exp.sharedGetter) { - wrapped = function $parseWrapper(self, locals) { - return exp(self, locals); - }; - wrapped.literal = exp.literal; - wrapped.constant = exp.constant; - wrapped.assign = exp.assign; - } - - return wrapped; - } - - return function $parse(exp, interceptorFn, expensiveChecks) { - var parsedExpression, oneTime, cacheKey; - - switch (typeof exp) { - case 'string': - cacheKey = exp = exp.trim(); - - var cache = (expensiveChecks ? cacheExpensive : cacheDefault); - parsedExpression = cache[cacheKey]; - - if (!parsedExpression) { - if (exp.charAt(0) === ':' && exp.charAt(1) === ':') { - oneTime = true; - exp = exp.substring(2); - } - - var parseOptions = expensiveChecks ? $parseOptionsExpensive : $parseOptions; - var lexer = new Lexer(parseOptions); - var parser = new Parser(lexer, $filter, parseOptions); - parsedExpression = parser.parse(exp); - - if (parsedExpression.constant) { - parsedExpression.$$watchDelegate = constantWatchDelegate; - } else if (oneTime) { - //oneTime is not part of the exp passed to the Parser so we may have to - //wrap the parsedExpression before adding a $$watchDelegate - parsedExpression = wrapSharedExpression(parsedExpression); - parsedExpression.$$watchDelegate = parsedExpression.literal ? - oneTimeLiteralWatchDelegate : oneTimeWatchDelegate; - } else if (parsedExpression.inputs) { - parsedExpression.$$watchDelegate = inputsWatchDelegate; - } - - cache[cacheKey] = parsedExpression; - } - return addInterceptor(parsedExpression, interceptorFn); - - case 'function': - return addInterceptor(exp, interceptorFn); - - default: - return addInterceptor(noop, interceptorFn); - } - }; - - function collectExpressionInputs(inputs, list) { - for (var i = 0, ii = inputs.length; i < ii; i++) { - var input = inputs[i]; - if (!input.constant) { - if (input.inputs) { - collectExpressionInputs(input.inputs, list); - } else if (list.indexOf(input) === -1) { // TODO(perf) can we do better? - list.push(input); - } - } - } - - return list; - } - - function expressionInputDirtyCheck(newValue, oldValueOfValue) { - - if (newValue == null || oldValueOfValue == null) { // null/undefined - return newValue === oldValueOfValue; - } - - if (typeof newValue === 'object') { - - // attempt to convert the value to a primitive type - // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can - // be cheaply dirty-checked - newValue = getValueOf(newValue); - - if (typeof newValue === 'object') { - // objects/arrays are not supported - deep-watching them would be too expensive - return false; - } - - // fall-through to the primitive equality check - } - - //Primitive or NaN - return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue); - } - - function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression) { - var inputExpressions = parsedExpression.$$inputs || - (parsedExpression.$$inputs = collectExpressionInputs(parsedExpression.inputs, [])); - - var lastResult; - - if (inputExpressions.length === 1) { - var oldInputValue = expressionInputDirtyCheck; // init to something unique so that equals check fails - inputExpressions = inputExpressions[0]; - return scope.$watch(function expressionInputWatch(scope) { - var newInputValue = inputExpressions(scope); - if (!expressionInputDirtyCheck(newInputValue, oldInputValue)) { - lastResult = parsedExpression(scope); - oldInputValue = newInputValue && getValueOf(newInputValue); - } - return lastResult; - }, listener, objectEquality); - } - - var oldInputValueOfValues = []; - for (var i = 0, ii = inputExpressions.length; i < ii; i++) { - oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails - } - - return scope.$watch(function expressionInputsWatch(scope) { - var changed = false; - - for (var i = 0, ii = inputExpressions.length; i < ii; i++) { - var newInputValue = inputExpressions[i](scope); - if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i]))) { - oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue); - } - } - - if (changed) { - lastResult = parsedExpression(scope); - } - - return lastResult; - }, listener, objectEquality); - } - - function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression) { - var unwatch, lastValue; - return unwatch = scope.$watch(function oneTimeWatch(scope) { - return parsedExpression(scope); - }, function oneTimeListener(value, old, scope) { - lastValue = value; - if (isFunction(listener)) { - listener.apply(this, arguments); - } - if (isDefined(value)) { - scope.$$postDigest(function() { - if (isDefined(lastValue)) { - unwatch(); - } - }); - } - }, objectEquality); - } - - function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) { - var unwatch, lastValue; - return unwatch = scope.$watch(function oneTimeWatch(scope) { - return parsedExpression(scope); - }, function oneTimeListener(value, old, scope) { - lastValue = value; - if (isFunction(listener)) { - listener.call(this, value, old, scope); - } - if (isAllDefined(value)) { - scope.$$postDigest(function() { - if (isAllDefined(lastValue)) unwatch(); - }); - } - }, objectEquality); - - function isAllDefined(value) { - var allDefined = true; - forEach(value, function(val) { - if (!isDefined(val)) allDefined = false; - }); - return allDefined; - } - } - - function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) { - var unwatch; - return unwatch = scope.$watch(function constantWatch(scope) { - return parsedExpression(scope); - }, function constantListener(value, old, scope) { - if (isFunction(listener)) { - listener.apply(this, arguments); - } - unwatch(); - }, objectEquality); - } - - function addInterceptor(parsedExpression, interceptorFn) { - if (!interceptorFn) return parsedExpression; - var watchDelegate = parsedExpression.$$watchDelegate; - - var regularWatch = - watchDelegate !== oneTimeLiteralWatchDelegate && - watchDelegate !== oneTimeWatchDelegate; - - var fn = regularWatch ? function regularInterceptedExpression(scope, locals) { - var value = parsedExpression(scope, locals); - return interceptorFn(value, scope, locals); - } : function oneTimeInterceptedExpression(scope, locals) { - var value = parsedExpression(scope, locals); - var result = interceptorFn(value, scope, locals); - // we only return the interceptor's result if the - // initial value is defined (for bind-once) - return isDefined(value) ? result : value; - }; - - // Propagate $$watchDelegates other then inputsWatchDelegate - if (parsedExpression.$$watchDelegate && - parsedExpression.$$watchDelegate !== inputsWatchDelegate) { - fn.$$watchDelegate = parsedExpression.$$watchDelegate; - } else if (!interceptorFn.$stateful) { - // If there is an interceptor, but no watchDelegate then treat the interceptor like - // we treat filters - it is assumed to be a pure function unless flagged with $stateful - fn.$$watchDelegate = inputsWatchDelegate; - fn.inputs = [parsedExpression]; - } - - return fn; - } - }]; -} - -/** - * @ngdoc service - * @name $q - * @requires $rootScope - * - * @description - * A service that helps you run functions asynchronously, and use their return values (or exceptions) - * when they are done processing. - * - * This is an implementation of promises/deferred objects inspired by - * [Kris Kowal's Q](https://github.com/kriskowal/q). - * - * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred - * implementations, and the other which resembles ES6 promises to some degree. - * - * # $q constructor - * - * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver` - * function as the first argument. This is similar to the native Promise implementation from ES6 Harmony, - * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - * - * While the constructor-style use is supported, not all of the supporting methods from ES6 Harmony promises are - * available yet. - * - * It can be used like so: - * - * ```js - * // for the purpose of this example let's assume that variables `$q` and `okToGreet` - * // are available in the current lexical scope (they could have been injected or passed in). - * - * function asyncGreet(name) { - * // perform some asynchronous operation, resolve or reject the promise when appropriate. - * return $q(function(resolve, reject) { - * setTimeout(function() { - * if (okToGreet(name)) { - * resolve('Hello, ' + name + '!'); - * } else { - * reject('Greeting ' + name + ' is not allowed.'); - * } - * }, 1000); - * }); - * } - * - * var promise = asyncGreet('Robin Hood'); - * promise.then(function(greeting) { - * alert('Success: ' + greeting); - * }, function(reason) { - * alert('Failed: ' + reason); - * }); - * ``` - * - * Note: progress/notify callbacks are not currently supported via the ES6-style interface. - * - * However, the more traditional CommonJS-style usage is still available, and documented below. - * - * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an - * interface for interacting with an object that represents the result of an action that is - * performed asynchronously, and may or may not be finished at any given point in time. - * - * From the perspective of dealing with error handling, deferred and promise APIs are to - * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming. - * - * ```js - * // for the purpose of this example let's assume that variables `$q` and `okToGreet` - * // are available in the current lexical scope (they could have been injected or passed in). - * - * function asyncGreet(name) { - * var deferred = $q.defer(); - * - * setTimeout(function() { - * deferred.notify('About to greet ' + name + '.'); - * - * if (okToGreet(name)) { - * deferred.resolve('Hello, ' + name + '!'); - * } else { - * deferred.reject('Greeting ' + name + ' is not allowed.'); - * } - * }, 1000); - * - * return deferred.promise; - * } - * - * var promise = asyncGreet('Robin Hood'); - * promise.then(function(greeting) { - * alert('Success: ' + greeting); - * }, function(reason) { - * alert('Failed: ' + reason); - * }, function(update) { - * alert('Got notification: ' + update); - * }); - * ``` - * - * At first it might not be obvious why this extra complexity is worth the trouble. The payoff - * comes in the way of guarantees that promise and deferred APIs make, see - * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md. - * - * Additionally the promise api allows for composition that is very hard to do with the - * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach. - * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the - * section on serial or parallel joining of promises. - * - * # The Deferred API - * - * A new instance of deferred is constructed by calling `$q.defer()`. - * - * The purpose of the deferred object is to expose the associated Promise instance as well as APIs - * that can be used for signaling the successful or unsuccessful completion, as well as the status - * of the task. - * - * **Methods** - * - * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection - * constructed via `$q.reject`, the promise will be rejected instead. - * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to - * resolving it with a rejection constructed via `$q.reject`. - * - `notify(value)` - provides updates on the status of the promise's execution. This may be called - * multiple times before the promise is either resolved or rejected. - * - * **Properties** - * - * - promise – `{Promise}` – promise object associated with this deferred. - * - * - * # The Promise API - * - * A new promise instance is created when a deferred instance is created and can be retrieved by - * calling `deferred.promise`. - * - * The purpose of the promise object is to allow for interested parties to get access to the result - * of the deferred task when it completes. - * - * **Methods** - * - * - `then(successCallback, errorCallback, notifyCallback)` – regardless of when the promise was or - * will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously - * as soon as the result is available. The callbacks are called with a single argument: the result - * or rejection reason. Additionally, the notify callback may be called zero or more times to - * provide a progress indication, before the promise is resolved or rejected. - * - * This method *returns a new promise* which is resolved or rejected via the return value of the - * `successCallback`, `errorCallback`. It also notifies via the return value of the - * `notifyCallback` method. The promise cannot be resolved or rejected from the notifyCallback - * method. - * - * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)` - * - * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise, - * but to do so without modifying the final value. This is useful to release resources or do some - * clean-up that needs to be done whether the promise was rejected or resolved. See the [full - * specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for - * more information. - * - * # Chaining promises - * - * Because calling the `then` method of a promise returns a new derived promise, it is easily - * possible to create a chain of promises: - * - * ```js - * promiseB = promiseA.then(function(result) { - * return result + 1; - * }); - * - * // promiseB will be resolved immediately after promiseA is resolved and its value - * // will be the result of promiseA incremented by 1 - * ``` - * - * It is possible to create chains of any length and since a promise can be resolved with another - * promise (which will defer its resolution further), it is possible to pause/defer resolution of - * the promises at any point in the chain. This makes it possible to implement powerful APIs like - * $http's response interceptors. - * - * - * # Differences between Kris Kowal's Q and $q - * - * There are two main differences: - * - * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation - * mechanism in angular, which means faster propagation of resolution or rejection into your - * models and avoiding unnecessary browser repaints, which would result in flickering UI. - * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains - * all the important functionality needed for common async tasks. - * - * # Testing - * - * ```js - * it('should simulate promise', inject(function($q, $rootScope) { - * var deferred = $q.defer(); - * var promise = deferred.promise; - * var resolvedValue; - * - * promise.then(function(value) { resolvedValue = value; }); - * expect(resolvedValue).toBeUndefined(); - * - * // Simulate resolving of promise - * deferred.resolve(123); - * // Note that the 'then' function does not get called synchronously. - * // This is because we want the promise API to always be async, whether or not - * // it got called synchronously or asynchronously. - * expect(resolvedValue).toBeUndefined(); - * - * // Propagate promise resolution to 'then' functions using $apply(). - * $rootScope.$apply(); - * expect(resolvedValue).toEqual(123); - * })); - * ``` - * - * @param {function(function, function)} resolver Function which is responsible for resolving or - * rejecting the newly created promise. The first parameter is a function which resolves the - * promise, the second parameter is a function which rejects the promise. - * - * @returns {Promise} The newly created promise. - */ -function $QProvider() { - - this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) { - return qFactory(function(callback) { - $rootScope.$evalAsync(callback); - }, $exceptionHandler); - }]; -} - -function $$QProvider() { - this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) { - return qFactory(function(callback) { - $browser.defer(callback); - }, $exceptionHandler); - }]; -} - -/** - * Constructs a promise manager. - * - * @param {function(function)} nextTick Function for executing functions in the next turn. - * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for - * debugging purposes. - * @returns {object} Promise manager. - */ -function qFactory(nextTick, exceptionHandler) { - var $qMinErr = minErr('$q', TypeError); - function callOnce(self, resolveFn, rejectFn) { - var called = false; - function wrap(fn) { - return function(value) { - if (called) return; - called = true; - fn.call(self, value); - }; - } - - return [wrap(resolveFn), wrap(rejectFn)]; - } - - /** - * @ngdoc method - * @name ng.$q#defer - * @kind function - * - * @description - * Creates a `Deferred` object which represents a task which will finish in the future. - * - * @returns {Deferred} Returns a new instance of deferred. - */ - var defer = function() { - return new Deferred(); - }; - - function Promise() { - this.$$state = { status: 0 }; - } - - Promise.prototype = { - then: function(onFulfilled, onRejected, progressBack) { - var result = new Deferred(); - - this.$$state.pending = this.$$state.pending || []; - this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]); - if (this.$$state.status > 0) scheduleProcessQueue(this.$$state); - - return result.promise; - }, - - "catch": function(callback) { - return this.then(null, callback); - }, - - "finally": function(callback, progressBack) { - return this.then(function(value) { - return handleCallback(value, true, callback); - }, function(error) { - return handleCallback(error, false, callback); - }, progressBack); - } - }; - - //Faster, more basic than angular.bind http://jsperf.com/angular-bind-vs-custom-vs-native - function simpleBind(context, fn) { - return function(value) { - fn.call(context, value); - }; - } - - function processQueue(state) { - var fn, promise, pending; - - pending = state.pending; - state.processScheduled = false; - state.pending = undefined; - for (var i = 0, ii = pending.length; i < ii; ++i) { - promise = pending[i][0]; - fn = pending[i][state.status]; - try { - if (isFunction(fn)) { - promise.resolve(fn(state.value)); - } else if (state.status === 1) { - promise.resolve(state.value); - } else { - promise.reject(state.value); - } - } catch (e) { - promise.reject(e); - exceptionHandler(e); - } - } - } - - function scheduleProcessQueue(state) { - if (state.processScheduled || !state.pending) return; - state.processScheduled = true; - nextTick(function() { processQueue(state); }); - } - - function Deferred() { - this.promise = new Promise(); - //Necessary to support unbound execution :/ - this.resolve = simpleBind(this, this.resolve); - this.reject = simpleBind(this, this.reject); - this.notify = simpleBind(this, this.notify); - } - - Deferred.prototype = { - resolve: function(val) { - if (this.promise.$$state.status) return; - if (val === this.promise) { - this.$$reject($qMinErr( - 'qcycle', - "Expected promise to be resolved with value other than itself '{0}'", - val)); - } - else { - this.$$resolve(val); - } - - }, - - $$resolve: function(val) { - var then, fns; - - fns = callOnce(this, this.$$resolve, this.$$reject); - try { - if ((isObject(val) || isFunction(val))) then = val && val.then; - if (isFunction(then)) { - this.promise.$$state.status = -1; - then.call(val, fns[0], fns[1], this.notify); - } else { - this.promise.$$state.value = val; - this.promise.$$state.status = 1; - scheduleProcessQueue(this.promise.$$state); - } - } catch (e) { - fns[1](e); - exceptionHandler(e); - } - }, - - reject: function(reason) { - if (this.promise.$$state.status) return; - this.$$reject(reason); - }, - - $$reject: function(reason) { - this.promise.$$state.value = reason; - this.promise.$$state.status = 2; - scheduleProcessQueue(this.promise.$$state); - }, - - notify: function(progress) { - var callbacks = this.promise.$$state.pending; - - if ((this.promise.$$state.status <= 0) && callbacks && callbacks.length) { - nextTick(function() { - var callback, result; - for (var i = 0, ii = callbacks.length; i < ii; i++) { - result = callbacks[i][0]; - callback = callbacks[i][3]; - try { - result.notify(isFunction(callback) ? callback(progress) : progress); - } catch (e) { - exceptionHandler(e); - } - } - }); - } - } - }; - - /** - * @ngdoc method - * @name $q#reject - * @kind function - * - * @description - * Creates a promise that is resolved as rejected with the specified `reason`. This api should be - * used to forward rejection in a chain of promises. If you are dealing with the last promise in - * a promise chain, you don't need to worry about it. - * - * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of - * `reject` as the `throw` keyword in JavaScript. This also means that if you "catch" an error via - * a promise error callback and you want to forward the error to the promise derived from the - * current promise, you have to "rethrow" the error by returning a rejection constructed via - * `reject`. - * - * ```js - * promiseB = promiseA.then(function(result) { - * // success: do something and resolve promiseB - * // with the old or a new result - * return result; - * }, function(reason) { - * // error: handle the error if possible and - * // resolve promiseB with newPromiseOrValue, - * // otherwise forward the rejection to promiseB - * if (canHandle(reason)) { - * // handle the error and recover - * return newPromiseOrValue; - * } - * return $q.reject(reason); - * }); - * ``` - * - * @param {*} reason Constant, message, exception or an object representing the rejection reason. - * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`. - */ - var reject = function(reason) { - var result = new Deferred(); - result.reject(reason); - return result.promise; - }; - - var makePromise = function makePromise(value, resolved) { - var result = new Deferred(); - if (resolved) { - result.resolve(value); - } else { - result.reject(value); - } - return result.promise; - }; - - var handleCallback = function handleCallback(value, isResolved, callback) { - var callbackOutput = null; - try { - if (isFunction(callback)) callbackOutput = callback(); - } catch (e) { - return makePromise(e, false); - } - if (isPromiseLike(callbackOutput)) { - return callbackOutput.then(function() { - return makePromise(value, isResolved); - }, function(error) { - return makePromise(error, false); - }); - } else { - return makePromise(value, isResolved); - } - }; - - /** - * @ngdoc method - * @name $q#when - * @kind function - * - * @description - * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. - * This is useful when you are dealing with an object that might or might not be a promise, or if - * the promise comes from a source that can't be trusted. - * - * @param {*} value Value or a promise - * @returns {Promise} Returns a promise of the passed value or promise - */ - - - var when = function(value, callback, errback, progressBack) { - var result = new Deferred(); - result.resolve(value); - return result.promise.then(callback, errback, progressBack); - }; - - /** - * @ngdoc method - * @name $q#all - * @kind function - * - * @description - * Combines multiple promises into a single promise that is resolved when all of the input - * promises are resolved. - * - * @param {Array.|Object.} promises An array or hash of promises. - * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values, - * each value corresponding to the promise at the same index/key in the `promises` array/hash. - * If any of the promises is resolved with a rejection, this resulting promise will be rejected - * with the same rejection value. - */ - - function all(promises) { - var deferred = new Deferred(), - counter = 0, - results = isArray(promises) ? [] : {}; - - forEach(promises, function(promise, key) { - counter++; - when(promise).then(function(value) { - if (results.hasOwnProperty(key)) return; - results[key] = value; - if (!(--counter)) deferred.resolve(results); - }, function(reason) { - if (results.hasOwnProperty(key)) return; - deferred.reject(reason); - }); - }); - - if (counter === 0) { - deferred.resolve(results); - } - - return deferred.promise; - } - - var $Q = function Q(resolver) { - if (!isFunction(resolver)) { - throw $qMinErr('norslvr', "Expected resolverFn, got '{0}'", resolver); - } - - if (!(this instanceof Q)) { - // More useful when $Q is the Promise itself. - return new Q(resolver); - } - - var deferred = new Deferred(); - - function resolveFn(value) { - deferred.resolve(value); - } - - function rejectFn(reason) { - deferred.reject(reason); - } - - resolver(resolveFn, rejectFn); - - return deferred.promise; - }; - - $Q.defer = defer; - $Q.reject = reject; - $Q.when = when; - $Q.all = all; - - return $Q; -} - -function $$RAFProvider() { //rAF - this.$get = ['$window', '$timeout', function($window, $timeout) { - var requestAnimationFrame = $window.requestAnimationFrame || - $window.webkitRequestAnimationFrame || - $window.mozRequestAnimationFrame; - - var cancelAnimationFrame = $window.cancelAnimationFrame || - $window.webkitCancelAnimationFrame || - $window.mozCancelAnimationFrame || - $window.webkitCancelRequestAnimationFrame; - - var rafSupported = !!requestAnimationFrame; - var raf = rafSupported - ? function(fn) { - var id = requestAnimationFrame(fn); - return function() { - cancelAnimationFrame(id); - }; - } - : function(fn) { - var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666 - return function() { - $timeout.cancel(timer); - }; - }; - - raf.supported = rafSupported; - - return raf; - }]; -} - -/** - * DESIGN NOTES - * - * The design decisions behind the scope are heavily favored for speed and memory consumption. - * - * The typical use of scope is to watch the expressions, which most of the time return the same - * value as last time so we optimize the operation. - * - * Closures construction is expensive in terms of speed as well as memory: - * - No closures, instead use prototypical inheritance for API - * - Internal state needs to be stored on scope directly, which means that private state is - * exposed as $$____ properties - * - * Loop operations are optimized by using while(count--) { ... } - * - this means that in order to keep the same order of execution as addition we have to add - * items to the array at the beginning (unshift) instead of at the end (push) - * - * Child scopes are created and removed often - * - Using an array would be slow since inserts in middle are expensive so we use linked list - * - * There are few watches then a lot of observers. This is why you don't want the observer to be - * implemented in the same way as watch. Watch requires return of initialization function which - * are expensive to construct. - */ - - -/** - * @ngdoc provider - * @name $rootScopeProvider - * @description - * - * Provider for the $rootScope service. - */ - -/** - * @ngdoc method - * @name $rootScopeProvider#digestTtl - * @description - * - * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and - * assuming that the model is unstable. - * - * The current default is 10 iterations. - * - * In complex applications it's possible that the dependencies between `$watch`s will result in - * several digest iterations. However if an application needs more than the default 10 digest - * iterations for its model to stabilize then you should investigate what is causing the model to - * continuously change during the digest. - * - * Increasing the TTL could have performance implications, so you should not change it without - * proper justification. - * - * @param {number} limit The number of digest iterations. - */ - - -/** - * @ngdoc service - * @name $rootScope - * @description - * - * Every application has a single root {@link ng.$rootScope.Scope scope}. - * All other scopes are descendant scopes of the root scope. Scopes provide separation - * between the model and the view, via a mechanism for watching the model for changes. - * They also provide an event emission/broadcast and subscription facility. See the - * {@link guide/scope developer guide on scopes}. - */ -function $RootScopeProvider() { - var TTL = 10; - var $rootScopeMinErr = minErr('$rootScope'); - var lastDirtyWatch = null; - var applyAsyncId = null; - - this.digestTtl = function(value) { - if (arguments.length) { - TTL = value; - } - return TTL; - }; - - this.$get = ['$injector', '$exceptionHandler', '$parse', '$browser', - function($injector, $exceptionHandler, $parse, $browser) { - - /** - * @ngdoc type - * @name $rootScope.Scope - * - * @description - * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the - * {@link auto.$injector $injector}. Child scopes are created using the - * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when - * compiled HTML template is executed.) - * - * Here is a simple scope snippet to show how you can interact with the scope. - * ```html - * - * ``` - * - * # Inheritance - * A scope can inherit from a parent scope, as in this example: - * ```js - var parent = $rootScope; - var child = parent.$new(); - - parent.salutation = "Hello"; - child.name = "World"; - expect(child.salutation).toEqual('Hello'); - - child.salutation = "Welcome"; - expect(child.salutation).toEqual('Welcome'); - expect(parent.salutation).toEqual('Hello'); - * ``` - * - * When interacting with `Scope` in tests, additional helper methods are available on the - * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional - * details. - * - * - * @param {Object.=} providers Map of service factory which need to be - * provided for the current scope. Defaults to {@link ng}. - * @param {Object.=} instanceCache Provides pre-instantiated services which should - * append/override services provided by `providers`. This is handy - * when unit-testing and having the need to override a default - * service. - * @returns {Object} Newly created scope. - * - */ - function Scope() { - this.$id = nextUid(); - this.$$phase = this.$parent = this.$$watchers = - this.$$nextSibling = this.$$prevSibling = - this.$$childHead = this.$$childTail = null; - this.$root = this; - this.$$destroyed = false; - this.$$listeners = {}; - this.$$listenerCount = {}; - this.$$isolateBindings = null; - } - - /** - * @ngdoc property - * @name $rootScope.Scope#$id - * - * @description - * Unique scope ID (monotonically increasing) useful for debugging. - */ - - /** - * @ngdoc property - * @name $rootScope.Scope#$parent - * - * @description - * Reference to the parent scope. - */ - - /** - * @ngdoc property - * @name $rootScope.Scope#$root - * - * @description - * Reference to the root scope. - */ - - Scope.prototype = { - constructor: Scope, - /** - * @ngdoc method - * @name $rootScope.Scope#$new - * @kind function - * - * @description - * Creates a new child {@link ng.$rootScope.Scope scope}. - * - * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event. - * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}. - * - * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is - * desired for the scope and its child scopes to be permanently detached from the parent and - * thus stop participating in model change detection and listener notification by invoking. - * - * @param {boolean} isolate If true, then the scope does not prototypically inherit from the - * parent scope. The scope is isolated, as it can not see parent scope properties. - * When creating widgets, it is useful for the widget to not accidentally read parent - * state. - * - * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent` - * of the newly created scope. Defaults to `this` scope if not provided. - * This is used when creating a transclude scope to correctly place it - * in the scope hierarchy while maintaining the correct prototypical - * inheritance. - * - * @returns {Object} The newly created child scope. - * - */ - $new: function(isolate, parent) { - var child; - - parent = parent || this; - - if (isolate) { - child = new Scope(); - child.$root = this.$root; - } else { - // Only create a child scope class if somebody asks for one, - // but cache it to allow the VM to optimize lookups. - if (!this.$$ChildScope) { - this.$$ChildScope = function ChildScope() { - this.$$watchers = this.$$nextSibling = - this.$$childHead = this.$$childTail = null; - this.$$listeners = {}; - this.$$listenerCount = {}; - this.$id = nextUid(); - this.$$ChildScope = null; - }; - this.$$ChildScope.prototype = this; - } - child = new this.$$ChildScope(); - } - child.$parent = parent; - child.$$prevSibling = parent.$$childTail; - if (parent.$$childHead) { - parent.$$childTail.$$nextSibling = child; - parent.$$childTail = child; - } else { - parent.$$childHead = parent.$$childTail = child; - } - - // When the new scope is not isolated or we inherit from `this`, and - // the parent scope is destroyed, the property `$$destroyed` is inherited - // prototypically. In all other cases, this property needs to be set - // when the parent scope is destroyed. - // The listener needs to be added after the parent is set - if (isolate || parent != this) child.$on('$destroy', destroyChild); - - return child; - - function destroyChild() { - child.$$destroyed = true; - } - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$watch - * @kind function - * - * @description - * Registers a `listener` callback to be executed whenever the `watchExpression` changes. - * - * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest - * $digest()} and should return the value that will be watched. (Since - * {@link ng.$rootScope.Scope#$digest $digest()} reruns when it detects changes the - * `watchExpression` can execute multiple times per - * {@link ng.$rootScope.Scope#$digest $digest()} and should be idempotent.) - * - The `listener` is called only when the value from the current `watchExpression` and the - * previous call to `watchExpression` are not equal (with the exception of the initial run, - * see below). Inequality is determined according to reference inequality, - * [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators) - * via the `!==` Javascript operator, unless `objectEquality == true` - * (see next point) - * - When `objectEquality == true`, inequality of the `watchExpression` is determined - * according to the {@link angular.equals} function. To save the value of the object for - * later comparison, the {@link angular.copy} function is used. This therefore means that - * watching complex objects will have adverse memory and performance implications. - * - The watch `listener` may change the model, which may trigger other `listener`s to fire. - * This is achieved by rerunning the watchers until no changes are detected. The rerun - * iteration limit is 10 to prevent an infinite loop deadlock. - * - * - * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called, - * you can register a `watchExpression` function with no `listener`. (Since `watchExpression` - * can execute multiple times per {@link ng.$rootScope.Scope#$digest $digest} cycle when a - * change is detected, be prepared for multiple calls to your listener.) - * - * After a watcher is registered with the scope, the `listener` fn is called asynchronously - * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the - * watcher. In rare cases, this is undesirable because the listener is called when the result - * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you - * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the - * listener was called due to initialization. - * - * - * - * # Example - * ```js - // let's assume that scope was dependency injected as the $rootScope - var scope = $rootScope; - scope.name = 'misko'; - scope.counter = 0; - - expect(scope.counter).toEqual(0); - scope.$watch('name', function(newValue, oldValue) { - scope.counter = scope.counter + 1; - }); - expect(scope.counter).toEqual(0); - - scope.$digest(); - // the listener is always called during the first $digest loop after it was registered - expect(scope.counter).toEqual(1); - - scope.$digest(); - // but now it will not be called unless the value changes - expect(scope.counter).toEqual(1); - - scope.name = 'adam'; - scope.$digest(); - expect(scope.counter).toEqual(2); - - - - // Using a function as a watchExpression - var food; - scope.foodCounter = 0; - expect(scope.foodCounter).toEqual(0); - scope.$watch( - // This function returns the value being watched. It is called for each turn of the $digest loop - function() { return food; }, - // This is the change listener, called when the value returned from the above function changes - function(newValue, oldValue) { - if ( newValue !== oldValue ) { - // Only increment the counter if the value changed - scope.foodCounter = scope.foodCounter + 1; - } - } - ); - // No digest has been run so the counter will be zero - expect(scope.foodCounter).toEqual(0); - - // Run the digest but since food has not changed count will still be zero - scope.$digest(); - expect(scope.foodCounter).toEqual(0); - - // Update food and run digest. Now the counter will increment - food = 'cheeseburger'; - scope.$digest(); - expect(scope.foodCounter).toEqual(1); - - * ``` - * - * - * - * @param {(function()|string)} watchExpression Expression that is evaluated on each - * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers - * a call to the `listener`. - * - * - `string`: Evaluated as {@link guide/expression expression} - * - `function(scope)`: called with current `scope` as a parameter. - * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value - * of `watchExpression` changes. - * - * - `newVal` contains the current value of the `watchExpression` - * - `oldVal` contains the previous value of the `watchExpression` - * - `scope` refers to the current scope - * @param {boolean=} objectEquality Compare for object equality using {@link angular.equals} instead of - * comparing for reference equality. - * @returns {function()} Returns a deregistration function for this listener. - */ - $watch: function(watchExp, listener, objectEquality) { - var get = $parse(watchExp); - - if (get.$$watchDelegate) { - return get.$$watchDelegate(this, listener, objectEquality, get); - } - var scope = this, - array = scope.$$watchers, - watcher = { - fn: listener, - last: initWatchVal, - get: get, - exp: watchExp, - eq: !!objectEquality - }; - - lastDirtyWatch = null; - - if (!isFunction(listener)) { - watcher.fn = noop; - } - - if (!array) { - array = scope.$$watchers = []; - } - // we use unshift since we use a while loop in $digest for speed. - // the while loop reads in reverse order. - array.unshift(watcher); - - return function deregisterWatch() { - arrayRemove(array, watcher); - lastDirtyWatch = null; - }; - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$watchGroup - * @kind function - * - * @description - * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`. - * If any one expression in the collection changes the `listener` is executed. - * - * - The items in the `watchExpressions` array are observed via standard $watch operation and are examined on every - * call to $digest() to see if any items changes. - * - The `listener` is called whenever any expression in the `watchExpressions` array changes. - * - * @param {Array.} watchExpressions Array of expressions that will be individually - * watched using {@link ng.$rootScope.Scope#$watch $watch()} - * - * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any - * expression in `watchExpressions` changes - * The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching - * those of `watchExpression` - * and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching - * those of `watchExpression` - * The `scope` refers to the current scope. - * @returns {function()} Returns a de-registration function for all listeners. - */ - $watchGroup: function(watchExpressions, listener) { - var oldValues = new Array(watchExpressions.length); - var newValues = new Array(watchExpressions.length); - var deregisterFns = []; - var self = this; - var changeReactionScheduled = false; - var firstRun = true; - - if (!watchExpressions.length) { - // No expressions means we call the listener ASAP - var shouldCall = true; - self.$evalAsync(function() { - if (shouldCall) listener(newValues, newValues, self); - }); - return function deregisterWatchGroup() { - shouldCall = false; - }; - } - - if (watchExpressions.length === 1) { - // Special case size of one - return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) { - newValues[0] = value; - oldValues[0] = oldValue; - listener(newValues, (value === oldValue) ? newValues : oldValues, scope); - }); - } - - forEach(watchExpressions, function(expr, i) { - var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) { - newValues[i] = value; - oldValues[i] = oldValue; - if (!changeReactionScheduled) { - changeReactionScheduled = true; - self.$evalAsync(watchGroupAction); - } - }); - deregisterFns.push(unwatchFn); - }); - - function watchGroupAction() { - changeReactionScheduled = false; - - if (firstRun) { - firstRun = false; - listener(newValues, newValues, self); - } else { - listener(newValues, oldValues, self); - } - } - - return function deregisterWatchGroup() { - while (deregisterFns.length) { - deregisterFns.shift()(); - } - }; - }, - - - /** - * @ngdoc method - * @name $rootScope.Scope#$watchCollection - * @kind function - * - * @description - * Shallow watches the properties of an object and fires whenever any of the properties change - * (for arrays, this implies watching the array items; for object maps, this implies watching - * the properties). If a change is detected, the `listener` callback is fired. - * - * - The `obj` collection is observed via standard $watch operation and is examined on every - * call to $digest() to see if any items have been added, removed, or moved. - * - The `listener` is called whenever anything within the `obj` has changed. Examples include - * adding, removing, and moving items belonging to an object or array. - * - * - * # Example - * ```js - $scope.names = ['igor', 'matias', 'misko', 'james']; - $scope.dataCount = 4; - - $scope.$watchCollection('names', function(newNames, oldNames) { - $scope.dataCount = newNames.length; - }); - - expect($scope.dataCount).toEqual(4); - $scope.$digest(); - - //still at 4 ... no changes - expect($scope.dataCount).toEqual(4); - - $scope.names.pop(); - $scope.$digest(); - - //now there's been a change - expect($scope.dataCount).toEqual(3); - * ``` - * - * - * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The - * expression value should evaluate to an object or an array which is observed on each - * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the - * collection will trigger a call to the `listener`. - * - * @param {function(newCollection, oldCollection, scope)} listener a callback function called - * when a change is detected. - * - The `newCollection` object is the newly modified data obtained from the `obj` expression - * - The `oldCollection` object is a copy of the former collection data. - * Due to performance considerations, the`oldCollection` value is computed only if the - * `listener` function declares two or more arguments. - * - The `scope` argument refers to the current scope. - * - * @returns {function()} Returns a de-registration function for this listener. When the - * de-registration function is executed, the internal watch operation is terminated. - */ - $watchCollection: function(obj, listener) { - $watchCollectionInterceptor.$stateful = true; - - var self = this; - // the current value, updated on each dirty-check run - var newValue; - // a shallow copy of the newValue from the last dirty-check run, - // updated to match newValue during dirty-check run - var oldValue; - // a shallow copy of the newValue from when the last change happened - var veryOldValue; - // only track veryOldValue if the listener is asking for it - var trackVeryOldValue = (listener.length > 1); - var changeDetected = 0; - var changeDetector = $parse(obj, $watchCollectionInterceptor); - var internalArray = []; - var internalObject = {}; - var initRun = true; - var oldLength = 0; - - function $watchCollectionInterceptor(_value) { - newValue = _value; - var newLength, key, bothNaN, newItem, oldItem; - - // If the new value is undefined, then return undefined as the watch may be a one-time watch - if (isUndefined(newValue)) return; - - if (!isObject(newValue)) { // if primitive - if (oldValue !== newValue) { - oldValue = newValue; - changeDetected++; - } - } else if (isArrayLike(newValue)) { - if (oldValue !== internalArray) { - // we are transitioning from something which was not an array into array. - oldValue = internalArray; - oldLength = oldValue.length = 0; - changeDetected++; - } - - newLength = newValue.length; - - if (oldLength !== newLength) { - // if lengths do not match we need to trigger change notification - changeDetected++; - oldValue.length = oldLength = newLength; - } - // copy the items to oldValue and look for changes. - for (var i = 0; i < newLength; i++) { - oldItem = oldValue[i]; - newItem = newValue[i]; - - bothNaN = (oldItem !== oldItem) && (newItem !== newItem); - if (!bothNaN && (oldItem !== newItem)) { - changeDetected++; - oldValue[i] = newItem; - } - } - } else { - if (oldValue !== internalObject) { - // we are transitioning from something which was not an object into object. - oldValue = internalObject = {}; - oldLength = 0; - changeDetected++; - } - // copy the items to oldValue and look for changes. - newLength = 0; - for (key in newValue) { - if (newValue.hasOwnProperty(key)) { - newLength++; - newItem = newValue[key]; - oldItem = oldValue[key]; - - if (key in oldValue) { - bothNaN = (oldItem !== oldItem) && (newItem !== newItem); - if (!bothNaN && (oldItem !== newItem)) { - changeDetected++; - oldValue[key] = newItem; - } - } else { - oldLength++; - oldValue[key] = newItem; - changeDetected++; - } - } - } - if (oldLength > newLength) { - // we used to have more keys, need to find them and destroy them. - changeDetected++; - for (key in oldValue) { - if (!newValue.hasOwnProperty(key)) { - oldLength--; - delete oldValue[key]; - } - } - } - } - return changeDetected; - } - - function $watchCollectionAction() { - if (initRun) { - initRun = false; - listener(newValue, newValue, self); - } else { - listener(newValue, veryOldValue, self); - } - - // make a copy for the next time a collection is changed - if (trackVeryOldValue) { - if (!isObject(newValue)) { - //primitive - veryOldValue = newValue; - } else if (isArrayLike(newValue)) { - veryOldValue = new Array(newValue.length); - for (var i = 0; i < newValue.length; i++) { - veryOldValue[i] = newValue[i]; - } - } else { // if object - veryOldValue = {}; - for (var key in newValue) { - if (hasOwnProperty.call(newValue, key)) { - veryOldValue[key] = newValue[key]; - } - } - } - } - } - - return this.$watch(changeDetector, $watchCollectionAction); - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$digest - * @kind function - * - * @description - * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and - * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change - * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers} - * until no more listeners are firing. This means that it is possible to get into an infinite - * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of - * iterations exceeds 10. - * - * Usually, you don't call `$digest()` directly in - * {@link ng.directive:ngController controllers} or in - * {@link ng.$compileProvider#directive directives}. - * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within - * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`. - * - * If you want to be notified whenever `$digest()` is called, - * you can register a `watchExpression` function with - * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`. - * - * In unit tests, you may need to call `$digest()` to simulate the scope life cycle. - * - * # Example - * ```js - var scope = ...; - scope.name = 'misko'; - scope.counter = 0; - - expect(scope.counter).toEqual(0); - scope.$watch('name', function(newValue, oldValue) { - scope.counter = scope.counter + 1; - }); - expect(scope.counter).toEqual(0); - - scope.$digest(); - // the listener is always called during the first $digest loop after it was registered - expect(scope.counter).toEqual(1); - - scope.$digest(); - // but now it will not be called unless the value changes - expect(scope.counter).toEqual(1); - - scope.name = 'adam'; - scope.$digest(); - expect(scope.counter).toEqual(2); - * ``` - * - */ - $digest: function() { - var watch, value, last, - watchers, - length, - dirty, ttl = TTL, - next, current, target = this, - watchLog = [], - logIdx, logMsg, asyncTask; - - beginPhase('$digest'); - // Check for changes to browser url that happened in sync before the call to $digest - $browser.$$checkUrlChange(); - - if (this === $rootScope && applyAsyncId !== null) { - // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then - // cancel the scheduled $apply and flush the queue of expressions to be evaluated. - $browser.defer.cancel(applyAsyncId); - flushApplyAsync(); - } - - lastDirtyWatch = null; - - do { // "while dirty" loop - dirty = false; - current = target; - - while (asyncQueue.length) { - try { - asyncTask = asyncQueue.shift(); - asyncTask.scope.$eval(asyncTask.expression); - } catch (e) { - $exceptionHandler(e); - } - lastDirtyWatch = null; - } - - traverseScopesLoop: - do { // "traverse the scopes" loop - if ((watchers = current.$$watchers)) { - // process our watches - length = watchers.length; - while (length--) { - try { - watch = watchers[length]; - // Most common watches are on primitives, in which case we can short - // circuit it with === operator, only when === fails do we use .equals - if (watch) { - if ((value = watch.get(current)) !== (last = watch.last) && - !(watch.eq - ? equals(value, last) - : (typeof value === 'number' && typeof last === 'number' - && isNaN(value) && isNaN(last)))) { - dirty = true; - lastDirtyWatch = watch; - watch.last = watch.eq ? copy(value, null) : value; - watch.fn(value, ((last === initWatchVal) ? value : last), current); - if (ttl < 5) { - logIdx = 4 - ttl; - if (!watchLog[logIdx]) watchLog[logIdx] = []; - watchLog[logIdx].push({ - msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp, - newVal: value, - oldVal: last - }); - } - } else if (watch === lastDirtyWatch) { - // If the most recently dirty watcher is now clean, short circuit since the remaining watchers - // have already been tested. - dirty = false; - break traverseScopesLoop; - } - } - } catch (e) { - $exceptionHandler(e); - } - } - } - - // Insanity Warning: scope depth-first traversal - // yes, this code is a bit crazy, but it works and we have tests to prove it! - // this piece should be kept in sync with the traversal in $broadcast - if (!(next = (current.$$childHead || - (current !== target && current.$$nextSibling)))) { - while (current !== target && !(next = current.$$nextSibling)) { - current = current.$parent; - } - } - } while ((current = next)); - - // `break traverseScopesLoop;` takes us to here - - if ((dirty || asyncQueue.length) && !(ttl--)) { - clearPhase(); - throw $rootScopeMinErr('infdig', - '{0} $digest() iterations reached. Aborting!\n' + - 'Watchers fired in the last 5 iterations: {1}', - TTL, watchLog); - } - - } while (dirty || asyncQueue.length); - - clearPhase(); - - while (postDigestQueue.length) { - try { - postDigestQueue.shift()(); - } catch (e) { - $exceptionHandler(e); - } - } - }, - - - /** - * @ngdoc event - * @name $rootScope.Scope#$destroy - * @eventType broadcast on scope being destroyed - * - * @description - * Broadcasted when a scope and its children are being destroyed. - * - * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to - * clean up DOM bindings before an element is removed from the DOM. - */ - - /** - * @ngdoc method - * @name $rootScope.Scope#$destroy - * @kind function - * - * @description - * Removes the current scope (and all of its children) from the parent scope. Removal implies - * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer - * propagate to the current scope and its children. Removal also implies that the current - * scope is eligible for garbage collection. - * - * The `$destroy()` is usually used by directives such as - * {@link ng.directive:ngRepeat ngRepeat} for managing the - * unrolling of the loop. - * - * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope. - * Application code can register a `$destroy` event handler that will give it a chance to - * perform any necessary cleanup. - * - * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to - * clean up DOM bindings before an element is removed from the DOM. - */ - $destroy: function() { - // we can't destroy the root scope or a scope that has been already destroyed - if (this.$$destroyed) return; - var parent = this.$parent; - - this.$broadcast('$destroy'); - this.$$destroyed = true; - if (this === $rootScope) return; - - for (var eventName in this.$$listenerCount) { - decrementListenerCount(this, this.$$listenerCount[eventName], eventName); - } - - // sever all the references to parent scopes (after this cleanup, the current scope should - // not be retained by any of our references and should be eligible for garbage collection) - if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling; - if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling; - if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling; - if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling; - - // Disable listeners, watchers and apply/digest methods - this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop; - this.$on = this.$watch = this.$watchGroup = function() { return noop; }; - this.$$listeners = {}; - - // All of the code below is bogus code that works around V8's memory leak via optimized code - // and inline caches. - // - // see: - // - https://code.google.com/p/v8/issues/detail?id=2073#c26 - // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909 - // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451 - - this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead = - this.$$childTail = this.$root = this.$$watchers = null; - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$eval - * @kind function - * - * @description - * Executes the `expression` on the current scope and returns the result. Any exceptions in - * the expression are propagated (uncaught). This is useful when evaluating Angular - * expressions. - * - * # Example - * ```js - var scope = ng.$rootScope.Scope(); - scope.a = 1; - scope.b = 2; - - expect(scope.$eval('a+b')).toEqual(3); - expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3); - * ``` - * - * @param {(string|function())=} expression An angular expression to be executed. - * - * - `string`: execute using the rules as defined in {@link guide/expression expression}. - * - `function(scope)`: execute the function with the current `scope` parameter. - * - * @param {(object)=} locals Local variables object, useful for overriding values in scope. - * @returns {*} The result of evaluating the expression. - */ - $eval: function(expr, locals) { - return $parse(expr)(this, locals); - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$evalAsync - * @kind function - * - * @description - * Executes the expression on the current scope at a later point in time. - * - * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only - * that: - * - * - it will execute after the function that scheduled the evaluation (preferably before DOM - * rendering). - * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after - * `expression` execution. - * - * Any exceptions from the execution of the expression are forwarded to the - * {@link ng.$exceptionHandler $exceptionHandler} service. - * - * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle - * will be scheduled. However, it is encouraged to always call code that changes the model - * from within an `$apply` call. That includes code evaluated via `$evalAsync`. - * - * @param {(string|function())=} expression An angular expression to be executed. - * - * - `string`: execute using the rules as defined in {@link guide/expression expression}. - * - `function(scope)`: execute the function with the current `scope` parameter. - * - */ - $evalAsync: function(expr) { - // if we are outside of an $digest loop and this is the first time we are scheduling async - // task also schedule async auto-flush - if (!$rootScope.$$phase && !asyncQueue.length) { - $browser.defer(function() { - if (asyncQueue.length) { - $rootScope.$digest(); - } - }); - } - - asyncQueue.push({scope: this, expression: expr}); - }, - - $$postDigest: function(fn) { - postDigestQueue.push(fn); - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$apply - * @kind function - * - * @description - * `$apply()` is used to execute an expression in angular from outside of the angular - * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries). - * Because we are calling into the angular framework we need to perform proper scope life - * cycle of {@link ng.$exceptionHandler exception handling}, - * {@link ng.$rootScope.Scope#$digest executing watches}. - * - * ## Life cycle - * - * # Pseudo-Code of `$apply()` - * ```js - function $apply(expr) { - try { - return $eval(expr); - } catch (e) { - $exceptionHandler(e); - } finally { - $root.$digest(); - } - } - * ``` - * - * - * Scope's `$apply()` method transitions through the following stages: - * - * 1. The {@link guide/expression expression} is executed using the - * {@link ng.$rootScope.Scope#$eval $eval()} method. - * 2. Any exceptions from the execution of the expression are forwarded to the - * {@link ng.$exceptionHandler $exceptionHandler} service. - * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the - * expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method. - * - * - * @param {(string|function())=} exp An angular expression to be executed. - * - * - `string`: execute using the rules as defined in {@link guide/expression expression}. - * - `function(scope)`: execute the function with current `scope` parameter. - * - * @returns {*} The result of evaluating the expression. - */ - $apply: function(expr) { - try { - beginPhase('$apply'); - return this.$eval(expr); - } catch (e) { - $exceptionHandler(e); - } finally { - clearPhase(); - try { - $rootScope.$digest(); - } catch (e) { - $exceptionHandler(e); - throw e; - } - } - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$applyAsync - * @kind function - * - * @description - * Schedule the invokation of $apply to occur at a later time. The actual time difference - * varies across browsers, but is typically around ~10 milliseconds. - * - * This can be used to queue up multiple expressions which need to be evaluated in the same - * digest. - * - * @param {(string|function())=} exp An angular expression to be executed. - * - * - `string`: execute using the rules as defined in {@link guide/expression expression}. - * - `function(scope)`: execute the function with current `scope` parameter. - */ - $applyAsync: function(expr) { - var scope = this; - expr && applyAsyncQueue.push($applyAsyncExpression); - scheduleApplyAsync(); - - function $applyAsyncExpression() { - scope.$eval(expr); - } - }, - - /** - * @ngdoc method - * @name $rootScope.Scope#$on - * @kind function - * - * @description - * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for - * discussion of event life cycle. - * - * The event listener function format is: `function(event, args...)`. The `event` object - * passed into the listener has the following attributes: - * - * - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or - * `$broadcast`-ed. - * - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the - * event propagates through the scope hierarchy, this property is set to null. - * - `name` - `{string}`: name of the event. - * - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel - * further event propagation (available only for events that were `$emit`-ed). - * - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag - * to true. - * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called. - * - * @param {string} name Event name to listen on. - * @param {function(event, ...args)} listener Function to call when the event is emitted. - * @returns {function()} Returns a deregistration function for this listener. - */ - $on: function(name, listener) { - var namedListeners = this.$$listeners[name]; - if (!namedListeners) { - this.$$listeners[name] = namedListeners = []; - } - namedListeners.push(listener); - - var current = this; - do { - if (!current.$$listenerCount[name]) { - current.$$listenerCount[name] = 0; - } - current.$$listenerCount[name]++; - } while ((current = current.$parent)); - - var self = this; - return function() { - var indexOfListener = namedListeners.indexOf(listener); - if (indexOfListener !== -1) { - namedListeners[indexOfListener] = null; - decrementListenerCount(self, 1, name); - } - }; - }, - - - /** - * @ngdoc method - * @name $rootScope.Scope#$emit - * @kind function - * - * @description - * Dispatches an event `name` upwards through the scope hierarchy notifying the - * registered {@link ng.$rootScope.Scope#$on} listeners. - * - * The event life cycle starts at the scope on which `$emit` was called. All - * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get - * notified. Afterwards, the event traverses upwards toward the root scope and calls all - * registered listeners along the way. The event will stop propagating if one of the listeners - * cancels it. - * - * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed - * onto the {@link ng.$exceptionHandler $exceptionHandler} service. - * - * @param {string} name Event name to emit. - * @param {...*} args Optional one or more arguments which will be passed onto the event listeners. - * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}). - */ - $emit: function(name, args) { - var empty = [], - namedListeners, - scope = this, - stopPropagation = false, - event = { - name: name, - targetScope: scope, - stopPropagation: function() {stopPropagation = true;}, - preventDefault: function() { - event.defaultPrevented = true; - }, - defaultPrevented: false - }, - listenerArgs = concat([event], arguments, 1), - i, length; - - do { - namedListeners = scope.$$listeners[name] || empty; - event.currentScope = scope; - for (i = 0, length = namedListeners.length; i < length; i++) { - - // if listeners were deregistered, defragment the array - if (!namedListeners[i]) { - namedListeners.splice(i, 1); - i--; - length--; - continue; - } - try { - //allow all listeners attached to the current scope to run - namedListeners[i].apply(null, listenerArgs); - } catch (e) { - $exceptionHandler(e); - } - } - //if any listener on the current scope stops propagation, prevent bubbling - if (stopPropagation) { - event.currentScope = null; - return event; - } - //traverse upwards - scope = scope.$parent; - } while (scope); - - event.currentScope = null; - - return event; - }, - - - /** - * @ngdoc method - * @name $rootScope.Scope#$broadcast - * @kind function - * - * @description - * Dispatches an event `name` downwards to all child scopes (and their children) notifying the - * registered {@link ng.$rootScope.Scope#$on} listeners. - * - * The event life cycle starts at the scope on which `$broadcast` was called. All - * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get - * notified. Afterwards, the event propagates to all direct and indirect scopes of the current - * scope and calls all registered listeners along the way. The event cannot be canceled. - * - * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed - * onto the {@link ng.$exceptionHandler $exceptionHandler} service. - * - * @param {string} name Event name to broadcast. - * @param {...*} args Optional one or more arguments which will be passed onto the event listeners. - * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on} - */ - $broadcast: function(name, args) { - var target = this, - current = target, - next = target, - event = { - name: name, - targetScope: target, - preventDefault: function() { - event.defaultPrevented = true; - }, - defaultPrevented: false - }; - - if (!target.$$listenerCount[name]) return event; - - var listenerArgs = concat([event], arguments, 1), - listeners, i, length; - - //down while you can, then up and next sibling or up and next sibling until back at root - while ((current = next)) { - event.currentScope = current; - listeners = current.$$listeners[name] || []; - for (i = 0, length = listeners.length; i < length; i++) { - // if listeners were deregistered, defragment the array - if (!listeners[i]) { - listeners.splice(i, 1); - i--; - length--; - continue; - } - - try { - listeners[i].apply(null, listenerArgs); - } catch (e) { - $exceptionHandler(e); - } - } - - // Insanity Warning: scope depth-first traversal - // yes, this code is a bit crazy, but it works and we have tests to prove it! - // this piece should be kept in sync with the traversal in $digest - // (though it differs due to having the extra check for $$listenerCount) - if (!(next = ((current.$$listenerCount[name] && current.$$childHead) || - (current !== target && current.$$nextSibling)))) { - while (current !== target && !(next = current.$$nextSibling)) { - current = current.$parent; - } - } - } - - event.currentScope = null; - return event; - } - }; - - var $rootScope = new Scope(); - - //The internal queues. Expose them on the $rootScope for debugging/testing purposes. - var asyncQueue = $rootScope.$$asyncQueue = []; - var postDigestQueue = $rootScope.$$postDigestQueue = []; - var applyAsyncQueue = $rootScope.$$applyAsyncQueue = []; - - return $rootScope; - - - function beginPhase(phase) { - if ($rootScope.$$phase) { - throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase); - } - - $rootScope.$$phase = phase; - } - - function clearPhase() { - $rootScope.$$phase = null; - } - - - function decrementListenerCount(current, count, name) { - do { - current.$$listenerCount[name] -= count; - - if (current.$$listenerCount[name] === 0) { - delete current.$$listenerCount[name]; - } - } while ((current = current.$parent)); - } - - /** - * function used as an initial value for watchers. - * because it's unique we can easily tell it apart from other values - */ - function initWatchVal() {} - - function flushApplyAsync() { - while (applyAsyncQueue.length) { - try { - applyAsyncQueue.shift()(); - } catch (e) { - $exceptionHandler(e); - } - } - applyAsyncId = null; - } - - function scheduleApplyAsync() { - if (applyAsyncId === null) { - applyAsyncId = $browser.defer(function() { - $rootScope.$apply(flushApplyAsync); - }); - } - } - }]; -} - -/** - * @description - * Private service to sanitize uris for links and images. Used by $compile and $sanitize. - */ -function $$SanitizeUriProvider() { - var aHrefSanitizationWhitelist = /^\s*(https?|ftp|mailto|tel|file):/, - imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/; - - /** - * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe - * urls during a[href] sanitization. - * - * The sanitization is a security measure aimed at prevent XSS attacks via html links. - * - * Any url about to be assigned to a[href] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. - * - * @param {RegExp=} regexp New regexp to whitelist urls with. - * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for - * chaining otherwise. - */ - this.aHrefSanitizationWhitelist = function(regexp) { - if (isDefined(regexp)) { - aHrefSanitizationWhitelist = regexp; - return this; - } - return aHrefSanitizationWhitelist; - }; - - - /** - * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe - * urls during img[src] sanitization. - * - * The sanitization is a security measure aimed at prevent XSS attacks via html links. - * - * Any url about to be assigned to img[src] via data-binding is first normalized and turned into - * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` - * regular expression. If a match is found, the original url is written into the dom. Otherwise, - * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. - * - * @param {RegExp=} regexp New regexp to whitelist urls with. - * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for - * chaining otherwise. - */ - this.imgSrcSanitizationWhitelist = function(regexp) { - if (isDefined(regexp)) { - imgSrcSanitizationWhitelist = regexp; - return this; - } - return imgSrcSanitizationWhitelist; - }; - - this.$get = function() { - return function sanitizeUri(uri, isImage) { - var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist; - var normalizedVal; - normalizedVal = urlResolve(uri).href; - if (normalizedVal !== '' && !normalizedVal.match(regex)) { - return 'unsafe:' + normalizedVal; - } - return uri; - }; - }; -} - -var $sceMinErr = minErr('$sce'); - -var SCE_CONTEXTS = { - HTML: 'html', - CSS: 'css', - URL: 'url', - // RESOURCE_URL is a subtype of URL used in contexts where a privileged resource is sourced from a - // url. (e.g. ng-include, script src, templateUrl) - RESOURCE_URL: 'resourceUrl', - JS: 'js' -}; - -// Helper functions follow. - -function adjustMatcher(matcher) { - if (matcher === 'self') { - return matcher; - } else if (isString(matcher)) { - // Strings match exactly except for 2 wildcards - '*' and '**'. - // '*' matches any character except those from the set ':/.?&'. - // '**' matches any character (like .* in a RegExp). - // More than 2 *'s raises an error as it's ill defined. - if (matcher.indexOf('***') > -1) { - throw $sceMinErr('iwcard', - 'Illegal sequence *** in string matcher. String: {0}', matcher); - } - matcher = escapeForRegexp(matcher). - replace('\\*\\*', '.*'). - replace('\\*', '[^:/.?&;]*'); - return new RegExp('^' + matcher + '$'); - } else if (isRegExp(matcher)) { - // The only other type of matcher allowed is a Regexp. - // Match entire URL / disallow partial matches. - // Flags are reset (i.e. no global, ignoreCase or multiline) - return new RegExp('^' + matcher.source + '$'); - } else { - throw $sceMinErr('imatcher', - 'Matchers may only be "self", string patterns or RegExp objects'); - } -} - - -function adjustMatchers(matchers) { - var adjustedMatchers = []; - if (isDefined(matchers)) { - forEach(matchers, function(matcher) { - adjustedMatchers.push(adjustMatcher(matcher)); - }); - } - return adjustedMatchers; -} - - -/** - * @ngdoc service - * @name $sceDelegate - * @kind function - * - * @description - * - * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict - * Contextual Escaping (SCE)} services to AngularJS. - * - * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of - * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS. This is - * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to - * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things - * work because `$sce` delegates to `$sceDelegate` for these operations. - * - * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service. - * - * The default instance of `$sceDelegate` should work out of the box with little pain. While you - * can override it completely to change the behavior of `$sce`, the common case would - * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting - * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as - * templates. Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist - * $sceDelegateProvider.resourceUrlWhitelist} and {@link - * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist} - */ - -/** - * @ngdoc provider - * @name $sceDelegateProvider - * @description - * - * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate - * $sceDelegate} service. This allows one to get/set the whitelists and blacklists used to ensure - * that the URLs used for sourcing Angular templates are safe. Refer {@link - * ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} and - * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist} - * - * For the general details about this service in Angular, read the main page for {@link ng.$sce - * Strict Contextual Escaping (SCE)}. - * - * **Example**: Consider the following case. - * - * - your app is hosted at url `http://myapp.example.com/` - * - but some of your templates are hosted on other domains you control such as - * `http://srv01.assets.example.com/`,  `http://srv02.assets.example.com/`, etc. - * - and you have an open redirect at `http://myapp.example.com/clickThru?...`. - * - * Here is what a secure configuration for this scenario might look like: - * - * ``` - * angular.module('myApp', []).config(function($sceDelegateProvider) { - * $sceDelegateProvider.resourceUrlWhitelist([ - * // Allow same origin resource loads. - * 'self', - * // Allow loading from our assets domain. Notice the difference between * and **. - * 'http://srv*.assets.example.com/**' - * ]); - * - * // The blacklist overrides the whitelist so the open redirect here is blocked. - * $sceDelegateProvider.resourceUrlBlacklist([ - * 'http://myapp.example.com/clickThru**' - * ]); - * }); - * ``` - */ - -function $SceDelegateProvider() { - this.SCE_CONTEXTS = SCE_CONTEXTS; - - // Resource URLs can also be trusted by policy. - var resourceUrlWhitelist = ['self'], - resourceUrlBlacklist = []; - - /** - * @ngdoc method - * @name $sceDelegateProvider#resourceUrlWhitelist - * @kind function - * - * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value - * provided. This must be an array or null. A snapshot of this array is used so further - * changes to the array are ignored. - * - * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items - * allowed in this array. - * - * Note: **an empty whitelist array will block all URLs**! - * - * @return {Array} the currently set whitelist array. - * - * The **default value** when no whitelist has been explicitly set is `['self']` allowing only - * same origin resource requests. - * - * @description - * Sets/Gets the whitelist of trusted resource URLs. - */ - this.resourceUrlWhitelist = function(value) { - if (arguments.length) { - resourceUrlWhitelist = adjustMatchers(value); - } - return resourceUrlWhitelist; - }; - - /** - * @ngdoc method - * @name $sceDelegateProvider#resourceUrlBlacklist - * @kind function - * - * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value - * provided. This must be an array or null. A snapshot of this array is used so further - * changes to the array are ignored. - * - * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items - * allowed in this array. - * - * The typical usage for the blacklist is to **block - * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as - * these would otherwise be trusted but actually return content from the redirected domain. - * - * Finally, **the blacklist overrides the whitelist** and has the final say. - * - * @return {Array} the currently set blacklist array. - * - * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there - * is no blacklist.) - * - * @description - * Sets/Gets the blacklist of trusted resource URLs. - */ - - this.resourceUrlBlacklist = function(value) { - if (arguments.length) { - resourceUrlBlacklist = adjustMatchers(value); - } - return resourceUrlBlacklist; - }; - - this.$get = ['$injector', function($injector) { - - var htmlSanitizer = function htmlSanitizer(html) { - throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.'); - }; - - if ($injector.has('$sanitize')) { - htmlSanitizer = $injector.get('$sanitize'); - } - - - function matchUrl(matcher, parsedUrl) { - if (matcher === 'self') { - return urlIsSameOrigin(parsedUrl); - } else { - // definitely a regex. See adjustMatchers() - return !!matcher.exec(parsedUrl.href); - } - } - - function isResourceUrlAllowedByPolicy(url) { - var parsedUrl = urlResolve(url.toString()); - var i, n, allowed = false; - // Ensure that at least one item from the whitelist allows this url. - for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) { - if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) { - allowed = true; - break; - } - } - if (allowed) { - // Ensure that no item from the blacklist blocked this url. - for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) { - if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) { - allowed = false; - break; - } - } - } - return allowed; - } - - function generateHolderType(Base) { - var holderType = function TrustedValueHolderType(trustedValue) { - this.$$unwrapTrustedValue = function() { - return trustedValue; - }; - }; - if (Base) { - holderType.prototype = new Base(); - } - holderType.prototype.valueOf = function sceValueOf() { - return this.$$unwrapTrustedValue(); - }; - holderType.prototype.toString = function sceToString() { - return this.$$unwrapTrustedValue().toString(); - }; - return holderType; - } - - var trustedValueHolderBase = generateHolderType(), - byType = {}; - - byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase); - byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase); - byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase); - byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase); - byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]); - - /** - * @ngdoc method - * @name $sceDelegate#trustAs - * - * @description - * Returns an object that is trusted by angular for use in specified strict - * contextual escaping contexts (such as ng-bind-html, ng-include, any src - * attribute interpolation, any dom event binding attribute interpolation - * such as for onclick, etc.) that uses the provided value. - * See {@link ng.$sce $sce} for enabling strict contextual escaping. - * - * @param {string} type The kind of context in which this value is safe for use. e.g. url, - * resourceUrl, html, js and css. - * @param {*} value The value that that should be considered trusted/safe. - * @returns {*} A value that can be used to stand in for the provided `value` in places - * where Angular expects a $sce.trustAs() return value. - */ - function trustAs(type, trustedValue) { - var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null); - if (!Constructor) { - throw $sceMinErr('icontext', - 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}', - type, trustedValue); - } - if (trustedValue === null || trustedValue === undefined || trustedValue === '') { - return trustedValue; - } - // All the current contexts in SCE_CONTEXTS happen to be strings. In order to avoid trusting - // mutable objects, we ensure here that the value passed in is actually a string. - if (typeof trustedValue !== 'string') { - throw $sceMinErr('itype', - 'Attempted to trust a non-string value in a content requiring a string: Context: {0}', - type); - } - return new Constructor(trustedValue); - } - - /** - * @ngdoc method - * @name $sceDelegate#valueOf - * - * @description - * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs - * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link - * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. - * - * If the passed parameter is not a value that had been returned by {@link - * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, returns it as-is. - * - * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} - * call or anything else. - * @returns {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs - * `$sceDelegate.trustAs`} if `value` is the result of such a call. Otherwise, returns - * `value` unchanged. - */ - function valueOf(maybeTrusted) { - if (maybeTrusted instanceof trustedValueHolderBase) { - return maybeTrusted.$$unwrapTrustedValue(); - } else { - return maybeTrusted; - } - } - - /** - * @ngdoc method - * @name $sceDelegate#getTrusted - * - * @description - * Takes the result of a {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call and - * returns the originally supplied value if the queried context type is a supertype of the - * created type. If this condition isn't satisfied, throws an exception. - * - * @param {string} type The kind of context in which this value is to be used. - * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs - * `$sceDelegate.trustAs`} call. - * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#trustAs - * `$sceDelegate.trustAs`} if valid in this context. Otherwise, throws an exception. - */ - function getTrusted(type, maybeTrusted) { - if (maybeTrusted === null || maybeTrusted === undefined || maybeTrusted === '') { - return maybeTrusted; - } - var constructor = (byType.hasOwnProperty(type) ? byType[type] : null); - if (constructor && maybeTrusted instanceof constructor) { - return maybeTrusted.$$unwrapTrustedValue(); - } - // If we get here, then we may only take one of two actions. - // 1. sanitize the value for the requested type, or - // 2. throw an exception. - if (type === SCE_CONTEXTS.RESOURCE_URL) { - if (isResourceUrlAllowedByPolicy(maybeTrusted)) { - return maybeTrusted; - } else { - throw $sceMinErr('insecurl', - 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}', - maybeTrusted.toString()); - } - } else if (type === SCE_CONTEXTS.HTML) { - return htmlSanitizer(maybeTrusted); - } - throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.'); - } - - return { trustAs: trustAs, - getTrusted: getTrusted, - valueOf: valueOf }; - }]; -} - - -/** - * @ngdoc provider - * @name $sceProvider - * @description - * - * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service. - * - enable/disable Strict Contextual Escaping (SCE) in a module - * - override the default implementation with a custom delegate - * - * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}. - */ - -/* jshint maxlen: false*/ - -/** - * @ngdoc service - * @name $sce - * @kind function - * - * @description - * - * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS. - * - * # Strict Contextual Escaping - * - * Strict Contextual Escaping (SCE) is a mode in which AngularJS requires bindings in certain - * contexts to result in a value that is marked as safe to use for that context. One example of - * such a context is binding arbitrary html controlled by the user via `ng-bind-html`. We refer - * to these contexts as privileged or SCE contexts. - * - * As of version 1.2, Angular ships with SCE enabled by default. - * - * Note: When enabled (the default), IE<11 in quirks mode is not supported. In this mode, IE<11 allow - * one to execute arbitrary javascript by the use of the expression() syntax. Refer - * to learn more about them. - * You can ensure your document is in standards mode and not quirks mode by adding `` - * to the top of your HTML document. - * - * SCE assists in writing code in way that (a) is secure by default and (b) makes auditing for - * security vulnerabilities such as XSS, clickjacking, etc. a lot easier. - * - * Here's an example of a binding in a privileged context: - * - * ``` - * - *
- * ``` - * - * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user. With SCE - * disabled, this application allows the user to render arbitrary HTML into the DIV. - * In a more realistic example, one may be rendering user comments, blog articles, etc. via - * bindings. (HTML is just one example of a context where rendering user controlled input creates - * security vulnerabilities.) - * - * For the case of HTML, you might use a library, either on the client side, or on the server side, - * to sanitize unsafe HTML before binding to the value and rendering it in the document. - * - * How would you ensure that every place that used these types of bindings was bound to a value that - * was sanitized by your library (or returned as safe for rendering by your server?) How can you - * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some - * properties/fields and forgot to update the binding to the sanitized value? - * - * To be secure by default, you want to ensure that any such bindings are disallowed unless you can - * determine that something explicitly says it's safe to use a value for binding in that - * context. You can then audit your code (a simple grep would do) to ensure that this is only done - * for those values that you can easily tell are safe - because they were received from your server, - * sanitized by your library, etc. You can organize your codebase to help with this - perhaps - * allowing only the files in a specific directory to do this. Ensuring that the internal API - * exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task. - * - * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs} - * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to - * obtain values that will be accepted by SCE / privileged contexts. - * - * - * ## How does it work? - * - * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted - * $sce.getTrusted(context, value)} rather than to the value directly. Directives use {@link - * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs the - * {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals. - * - * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link - * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly - * simplified): - * - * ``` - * var ngBindHtmlDirective = ['$sce', function($sce) { - * return function(scope, element, attr) { - * scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) { - * element.html(value || ''); - * }); - * }; - * }]; - * ``` - * - * ## Impact on loading templates - * - * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as - * `templateUrl`'s specified by {@link guide/directive directives}. - * - * By default, Angular only loads templates from the same domain and protocol as the application - * document. This is done by calling {@link ng.$sce#getTrustedResourceUrl - * $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or - * protocols, you may either either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist - * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value. - * - * *Please note*: - * The browser's - * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest) - * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/) - * policy apply in addition to this and may further restrict whether the template is successfully - * loaded. This means that without the right CORS policy, loading templates from a different domain - * won't work on all browsers. Also, loading templates from `file://` URL does not work on some - * browsers. - * - * ## This feels like too much overhead - * - * It's important to remember that SCE only applies to interpolation expressions. - * - * If your expressions are constant literals, they're automatically trusted and you don't need to - * call `$sce.trustAs` on them (remember to include the `ngSanitize` module) (e.g. - * `
`) just works. - * - * Additionally, `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them - * through {@link ng.$sce#getTrusted $sce.getTrusted}. SCE doesn't play a role here. - * - * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load - * templates in `ng-include` from your application's domain without having to even know about SCE. - * It blocks loading templates from other domains or loading templates over http from an https - * served document. You can change these by setting your own custom {@link - * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link - * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs. - * - * This significantly reduces the overhead. It is far easier to pay the small overhead and have an - * application that's secure and can be audited to verify that with much more ease than bolting - * security onto an application later. - * - * - * ## What trusted context types are supported? - * - * | Context | Notes | - * |---------------------|----------------| - * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. | - * | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. | - * | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`
Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. | - * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently unused. Feel free to use it in your own directives. | - * - * ## Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist}
- * - * Each element in these arrays must be one of the following: - * - * - **'self'** - * - The special **string**, `'self'`, can be used to match against all URLs of the **same - * domain** as the application document using the **same protocol**. - * - **String** (except the special value `'self'`) - * - The string is matched against the full *normalized / absolute URL* of the resource - * being tested (substring matches are not good enough.) - * - There are exactly **two wildcard sequences** - `*` and `**`. All other characters - * match themselves. - * - `*`: matches zero or more occurrences of any character other than one of the following 6 - * characters: '`:`', '`/`', '`.`', '`?`', '`&`' and ';'. It's a useful wildcard for use - * in a whitelist. - * - `**`: matches zero or more occurrences of *any* character. As such, it's not - * not appropriate to use in for a scheme, domain, etc. as it would match too much. (e.g. - * http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might - * not have been the intention.) Its usage at the very end of the path is ok. (e.g. - * http://foo.example.com/templates/**). - * - **RegExp** (*see caveat below*) - * - *Caveat*: While regular expressions are powerful and offer great flexibility, their syntax - * (and all the inevitable escaping) makes them *harder to maintain*. It's easy to - * accidentally introduce a bug when one updates a complex expression (imho, all regexes should - * have good test coverage.). For instance, the use of `.` in the regex is correct only in a - * small number of cases. A `.` character in the regex used when matching the scheme or a - * subdomain could be matched against a `:` or literal `.` that was likely not intended. It - * is highly recommended to use the string patterns and only fall back to regular expressions - * if they as a last resort. - * - The regular expression must be an instance of RegExp (i.e. not a string.) It is - * matched against the **entire** *normalized / absolute URL* of the resource being tested - * (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags - * present on the RegExp (such as multiline, global, ignoreCase) are ignored. - * - If you are generating your JavaScript from some other templating engine (not - * recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)), - * remember to escape your regular expression (and be aware that you might need more than - * one level of escaping depending on your templating engine and the way you interpolated - * the value.) Do make use of your platform's escaping mechanism as it might be good - * enough before coding your own. e.g. Ruby has - * [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape) - * and Python has [re.escape](http://docs.python.org/library/re.html#re.escape). - * Javascript lacks a similar built in function for escaping. Take a look at Google - * Closure library's [goog.string.regExpEscape(s)]( - * http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962). - * - * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example. - * - * ## Show me an example using SCE. - * - * - * - *
- *

- * User comments
- * By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when - * $sanitize is available. If $sanitize isn't available, this results in an error instead of an - * exploit. - *
- *
- * {{userComment.name}}: - * - *
- *
- *
- *
- *
- * - * - * angular.module('mySceApp', ['ngSanitize']) - * .controller('AppController', ['$http', '$templateCache', '$sce', - * function($http, $templateCache, $sce) { - * var self = this; - * $http.get("test_data.json", {cache: $templateCache}).success(function(userComments) { - * self.userComments = userComments; - * }); - * self.explicitlyTrustedHtml = $sce.trustAsHtml( - * 'Hover over this text.'); - * }]); - * - * - * - * [ - * { "name": "Alice", - * "htmlComment": - * "Is anyone reading this?" - * }, - * { "name": "Bob", - * "htmlComment": "Yes! Am I the only other one?" - * } - * ] - * - * - * - * describe('SCE doc demo', function() { - * it('should sanitize untrusted values', function() { - * expect(element.all(by.css('.htmlComment')).first().getInnerHtml()) - * .toBe('Is anyone reading this?'); - * }); - * - * it('should NOT sanitize explicitly trusted values', function() { - * expect(element(by.id('explicitlyTrustedHtml')).getInnerHtml()).toBe( - * 'Hover over this text.'); - * }); - * }); - * - *
- * - * - * - * ## Can I disable SCE completely? - * - * Yes, you can. However, this is strongly discouraged. SCE gives you a lot of security benefits - * for little coding overhead. It will be much harder to take an SCE disabled application and - * either secure it on your own or enable SCE at a later stage. It might make sense to disable SCE - * for cases where you have a lot of existing code that was written before SCE was introduced and - * you're migrating them a module at a time. - * - * That said, here's how you can completely disable SCE: - * - * ``` - * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) { - * // Completely disable SCE. For demonstration purposes only! - * // Do not use in new projects. - * $sceProvider.enabled(false); - * }); - * ``` - * - */ -/* jshint maxlen: 100 */ - -function $SceProvider() { - var enabled = true; - - /** - * @ngdoc method - * @name $sceProvider#enabled - * @kind function - * - * @param {boolean=} value If provided, then enables/disables SCE. - * @return {boolean} true if SCE is enabled, false otherwise. - * - * @description - * Enables/disables SCE and returns the current value. - */ - this.enabled = function(value) { - if (arguments.length) { - enabled = !!value; - } - return enabled; - }; - - - /* Design notes on the default implementation for SCE. - * - * The API contract for the SCE delegate - * ------------------------------------- - * The SCE delegate object must provide the following 3 methods: - * - * - trustAs(contextEnum, value) - * This method is used to tell the SCE service that the provided value is OK to use in the - * contexts specified by contextEnum. It must return an object that will be accepted by - * getTrusted() for a compatible contextEnum and return this value. - * - * - valueOf(value) - * For values that were not produced by trustAs(), return them as is. For values that were - * produced by trustAs(), return the corresponding input value to trustAs. Basically, if - * trustAs is wrapping the given values into some type, this operation unwraps it when given - * such a value. - * - * - getTrusted(contextEnum, value) - * This function should return the a value that is safe to use in the context specified by - * contextEnum or throw and exception otherwise. - * - * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be - * opaque or wrapped in some holder object. That happens to be an implementation detail. For - * instance, an implementation could maintain a registry of all trusted objects by context. In - * such a case, trustAs() would return the same object that was passed in. getTrusted() would - * return the same object passed in if it was found in the registry under a compatible context or - * throw an exception otherwise. An implementation might only wrap values some of the time based - * on some criteria. getTrusted() might return a value and not throw an exception for special - * constants or objects even if not wrapped. All such implementations fulfill this contract. - * - * - * A note on the inheritance model for SCE contexts - * ------------------------------------------------ - * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types. This - * is purely an implementation details. - * - * The contract is simply this: - * - * getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value) - * will also succeed. - * - * Inheritance happens to capture this in a natural way. In some future, we - * may not use inheritance anymore. That is OK because no code outside of - * sce.js and sceSpecs.js would need to be aware of this detail. - */ - - this.$get = ['$parse', '$sceDelegate', function( - $parse, $sceDelegate) { - // Prereq: Ensure that we're not running in IE<11 quirks mode. In that mode, IE < 11 allow - // the "expression(javascript expression)" syntax which is insecure. - if (enabled && msie < 8) { - throw $sceMinErr('iequirks', - 'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' + - 'mode. You can fix this by adding the text to the top of your HTML ' + - 'document. See http://docs.angularjs.org/api/ng.$sce for more information.'); - } - - var sce = shallowCopy(SCE_CONTEXTS); - - /** - * @ngdoc method - * @name $sce#isEnabled - * @kind function - * - * @return {Boolean} true if SCE is enabled, false otherwise. If you want to set the value, you - * have to do it at module config time on {@link ng.$sceProvider $sceProvider}. - * - * @description - * Returns a boolean indicating if SCE is enabled. - */ - sce.isEnabled = function() { - return enabled; - }; - sce.trustAs = $sceDelegate.trustAs; - sce.getTrusted = $sceDelegate.getTrusted; - sce.valueOf = $sceDelegate.valueOf; - - if (!enabled) { - sce.trustAs = sce.getTrusted = function(type, value) { return value; }; - sce.valueOf = identity; - } - - /** - * @ngdoc method - * @name $sce#parseAs - * - * @description - * Converts Angular {@link guide/expression expression} into a function. This is like {@link - * ng.$parse $parse} and is identical when the expression is a literal constant. Otherwise, it - * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*, - * *result*)} - * - * @param {string} type The kind of SCE context in which this result will be used. - * @param {string} expression String expression to compile. - * @returns {function(context, locals)} a function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the strings - * are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values in - * `context`. - */ - sce.parseAs = function sceParseAs(type, expr) { - var parsed = $parse(expr); - if (parsed.literal && parsed.constant) { - return parsed; - } else { - return $parse(expr, function(value) { - return sce.getTrusted(type, value); - }); - } - }; - - /** - * @ngdoc method - * @name $sce#trustAs - * - * @description - * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. As such, - * returns an object that is trusted by angular for use in specified strict contextual - * escaping contexts (such as ng-bind-html, ng-include, any src attribute - * interpolation, any dom event binding attribute interpolation such as for onclick, etc.) - * that uses the provided value. See * {@link ng.$sce $sce} for enabling strict contextual - * escaping. - * - * @param {string} type The kind of context in which this value is safe for use. e.g. url, - * resource_url, html, js and css. - * @param {*} value The value that that should be considered trusted/safe. - * @returns {*} A value that can be used to stand in for the provided `value` in places - * where Angular expects a $sce.trustAs() return value. - */ - - /** - * @ngdoc method - * @name $sce#trustAsHtml - * - * @description - * Shorthand method. `$sce.trustAsHtml(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`} - * - * @param {*} value The value to trustAs. - * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedHtml - * $sce.getTrustedHtml(value)} to obtain the original value. (privileged directives - * only accept expressions that are either literal constants or are the - * return value of {@link ng.$sce#trustAs $sce.trustAs}.) - */ - - /** - * @ngdoc method - * @name $sce#trustAsUrl - * - * @description - * Shorthand method. `$sce.trustAsUrl(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`} - * - * @param {*} value The value to trustAs. - * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedUrl - * $sce.getTrustedUrl(value)} to obtain the original value. (privileged directives - * only accept expressions that are either literal constants or are the - * return value of {@link ng.$sce#trustAs $sce.trustAs}.) - */ - - /** - * @ngdoc method - * @name $sce#trustAsResourceUrl - * - * @description - * Shorthand method. `$sce.trustAsResourceUrl(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`} - * - * @param {*} value The value to trustAs. - * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedResourceUrl - * $sce.getTrustedResourceUrl(value)} to obtain the original value. (privileged directives - * only accept expressions that are either literal constants or are the return - * value of {@link ng.$sce#trustAs $sce.trustAs}.) - */ - - /** - * @ngdoc method - * @name $sce#trustAsJs - * - * @description - * Shorthand method. `$sce.trustAsJs(value)` → - * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`} - * - * @param {*} value The value to trustAs. - * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedJs - * $sce.getTrustedJs(value)} to obtain the original value. (privileged directives - * only accept expressions that are either literal constants or are the - * return value of {@link ng.$sce#trustAs $sce.trustAs}.) - */ - - /** - * @ngdoc method - * @name $sce#getTrusted - * - * @description - * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}. As such, - * takes the result of a {@link ng.$sce#trustAs `$sce.trustAs`}() call and returns the - * originally supplied value if the queried context type is a supertype of the created type. - * If this condition isn't satisfied, throws an exception. - * - * @param {string} type The kind of context in which this value is to be used. - * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs `$sce.trustAs`} - * call. - * @returns {*} The value the was originally provided to - * {@link ng.$sce#trustAs `$sce.trustAs`} if valid in this context. - * Otherwise, throws an exception. - */ - - /** - * @ngdoc method - * @name $sce#getTrustedHtml - * - * @description - * Shorthand method. `$sce.getTrustedHtml(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`} - * - * @param {*} value The value to pass to `$sce.getTrusted`. - * @returns {*} The return value of `$sce.getTrusted($sce.HTML, value)` - */ - - /** - * @ngdoc method - * @name $sce#getTrustedCss - * - * @description - * Shorthand method. `$sce.getTrustedCss(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`} - * - * @param {*} value The value to pass to `$sce.getTrusted`. - * @returns {*} The return value of `$sce.getTrusted($sce.CSS, value)` - */ - - /** - * @ngdoc method - * @name $sce#getTrustedUrl - * - * @description - * Shorthand method. `$sce.getTrustedUrl(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`} - * - * @param {*} value The value to pass to `$sce.getTrusted`. - * @returns {*} The return value of `$sce.getTrusted($sce.URL, value)` - */ - - /** - * @ngdoc method - * @name $sce#getTrustedResourceUrl - * - * @description - * Shorthand method. `$sce.getTrustedResourceUrl(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`} - * - * @param {*} value The value to pass to `$sceDelegate.getTrusted`. - * @returns {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)` - */ - - /** - * @ngdoc method - * @name $sce#getTrustedJs - * - * @description - * Shorthand method. `$sce.getTrustedJs(value)` → - * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`} - * - * @param {*} value The value to pass to `$sce.getTrusted`. - * @returns {*} The return value of `$sce.getTrusted($sce.JS, value)` - */ - - /** - * @ngdoc method - * @name $sce#parseAsHtml - * - * @description - * Shorthand method. `$sce.parseAsHtml(expression string)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`} - * - * @param {string} expression String expression to compile. - * @returns {function(context, locals)} a function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the strings - * are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values in - * `context`. - */ - - /** - * @ngdoc method - * @name $sce#parseAsCss - * - * @description - * Shorthand method. `$sce.parseAsCss(value)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`} - * - * @param {string} expression String expression to compile. - * @returns {function(context, locals)} a function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the strings - * are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values in - * `context`. - */ - - /** - * @ngdoc method - * @name $sce#parseAsUrl - * - * @description - * Shorthand method. `$sce.parseAsUrl(value)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`} - * - * @param {string} expression String expression to compile. - * @returns {function(context, locals)} a function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the strings - * are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values in - * `context`. - */ - - /** - * @ngdoc method - * @name $sce#parseAsResourceUrl - * - * @description - * Shorthand method. `$sce.parseAsResourceUrl(value)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`} - * - * @param {string} expression String expression to compile. - * @returns {function(context, locals)} a function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the strings - * are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values in - * `context`. - */ - - /** - * @ngdoc method - * @name $sce#parseAsJs - * - * @description - * Shorthand method. `$sce.parseAsJs(value)` → - * {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`} - * - * @param {string} expression String expression to compile. - * @returns {function(context, locals)} a function which represents the compiled expression: - * - * * `context` – `{object}` – an object against which any expressions embedded in the strings - * are evaluated against (typically a scope object). - * * `locals` – `{object=}` – local variables context object, useful for overriding values in - * `context`. - */ - - // Shorthand delegations. - var parse = sce.parseAs, - getTrusted = sce.getTrusted, - trustAs = sce.trustAs; - - forEach(SCE_CONTEXTS, function(enumValue, name) { - var lName = lowercase(name); - sce[camelCase("parse_as_" + lName)] = function(expr) { - return parse(enumValue, expr); - }; - sce[camelCase("get_trusted_" + lName)] = function(value) { - return getTrusted(enumValue, value); - }; - sce[camelCase("trust_as_" + lName)] = function(value) { - return trustAs(enumValue, value); - }; - }); - - return sce; - }]; -} - -/** - * !!! This is an undocumented "private" service !!! - * - * @name $sniffer - * @requires $window - * @requires $document - * - * @property {boolean} history Does the browser support html5 history api ? - * @property {boolean} transitions Does the browser support CSS transition events ? - * @property {boolean} animations Does the browser support CSS animation events ? - * - * @description - * This is very simple implementation of testing browser's features. - */ -function $SnifferProvider() { - this.$get = ['$window', '$document', function($window, $document) { - var eventSupport = {}, - android = - int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]), - boxee = /Boxee/i.test(($window.navigator || {}).userAgent), - document = $document[0] || {}, - vendorPrefix, - vendorRegex = /^(Moz|webkit|ms)(?=[A-Z])/, - bodyStyle = document.body && document.body.style, - transitions = false, - animations = false, - match; - - if (bodyStyle) { - for (var prop in bodyStyle) { - if (match = vendorRegex.exec(prop)) { - vendorPrefix = match[0]; - vendorPrefix = vendorPrefix.substr(0, 1).toUpperCase() + vendorPrefix.substr(1); - break; - } - } - - if (!vendorPrefix) { - vendorPrefix = ('WebkitOpacity' in bodyStyle) && 'webkit'; - } - - transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle)); - animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle)); - - if (android && (!transitions || !animations)) { - transitions = isString(document.body.style.webkitTransition); - animations = isString(document.body.style.webkitAnimation); - } - } - - - return { - // Android has history.pushState, but it does not update location correctly - // so let's not use the history API at all. - // http://code.google.com/p/android/issues/detail?id=17471 - // https://github.com/angular/angular.js/issues/904 - - // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has - // so let's not use the history API also - // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined - // jshint -W018 - history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee), - // jshint +W018 - hasEvent: function(event) { - // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have - // it. In particular the event is not fired when backspace or delete key are pressed or - // when cut operation is performed. - if (event == 'input' && msie == 9) return false; - - if (isUndefined(eventSupport[event])) { - var divElm = document.createElement('div'); - eventSupport[event] = 'on' + event in divElm; - } - - return eventSupport[event]; - }, - csp: csp(), - vendorPrefix: vendorPrefix, - transitions: transitions, - animations: animations, - android: android - }; - }]; -} - -var $compileMinErr = minErr('$compile'); - -/** - * @ngdoc service - * @name $templateRequest - * - * @description - * The `$templateRequest` service downloads the provided template using `$http` and, upon success, - * stores the contents inside of `$templateCache`. If the HTTP request fails or the response data - * of the HTTP request is empty then a `$compile` error will be thrown (the exception can be thwarted - * by setting the 2nd parameter of the function to true). - * - * @param {string} tpl The HTTP request template URL - * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty - * - * @return {Promise} the HTTP Promise for the given. - * - * @property {number} totalPendingRequests total amount of pending template requests being downloaded. - */ -function $TemplateRequestProvider() { - this.$get = ['$templateCache', '$http', '$q', function($templateCache, $http, $q) { - function handleRequestFn(tpl, ignoreRequestError) { - var self = handleRequestFn; - self.totalPendingRequests++; - - var transformResponse = $http.defaults && $http.defaults.transformResponse; - - if (isArray(transformResponse)) { - var original = transformResponse; - transformResponse = []; - for (var i = 0; i < original.length; ++i) { - var transformer = original[i]; - if (transformer !== defaultHttpResponseTransform) { - transformResponse.push(transformer); - } - } - } else if (transformResponse === defaultHttpResponseTransform) { - transformResponse = null; - } - - var httpOptions = { - cache: $templateCache, - transformResponse: transformResponse - }; - - return $http.get(tpl, httpOptions) - .then(function(response) { - var html = response.data; - self.totalPendingRequests--; - $templateCache.put(tpl, html); - return html; - }, handleError); - - function handleError() { - self.totalPendingRequests--; - if (!ignoreRequestError) { - throw $compileMinErr('tpload', 'Failed to load template: {0}', tpl); - } - return $q.reject(); - } - } - - handleRequestFn.totalPendingRequests = 0; - - return handleRequestFn; - }]; -} - -function $$TestabilityProvider() { - this.$get = ['$rootScope', '$browser', '$location', - function($rootScope, $browser, $location) { - - /** - * @name $testability - * - * @description - * The private $$testability service provides a collection of methods for use when debugging - * or by automated test and debugging tools. - */ - var testability = {}; - - /** - * @name $$testability#findBindings - * - * @description - * Returns an array of elements that are bound (via ng-bind or {{}}) - * to expressions matching the input. - * - * @param {Element} element The element root to search from. - * @param {string} expression The binding expression to match. - * @param {boolean} opt_exactMatch If true, only returns exact matches - * for the expression. Filters and whitespace are ignored. - */ - testability.findBindings = function(element, expression, opt_exactMatch) { - var bindings = element.getElementsByClassName('ng-binding'); - var matches = []; - forEach(bindings, function(binding) { - var dataBinding = angular.element(binding).data('$binding'); - if (dataBinding) { - forEach(dataBinding, function(bindingName) { - if (opt_exactMatch) { - var matcher = new RegExp('(^|\\s)' + escapeForRegexp(expression) + '(\\s|\\||$)'); - if (matcher.test(bindingName)) { - matches.push(binding); - } - } else { - if (bindingName.indexOf(expression) != -1) { - matches.push(binding); - } - } - }); - } - }); - return matches; - }; - - /** - * @name $$testability#findModels - * - * @description - * Returns an array of elements that are two-way found via ng-model to - * expressions matching the input. - * - * @param {Element} element The element root to search from. - * @param {string} expression The model expression to match. - * @param {boolean} opt_exactMatch If true, only returns exact matches - * for the expression. - */ - testability.findModels = function(element, expression, opt_exactMatch) { - var prefixes = ['ng-', 'data-ng-', 'ng\\:']; - for (var p = 0; p < prefixes.length; ++p) { - var attributeEquals = opt_exactMatch ? '=' : '*='; - var selector = '[' + prefixes[p] + 'model' + attributeEquals + '"' + expression + '"]'; - var elements = element.querySelectorAll(selector); - if (elements.length) { - return elements; - } - } - }; - - /** - * @name $$testability#getLocation - * - * @description - * Shortcut for getting the location in a browser agnostic way. Returns - * the path, search, and hash. (e.g. /path?a=b#hash) - */ - testability.getLocation = function() { - return $location.url(); - }; - - /** - * @name $$testability#setLocation - * - * @description - * Shortcut for navigating to a location without doing a full page reload. - * - * @param {string} url The location url (path, search and hash, - * e.g. /path?a=b#hash) to go to. - */ - testability.setLocation = function(url) { - if (url !== $location.url()) { - $location.url(url); - $rootScope.$digest(); - } - }; - - /** - * @name $$testability#whenStable - * - * @description - * Calls the callback when $timeout and $http requests are completed. - * - * @param {function} callback - */ - testability.whenStable = function(callback) { - $browser.notifyWhenNoOutstandingRequests(callback); - }; - - return testability; - }]; -} - -function $TimeoutProvider() { - this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler', - function($rootScope, $browser, $q, $$q, $exceptionHandler) { - var deferreds = {}; - - - /** - * @ngdoc service - * @name $timeout - * - * @description - * Angular's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch - * block and delegates any exceptions to - * {@link ng.$exceptionHandler $exceptionHandler} service. - * - * The return value of registering a timeout function is a promise, which will be resolved when - * the timeout is reached and the timeout function is executed. - * - * To cancel a timeout request, call `$timeout.cancel(promise)`. - * - * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to - * synchronously flush the queue of deferred functions. - * - * @param {function()} fn A function, whose execution should be delayed. - * @param {number=} [delay=0] Delay in milliseconds. - * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise - * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. - * @returns {Promise} Promise that will be resolved when the timeout is reached. The value this - * promise will be resolved with is the return value of the `fn` function. - * - */ - function timeout(fn, delay, invokeApply) { - var skipApply = (isDefined(invokeApply) && !invokeApply), - deferred = (skipApply ? $$q : $q).defer(), - promise = deferred.promise, - timeoutId; - - timeoutId = $browser.defer(function() { - try { - deferred.resolve(fn()); - } catch (e) { - deferred.reject(e); - $exceptionHandler(e); - } - finally { - delete deferreds[promise.$$timeoutId]; - } - - if (!skipApply) $rootScope.$apply(); - }, delay); - - promise.$$timeoutId = timeoutId; - deferreds[timeoutId] = deferred; - - return promise; - } - - - /** - * @ngdoc method - * @name $timeout#cancel - * - * @description - * Cancels a task associated with the `promise`. As a result of this, the promise will be - * resolved with a rejection. - * - * @param {Promise=} promise Promise returned by the `$timeout` function. - * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully - * canceled. - */ - timeout.cancel = function(promise) { - if (promise && promise.$$timeoutId in deferreds) { - deferreds[promise.$$timeoutId].reject('canceled'); - delete deferreds[promise.$$timeoutId]; - return $browser.defer.cancel(promise.$$timeoutId); - } - return false; - }; - - return timeout; - }]; -} - -// NOTE: The usage of window and document instead of $window and $document here is -// deliberate. This service depends on the specific behavior of anchor nodes created by the -// browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and -// cause us to break tests. In addition, when the browser resolves a URL for XHR, it -// doesn't know about mocked locations and resolves URLs to the real document - which is -// exactly the behavior needed here. There is little value is mocking these out for this -// service. -var urlParsingNode = document.createElement("a"); -var originUrl = urlResolve(window.location.href); - - -/** - * - * Implementation Notes for non-IE browsers - * ---------------------------------------- - * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM, - * results both in the normalizing and parsing of the URL. Normalizing means that a relative - * URL will be resolved into an absolute URL in the context of the application document. - * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related - * properties are all populated to reflect the normalized URL. This approach has wide - * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc. See - * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html - * - * Implementation Notes for IE - * --------------------------- - * IE >= 8 and <= 10 normalizes the URL when assigned to the anchor node similar to the other - * browsers. However, the parsed components will not be set if the URL assigned did not specify - * them. (e.g. if you assign a.href = "foo", then a.protocol, a.host, etc. will be empty.) We - * work around that by performing the parsing in a 2nd step by taking a previously normalized - * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the - * properties such as protocol, hostname, port, etc. - * - * IE7 does not normalize the URL when assigned to an anchor node. (Apparently, it does, if one - * uses the inner HTML approach to assign the URL as part of an HTML snippet - - * http://stackoverflow.com/a/472729) However, setting img[src] does normalize the URL. - * Unfortunately, setting img[src] to something like "javascript:foo" on IE throws an exception. - * Since the primary usage for normalizing URLs is to sanitize such URLs, we can't use that - * method and IE < 8 is unsupported. - * - * References: - * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement - * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html - * http://url.spec.whatwg.org/#urlutils - * https://github.com/angular/angular.js/pull/2902 - * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/ - * - * @kind function - * @param {string} url The URL to be parsed. - * @description Normalizes and parses a URL. - * @returns {object} Returns the normalized URL as a dictionary. - * - * | member name | Description | - * |---------------|----------------| - * | href | A normalized version of the provided URL if it was not an absolute URL | - * | protocol | The protocol including the trailing colon | - * | host | The host and port (if the port is non-default) of the normalizedUrl | - * | search | The search params, minus the question mark | - * | hash | The hash string, minus the hash symbol - * | hostname | The hostname - * | port | The port, without ":" - * | pathname | The pathname, beginning with "/" - * - */ -function urlResolve(url) { - var href = url; - - if (msie) { - // Normalize before parse. Refer Implementation Notes on why this is - // done in two steps on IE. - urlParsingNode.setAttribute("href", href); - href = urlParsingNode.href; - } - - urlParsingNode.setAttribute('href', href); - - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') - ? urlParsingNode.pathname - : '/' + urlParsingNode.pathname - }; -} - -/** - * Parse a request URL and determine whether this is a same-origin request as the application document. - * - * @param {string|object} requestUrl The url of the request as a string that will be resolved - * or a parsed URL object. - * @returns {boolean} Whether the request is for the same origin as the application document. - */ -function urlIsSameOrigin(requestUrl) { - var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl; - return (parsed.protocol === originUrl.protocol && - parsed.host === originUrl.host); -} - -/** - * @ngdoc service - * @name $window - * - * @description - * A reference to the browser's `window` object. While `window` - * is globally available in JavaScript, it causes testability problems, because - * it is a global variable. In angular we always refer to it through the - * `$window` service, so it may be overridden, removed or mocked for testing. - * - * Expressions, like the one defined for the `ngClick` directive in the example - * below, are evaluated with respect to the current scope. Therefore, there is - * no risk of inadvertently coding in a dependency on a global value in such an - * expression. - * - * @example - - - -
- - -
-
- - it('should display the greeting in the input box', function() { - element(by.model('greeting')).sendKeys('Hello, E2E Tests'); - // If we click the button it will block the test runner - // element(':button').click(); - }); - -
- */ -function $WindowProvider() { - this.$get = valueFn(window); -} - -/* global currencyFilter: true, - dateFilter: true, - filterFilter: true, - jsonFilter: true, - limitToFilter: true, - lowercaseFilter: true, - numberFilter: true, - orderByFilter: true, - uppercaseFilter: true, - */ - -/** - * @ngdoc provider - * @name $filterProvider - * @description - * - * Filters are just functions which transform input to an output. However filters need to be - * Dependency Injected. To achieve this a filter definition consists of a factory function which is - * annotated with dependencies and is responsible for creating a filter function. - * - * ```js - * // Filter registration - * function MyModule($provide, $filterProvider) { - * // create a service to demonstrate injection (not always needed) - * $provide.value('greet', function(name){ - * return 'Hello ' + name + '!'; - * }); - * - * // register a filter factory which uses the - * // greet service to demonstrate DI. - * $filterProvider.register('greet', function(greet){ - * // return the filter function which uses the greet service - * // to generate salutation - * return function(text) { - * // filters need to be forgiving so check input validity - * return text && greet(text) || text; - * }; - * }); - * } - * ``` - * - * The filter function is registered with the `$injector` under the filter name suffix with - * `Filter`. - * - * ```js - * it('should be the same instance', inject( - * function($filterProvider) { - * $filterProvider.register('reverse', function(){ - * return ...; - * }); - * }, - * function($filter, reverseFilter) { - * expect($filter('reverse')).toBe(reverseFilter); - * }); - * ``` - * - * - * For more information about how angular filters work, and how to create your own filters, see - * {@link guide/filter Filters} in the Angular Developer Guide. - */ - -/** - * @ngdoc service - * @name $filter - * @kind function - * @description - * Filters are used for formatting data displayed to the user. - * - * The general syntax in templates is as follows: - * - * {{ expression [| filter_name[:parameter_value] ... ] }} - * - * @param {String} name Name of the filter function to retrieve - * @return {Function} the filter function - * @example - - -
-

{{ originalText }}

-

{{ filteredText }}

-
-
- - - angular.module('filterExample', []) - .controller('MainCtrl', function($scope, $filter) { - $scope.originalText = 'hello'; - $scope.filteredText = $filter('uppercase')($scope.originalText); - }); - -
- */ -$FilterProvider.$inject = ['$provide']; -function $FilterProvider($provide) { - var suffix = 'Filter'; - - /** - * @ngdoc method - * @name $filterProvider#register - * @param {string|Object} name Name of the filter function, or an object map of filters where - * the keys are the filter names and the values are the filter factories. - * @returns {Object} Registered filter instance, or if a map of filters was provided then a map - * of the registered filter instances. - */ - function register(name, factory) { - if (isObject(name)) { - var filters = {}; - forEach(name, function(filter, key) { - filters[key] = register(key, filter); - }); - return filters; - } else { - return $provide.factory(name + suffix, factory); - } - } - this.register = register; - - this.$get = ['$injector', function($injector) { - return function(name) { - return $injector.get(name + suffix); - }; - }]; - - //////////////////////////////////////// - - /* global - currencyFilter: false, - dateFilter: false, - filterFilter: false, - jsonFilter: false, - limitToFilter: false, - lowercaseFilter: false, - numberFilter: false, - orderByFilter: false, - uppercaseFilter: false, - */ - - register('currency', currencyFilter); - register('date', dateFilter); - register('filter', filterFilter); - register('json', jsonFilter); - register('limitTo', limitToFilter); - register('lowercase', lowercaseFilter); - register('number', numberFilter); - register('orderBy', orderByFilter); - register('uppercase', uppercaseFilter); -} - -/** - * @ngdoc filter - * @name filter - * @kind function - * - * @description - * Selects a subset of items from `array` and returns it as a new array. - * - * @param {Array} array The source array. - * @param {string|Object|function()} expression The predicate to be used for selecting items from - * `array`. - * - * Can be one of: - * - * - `string`: The string is evaluated as an expression and the resulting value is used for substring match against - * the contents of the `array`. All strings or objects with string properties in `array` that contain this string - * will be returned. The predicate can be negated by prefixing the string with `!`. - * - * - `Object`: A pattern object can be used to filter specific properties on objects contained - * by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items - * which have property `name` containing "M" and property `phone` containing "1". A special - * property name `$` can be used (as in `{$:"text"}`) to accept a match against any - * property of the object. That's equivalent to the simple substring match with a `string` - * as described above. The predicate can be negated by prefixing the string with `!`. - * For Example `{name: "!M"}` predicate will return an array of items which have property `name` - * not containing "M". - * - * - `function(value, index)`: A predicate function can be used to write arbitrary filters. The - * function is called for each element of `array`. The final result is an array of those - * elements that the predicate returned true for. - * - * @param {function(actual, expected)|true|undefined} comparator Comparator which is used in - * determining if the expected value (from the filter expression) and actual value (from - * the object in the array) should be considered a match. - * - * Can be one of: - * - * - `function(actual, expected)`: - * The function will be given the object value and the predicate value to compare and - * should return true if the item should be included in filtered result. - * - * - `true`: A shorthand for `function(actual, expected) { return angular.equals(expected, actual)}`. - * this is essentially strict comparison of expected and actual. - * - * - `false|undefined`: A short hand for a function which will look for a substring match in case - * insensitive way. - * - * @example - - -
- - Search: - - - - - - -
NamePhone
{{friend.name}}{{friend.phone}}
-
- Any:
- Name only
- Phone only
- Equality
- - - - - - -
NamePhone
{{friendObj.name}}{{friendObj.phone}}
-
- - var expectFriendNames = function(expectedNames, key) { - element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) { - arr.forEach(function(wd, i) { - expect(wd.getText()).toMatch(expectedNames[i]); - }); - }); - }; - - it('should search across all fields when filtering with a string', function() { - var searchText = element(by.model('searchText')); - searchText.clear(); - searchText.sendKeys('m'); - expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend'); - - searchText.clear(); - searchText.sendKeys('76'); - expectFriendNames(['John', 'Julie'], 'friend'); - }); - - it('should search in specific fields when filtering with a predicate object', function() { - var searchAny = element(by.model('search.$')); - searchAny.clear(); - searchAny.sendKeys('i'); - expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj'); - }); - it('should use a equal comparison when comparator is true', function() { - var searchName = element(by.model('search.name')); - var strict = element(by.model('strict')); - searchName.clear(); - searchName.sendKeys('Julie'); - strict.click(); - expectFriendNames(['Julie'], 'friendObj'); - }); - -
- */ -function filterFilter() { - return function(array, expression, comparator) { - if (!isArray(array)) return array; - - var comparatorType = typeof(comparator), - predicates = []; - - predicates.check = function(value, index) { - for (var j = 0; j < predicates.length; j++) { - if (!predicates[j](value, index)) { - return false; - } - } - return true; - }; - - if (comparatorType !== 'function') { - if (comparatorType === 'boolean' && comparator) { - comparator = function(obj, text) { - return angular.equals(obj, text); - }; - } else { - comparator = function(obj, text) { - if (obj && text && typeof obj === 'object' && typeof text === 'object') { - for (var objKey in obj) { - if (objKey.charAt(0) !== '$' && hasOwnProperty.call(obj, objKey) && - comparator(obj[objKey], text[objKey])) { - return true; - } - } - return false; - } - text = ('' + text).toLowerCase(); - return ('' + obj).toLowerCase().indexOf(text) > -1; - }; - } - } - - var search = function(obj, text) { - if (typeof text === 'string' && text.charAt(0) === '!') { - return !search(obj, text.substr(1)); - } - switch (typeof obj) { - case 'boolean': - case 'number': - case 'string': - return comparator(obj, text); - case 'object': - switch (typeof text) { - case 'object': - return comparator(obj, text); - default: - for (var objKey in obj) { - if (objKey.charAt(0) !== '$' && search(obj[objKey], text)) { - return true; - } - } - break; - } - return false; - case 'array': - for (var i = 0; i < obj.length; i++) { - if (search(obj[i], text)) { - return true; - } - } - return false; - default: - return false; - } - }; - switch (typeof expression) { - case 'boolean': - case 'number': - case 'string': - // Set up expression object and fall through - expression = {$:expression}; - // jshint -W086 - case 'object': - // jshint +W086 - for (var key in expression) { - (function(path) { - if (typeof expression[path] === 'undefined') return; - predicates.push(function(value) { - return search(path == '$' ? value : (value && value[path]), expression[path]); - }); - })(key); - } - break; - case 'function': - predicates.push(expression); - break; - default: - return array; - } - var filtered = []; - for (var j = 0; j < array.length; j++) { - var value = array[j]; - if (predicates.check(value, j)) { - filtered.push(value); - } - } - return filtered; - }; -} - -/** - * @ngdoc filter - * @name currency - * @kind function - * - * @description - * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default - * symbol for current locale is used. - * - * @param {number} amount Input to filter. - * @param {string=} symbol Currency symbol or identifier to be displayed. - * @param {number=} fractionSize Number of decimal places to round the amount to. - * @returns {string} Formatted number. - * - * - * @example - - - -
-
- default currency symbol ($): {{amount | currency}}
- custom currency identifier (USD$): {{amount | currency:"USD$"}} - no fractions (0): {{amount | currency:"USD$":0}} -
-
- - it('should init with 1234.56', function() { - expect(element(by.id('currency-default')).getText()).toBe('$1,234.56'); - expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56'); - expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235'); - }); - it('should update', function() { - if (browser.params.browser == 'safari') { - // Safari does not understand the minus key. See - // https://github.com/angular/protractor/issues/481 - return; - } - element(by.model('amount')).clear(); - element(by.model('amount')).sendKeys('-1234'); - expect(element(by.id('currency-default')).getText()).toBe('($1,234.00)'); - expect(element(by.id('currency-custom')).getText()).toBe('(USD$1,234.00)'); - expect(element(by.id('currency-no-fractions')).getText()).toBe('(USD$1,234)'); - }); - -
- */ -currencyFilter.$inject = ['$locale']; -function currencyFilter($locale) { - var formats = $locale.NUMBER_FORMATS; - return function(amount, currencySymbol, fractionSize) { - if (isUndefined(currencySymbol)) { - currencySymbol = formats.CURRENCY_SYM; - } - - if (isUndefined(fractionSize)) { - // TODO: read the default value from the locale file - fractionSize = 2; - } - - // if null or undefined pass it through - return (amount == null) - ? amount - : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize). - replace(/\u00A4/g, currencySymbol); - }; -} - -/** - * @ngdoc filter - * @name number - * @kind function - * - * @description - * Formats a number as text. - * - * If the input is not a number an empty string is returned. - * - * @param {number|string} number Number to format. - * @param {(number|string)=} fractionSize Number of decimal places to round the number to. - * If this is not provided then the fraction size is computed from the current locale's number - * formatting pattern. In the case of the default locale, it will be 3. - * @returns {string} Number rounded to decimalPlaces and places a “,” after each third digit. - * - * @example - - - -
- Enter number:
- Default formatting: {{val | number}}
- No fractions: {{val | number:0}}
- Negative number: {{-val | number:4}} -
-
- - it('should format numbers', function() { - expect(element(by.id('number-default')).getText()).toBe('1,234.568'); - expect(element(by.binding('val | number:0')).getText()).toBe('1,235'); - expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679'); - }); - - it('should update', function() { - element(by.model('val')).clear(); - element(by.model('val')).sendKeys('3374.333'); - expect(element(by.id('number-default')).getText()).toBe('3,374.333'); - expect(element(by.binding('val | number:0')).getText()).toBe('3,374'); - expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330'); - }); - -
- */ - - -numberFilter.$inject = ['$locale']; -function numberFilter($locale) { - var formats = $locale.NUMBER_FORMATS; - return function(number, fractionSize) { - - // if null or undefined pass it through - return (number == null) - ? number - : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP, - fractionSize); - }; -} - -var DECIMAL_SEP = '.'; -function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) { - if (!isFinite(number) || isObject(number)) return ''; - - var isNegative = number < 0; - number = Math.abs(number); - var numStr = number + '', - formatedText = '', - parts = []; - - var hasExponent = false; - if (numStr.indexOf('e') !== -1) { - var match = numStr.match(/([\d\.]+)e(-?)(\d+)/); - if (match && match[2] == '-' && match[3] > fractionSize + 1) { - numStr = '0'; - number = 0; - } else { - formatedText = numStr; - hasExponent = true; - } - } - - if (!hasExponent) { - var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length; - - // determine fractionSize if it is not specified - if (isUndefined(fractionSize)) { - fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac); - } - - // safely round numbers in JS without hitting imprecisions of floating-point arithmetics - // inspired by: - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round - number = +(Math.round(+(number.toString() + 'e' + fractionSize)).toString() + 'e' + -fractionSize); - - if (number === 0) { - isNegative = false; - } - - var fraction = ('' + number).split(DECIMAL_SEP); - var whole = fraction[0]; - fraction = fraction[1] || ''; - - var i, pos = 0, - lgroup = pattern.lgSize, - group = pattern.gSize; - - if (whole.length >= (lgroup + group)) { - pos = whole.length - lgroup; - for (i = 0; i < pos; i++) { - if ((pos - i) % group === 0 && i !== 0) { - formatedText += groupSep; - } - formatedText += whole.charAt(i); - } - } - - for (i = pos; i < whole.length; i++) { - if ((whole.length - i) % lgroup === 0 && i !== 0) { - formatedText += groupSep; - } - formatedText += whole.charAt(i); - } - - // format fraction part. - while (fraction.length < fractionSize) { - fraction += '0'; - } - - if (fractionSize && fractionSize !== "0") formatedText += decimalSep + fraction.substr(0, fractionSize); - } else { - - if (fractionSize > 0 && number > -1 && number < 1) { - formatedText = number.toFixed(fractionSize); - } - } - - parts.push(isNegative ? pattern.negPre : pattern.posPre); - parts.push(formatedText); - parts.push(isNegative ? pattern.negSuf : pattern.posSuf); - return parts.join(''); -} - -function padNumber(num, digits, trim) { - var neg = ''; - if (num < 0) { - neg = '-'; - num = -num; - } - num = '' + num; - while (num.length < digits) num = '0' + num; - if (trim) - num = num.substr(num.length - digits); - return neg + num; -} - - -function dateGetter(name, size, offset, trim) { - offset = offset || 0; - return function(date) { - var value = date['get' + name](); - if (offset > 0 || value > -offset) - value += offset; - if (value === 0 && offset == -12) value = 12; - return padNumber(value, size, trim); - }; -} - -function dateStrGetter(name, shortForm) { - return function(date, formats) { - var value = date['get' + name](); - var get = uppercase(shortForm ? ('SHORT' + name) : name); - - return formats[get][value]; - }; -} - -function timeZoneGetter(date) { - var zone = -1 * date.getTimezoneOffset(); - var paddedZone = (zone >= 0) ? "+" : ""; - - paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) + - padNumber(Math.abs(zone % 60), 2); - - return paddedZone; -} - -function getFirstThursdayOfYear(year) { - // 0 = index of January - var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay(); - // 4 = index of Thursday (+1 to account for 1st = 5) - // 11 = index of *next* Thursday (+1 account for 1st = 12) - return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst); -} - -function getThursdayThisWeek(datetime) { - return new Date(datetime.getFullYear(), datetime.getMonth(), - // 4 = index of Thursday - datetime.getDate() + (4 - datetime.getDay())); -} - -function weekGetter(size) { - return function(date) { - var firstThurs = getFirstThursdayOfYear(date.getFullYear()), - thisThurs = getThursdayThisWeek(date); - - var diff = +thisThurs - +firstThurs, - result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week - - return padNumber(result, size); - }; -} - -function ampmGetter(date, formats) { - return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1]; -} - -var DATE_FORMATS = { - yyyy: dateGetter('FullYear', 4), - yy: dateGetter('FullYear', 2, 0, true), - y: dateGetter('FullYear', 1), - MMMM: dateStrGetter('Month'), - MMM: dateStrGetter('Month', true), - MM: dateGetter('Month', 2, 1), - M: dateGetter('Month', 1, 1), - dd: dateGetter('Date', 2), - d: dateGetter('Date', 1), - HH: dateGetter('Hours', 2), - H: dateGetter('Hours', 1), - hh: dateGetter('Hours', 2, -12), - h: dateGetter('Hours', 1, -12), - mm: dateGetter('Minutes', 2), - m: dateGetter('Minutes', 1), - ss: dateGetter('Seconds', 2), - s: dateGetter('Seconds', 1), - // while ISO 8601 requires fractions to be prefixed with `.` or `,` - // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions - sss: dateGetter('Milliseconds', 3), - EEEE: dateStrGetter('Day'), - EEE: dateStrGetter('Day', true), - a: ampmGetter, - Z: timeZoneGetter, - ww: weekGetter(2), - w: weekGetter(1) -}; - -var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZEw']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|w+))(.*)/, - NUMBER_STRING = /^\-?\d+$/; - -/** - * @ngdoc filter - * @name date - * @kind function - * - * @description - * Formats `date` to a string based on the requested `format`. - * - * `format` string can be composed of the following elements: - * - * * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010) - * * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10) - * * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199) - * * `'MMMM'`: Month in year (January-December) - * * `'MMM'`: Month in year (Jan-Dec) - * * `'MM'`: Month in year, padded (01-12) - * * `'M'`: Month in year (1-12) - * * `'dd'`: Day in month, padded (01-31) - * * `'d'`: Day in month (1-31) - * * `'EEEE'`: Day in Week,(Sunday-Saturday) - * * `'EEE'`: Day in Week, (Sun-Sat) - * * `'HH'`: Hour in day, padded (00-23) - * * `'H'`: Hour in day (0-23) - * * `'hh'`: Hour in AM/PM, padded (01-12) - * * `'h'`: Hour in AM/PM, (1-12) - * * `'mm'`: Minute in hour, padded (00-59) - * * `'m'`: Minute in hour (0-59) - * * `'ss'`: Second in minute, padded (00-59) - * * `'s'`: Second in minute (0-59) - * * `'.sss' or ',sss'`: Millisecond in second, padded (000-999) - * * `'a'`: AM/PM marker - * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200) - * * `'ww'`: ISO-8601 week of year (00-53) - * * `'w'`: ISO-8601 week of year (0-53) - * - * `format` string can also be one of the following predefined - * {@link guide/i18n localizable formats}: - * - * * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale - * (e.g. Sep 3, 2010 12:05:08 PM) - * * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 PM) - * * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US locale - * (e.g. Friday, September 3, 2010) - * * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010) - * * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010) - * * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10) - * * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM) - * * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM) - * - * `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g. - * `"h 'in the morning'"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence - * (e.g. `"h 'o''clock'"`). - * - * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or - * number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its - * shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is - * specified in the string input, the time is considered to be in the local timezone. - * @param {string=} format Formatting rules (see Description). If not specified, - * `mediumDate` is used. - * @param {string=} timezone Timezone to be used for formatting. Right now, only `'UTC'` is supported. - * If not specified, the timezone of the browser will be used. - * @returns {string} Formatted string or the input if input is not recognized as date/millis. - * - * @example - - - {{1288323623006 | date:'medium'}}: - {{1288323623006 | date:'medium'}}
- {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}: - {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}
- {{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}: - {{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}
- {{1288323623006 | date:"MM/dd/yyyy 'at' h:mma"}}: - {{'1288323623006' | date:"MM/dd/yyyy 'at' h:mma"}}
-
- - it('should format date', function() { - expect(element(by.binding("1288323623006 | date:'medium'")).getText()). - toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/); - expect(element(by.binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).getText()). - toMatch(/2010\-10\-2\d \d{2}:\d{2}:\d{2} (\-|\+)?\d{4}/); - expect(element(by.binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")).getText()). - toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/); - expect(element(by.binding("'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"")).getText()). - toMatch(/10\/2\d\/2010 at \d{1,2}:\d{2}(AM|PM)/); - }); - -
- */ -dateFilter.$inject = ['$locale']; -function dateFilter($locale) { - - - var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; - // 1 2 3 4 5 6 7 8 9 10 11 - function jsonStringToDate(string) { - var match; - if (match = string.match(R_ISO8601_STR)) { - var date = new Date(0), - tzHour = 0, - tzMin = 0, - dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear, - timeSetter = match[8] ? date.setUTCHours : date.setHours; - - if (match[9]) { - tzHour = int(match[9] + match[10]); - tzMin = int(match[9] + match[11]); - } - dateSetter.call(date, int(match[1]), int(match[2]) - 1, int(match[3])); - var h = int(match[4] || 0) - tzHour; - var m = int(match[5] || 0) - tzMin; - var s = int(match[6] || 0); - var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000); - timeSetter.call(date, h, m, s, ms); - return date; - } - return string; - } - - - return function(date, format, timezone) { - var text = '', - parts = [], - fn, match; - - format = format || 'mediumDate'; - format = $locale.DATETIME_FORMATS[format] || format; - if (isString(date)) { - date = NUMBER_STRING.test(date) ? int(date) : jsonStringToDate(date); - } - - if (isNumber(date)) { - date = new Date(date); - } - - if (!isDate(date)) { - return date; - } - - while (format) { - match = DATE_FORMATS_SPLIT.exec(format); - if (match) { - parts = concat(parts, match, 1); - format = parts.pop(); - } else { - parts.push(format); - format = null; - } - } - - if (timezone && timezone === 'UTC') { - date = new Date(date.getTime()); - date.setMinutes(date.getMinutes() + date.getTimezoneOffset()); - } - forEach(parts, function(value) { - fn = DATE_FORMATS[value]; - text += fn ? fn(date, $locale.DATETIME_FORMATS) - : value.replace(/(^'|'$)/g, '').replace(/''/g, "'"); - }); - - return text; - }; -} - - -/** - * @ngdoc filter - * @name json - * @kind function - * - * @description - * Allows you to convert a JavaScript object into JSON string. - * - * This filter is mostly useful for debugging. When using the double curly {{value}} notation - * the binding is automatically converted to JSON. - * - * @param {*} object Any JavaScript object (including arrays and primitive types) to filter. - * @returns {string} JSON string. - * - * - * @example - - -
{{ {'name':'value'} | json }}
-
- - it('should jsonify filtered objects', function() { - expect(element(by.binding("{'name':'value'}")).getText()).toMatch(/\{\n "name": ?"value"\n}/); - }); - -
- * - */ -function jsonFilter() { - return function(object) { - return toJson(object, true); - }; -} - - -/** - * @ngdoc filter - * @name lowercase - * @kind function - * @description - * Converts string to lowercase. - * @see angular.lowercase - */ -var lowercaseFilter = valueFn(lowercase); - - -/** - * @ngdoc filter - * @name uppercase - * @kind function - * @description - * Converts string to uppercase. - * @see angular.uppercase - */ -var uppercaseFilter = valueFn(uppercase); - -/** - * @ngdoc filter - * @name limitTo - * @kind function - * - * @description - * Creates a new array or string containing only a specified number of elements. The elements - * are taken from either the beginning or the end of the source array, string or number, as specified by - * the value and sign (positive or negative) of `limit`. If a number is used as input, it is - * converted to a string. - * - * @param {Array|string|number} input Source array, string or number to be limited. - * @param {string|number} limit The length of the returned array or string. If the `limit` number - * is positive, `limit` number of items from the beginning of the source array/string are copied. - * If the number is negative, `limit` number of items from the end of the source array/string - * are copied. The `limit` will be trimmed if it exceeds `array.length` - * @returns {Array|string} A new sub-array or substring of length `limit` or less if input array - * had less than `limit` elements. - * - * @example - - - -
- Limit {{numbers}} to: -

Output numbers: {{ numbers | limitTo:numLimit }}

- Limit {{letters}} to: -

Output letters: {{ letters | limitTo:letterLimit }}

- Limit {{longNumber}} to: -

Output long number: {{ longNumber | limitTo:longNumberLimit }}

-
-
- - var numLimitInput = element(by.model('numLimit')); - var letterLimitInput = element(by.model('letterLimit')); - var longNumberLimitInput = element(by.model('longNumberLimit')); - var limitedNumbers = element(by.binding('numbers | limitTo:numLimit')); - var limitedLetters = element(by.binding('letters | limitTo:letterLimit')); - var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit')); - - it('should limit the number array to first three items', function() { - expect(numLimitInput.getAttribute('value')).toBe('3'); - expect(letterLimitInput.getAttribute('value')).toBe('3'); - expect(longNumberLimitInput.getAttribute('value')).toBe('3'); - expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]'); - expect(limitedLetters.getText()).toEqual('Output letters: abc'); - expect(limitedLongNumber.getText()).toEqual('Output long number: 234'); - }); - - // There is a bug in safari and protractor that doesn't like the minus key - // it('should update the output when -3 is entered', function() { - // numLimitInput.clear(); - // numLimitInput.sendKeys('-3'); - // letterLimitInput.clear(); - // letterLimitInput.sendKeys('-3'); - // longNumberLimitInput.clear(); - // longNumberLimitInput.sendKeys('-3'); - // expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]'); - // expect(limitedLetters.getText()).toEqual('Output letters: ghi'); - // expect(limitedLongNumber.getText()).toEqual('Output long number: 342'); - // }); - - it('should not exceed the maximum size of input array', function() { - numLimitInput.clear(); - numLimitInput.sendKeys('100'); - letterLimitInput.clear(); - letterLimitInput.sendKeys('100'); - longNumberLimitInput.clear(); - longNumberLimitInput.sendKeys('100'); - expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]'); - expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi'); - expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342'); - }); - -
-*/ -function limitToFilter() { - return function(input, limit) { - if (isNumber(input)) input = input.toString(); - if (!isArray(input) && !isString(input)) return input; - - if (Math.abs(Number(limit)) === Infinity) { - limit = Number(limit); - } else { - limit = int(limit); - } - - if (isString(input)) { - //NaN check on limit - if (limit) { - return limit >= 0 ? input.slice(0, limit) : input.slice(limit, input.length); - } else { - return ""; - } - } - - var out = [], - i, n; - - // if abs(limit) exceeds maximum length, trim it - if (limit > input.length) - limit = input.length; - else if (limit < -input.length) - limit = -input.length; - - if (limit > 0) { - i = 0; - n = limit; - } else { - i = input.length + limit; - n = input.length; - } - - for (; i < n; i++) { - out.push(input[i]); - } - - return out; - }; -} - -/** - * @ngdoc filter - * @name orderBy - * @kind function - * - * @description - * Orders a specified `array` by the `expression` predicate. It is ordered alphabetically - * for strings and numerically for numbers. Note: if you notice numbers are not being sorted - * correctly, make sure they are actually being saved as numbers and not strings. - * - * @param {Array} array The array to sort. - * @param {function(*)|string|Array.<(function(*)|string)>=} expression A predicate to be - * used by the comparator to determine the order of elements. - * - * Can be one of: - * - * - `function`: Getter function. The result of this function will be sorted using the - * `<`, `=`, `>` operator. - * - `string`: An Angular expression. The result of this expression is used to compare elements - * (for example `name` to sort by a property called `name` or `name.substr(0, 3)` to sort by - * 3 first characters of a property called `name`). The result of a constant expression - * is interpreted as a property name to be used in comparisons (for example `"special name"` - * to sort object by the value of their `special name` property). An expression can be - * optionally prefixed with `+` or `-` to control ascending or descending sort order - * (for example, `+name` or `-name`). If no property is provided, (e.g. `'+'`) then the array - * element itself is used to compare where sorting. - * - `Array`: An array of function or string predicates. The first predicate in the array - * is used for sorting, but when two items are equivalent, the next predicate is used. - * - * If the predicate is missing or empty then it defaults to `'+'`. - * - * @param {boolean=} reverse Reverse the order of the array. - * @returns {Array} Sorted copy of the source array. - * - * @example - - - -
-
Sorting predicate = {{predicate}}; reverse = {{reverse}}
-
- [ unsorted ] - - - - - - - - - - - -
Name - (^)Phone NumberAge
{{friend.name}}{{friend.phone}}{{friend.age}}
-
-
-
- * - * It's also possible to call the orderBy filter manually, by injecting `$filter`, retrieving the - * filter routine with `$filter('orderBy')`, and calling the returned filter routine with the - * desired parameters. - * - * Example: - * - * @example - - -
- - - - - - - - - - - -
Name - (^)Phone NumberAge
{{friend.name}}{{friend.phone}}{{friend.age}}
-
-
- - - angular.module('orderByExample', []) - .controller('ExampleController', ['$scope', '$filter', function($scope, $filter) { - var orderBy = $filter('orderBy'); - $scope.friends = [ - { name: 'John', phone: '555-1212', age: 10 }, - { name: 'Mary', phone: '555-9876', age: 19 }, - { name: 'Mike', phone: '555-4321', age: 21 }, - { name: 'Adam', phone: '555-5678', age: 35 }, - { name: 'Julie', phone: '555-8765', age: 29 } - ]; - $scope.order = function(predicate, reverse) { - $scope.friends = orderBy($scope.friends, predicate, reverse); - }; - $scope.order('-age',false); - }]); - -
- */ -orderByFilter.$inject = ['$parse']; -function orderByFilter($parse) { - return function(array, sortPredicate, reverseOrder) { - if (!(isArrayLike(array))) return array; - sortPredicate = isArray(sortPredicate) ? sortPredicate : [sortPredicate]; - if (sortPredicate.length === 0) { sortPredicate = ['+']; } - sortPredicate = sortPredicate.map(function(predicate) { - var descending = false, get = predicate || identity; - if (isString(predicate)) { - if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) { - descending = predicate.charAt(0) == '-'; - predicate = predicate.substring(1); - } - if (predicate === '') { - // Effectively no predicate was passed so we compare identity - return reverseComparator(function(a, b) { - return compare(a, b); - }, descending); - } - get = $parse(predicate); - if (get.constant) { - var key = get(); - return reverseComparator(function(a, b) { - return compare(a[key], b[key]); - }, descending); - } - } - return reverseComparator(function(a, b) { - return compare(get(a),get(b)); - }, descending); - }); - return slice.call(array).sort(reverseComparator(comparator, reverseOrder)); - - function comparator(o1, o2) { - for (var i = 0; i < sortPredicate.length; i++) { - var comp = sortPredicate[i](o1, o2); - if (comp !== 0) return comp; - } - return 0; - } - function reverseComparator(comp, descending) { - return descending - ? function(a, b) {return comp(b,a);} - : comp; - } - function compare(v1, v2) { - var t1 = typeof v1; - var t2 = typeof v2; - if (t1 == t2) { - if (isDate(v1) && isDate(v2)) { - v1 = v1.valueOf(); - v2 = v2.valueOf(); - } - if (t1 == "string") { - v1 = v1.toLowerCase(); - v2 = v2.toLowerCase(); - } - if (v1 === v2) return 0; - return v1 < v2 ? -1 : 1; - } else { - return t1 < t2 ? -1 : 1; - } - } - }; -} - -function ngDirective(directive) { - if (isFunction(directive)) { - directive = { - link: directive - }; - } - directive.restrict = directive.restrict || 'AC'; - return valueFn(directive); -} - -/** - * @ngdoc directive - * @name a - * @restrict E - * - * @description - * Modifies the default behavior of the html A tag so that the default action is prevented when - * the href attribute is empty. - * - * This change permits the easy creation of action links with the `ngClick` directive - * without changing the location or causing page reloads, e.g.: - * `Add Item` - */ -var htmlAnchorDirective = valueFn({ - restrict: 'E', - compile: function(element, attr) { - if (!attr.href && !attr.xlinkHref && !attr.name) { - return function(scope, element) { - // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. - var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ? - 'xlink:href' : 'href'; - element.on('click', function(event) { - // if we have no href url, then don't navigate anywhere. - if (!element.attr(href)) { - event.preventDefault(); - } - }); - }; - } - } -}); - -/** - * @ngdoc directive - * @name ngHref - * @restrict A - * @priority 99 - * - * @description - * Using Angular markup like `{{hash}}` in an href attribute will - * make the link go to the wrong URL if the user clicks it before - * Angular has a chance to replace the `{{hash}}` markup with its - * value. Until Angular replaces the markup the link will be broken - * and will most likely return a 404 error. - * - * The `ngHref` directive solves this problem. - * - * The wrong way to write it: - * ```html - * link1 - * ``` - * - * The correct way to write it: - * ```html - * link1 - * ``` - * - * @element A - * @param {template} ngHref any string which can contain `{{}}` markup. - * - * @example - * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes - * in links and their different behaviors: - - -
- link 1 (link, don't reload)
- link 2 (link, don't reload)
- link 3 (link, reload!)
- anchor (link, don't reload)
- anchor (no link)
- link (link, change location) -
- - it('should execute ng-click but not reload when href without value', function() { - element(by.id('link-1')).click(); - expect(element(by.model('value')).getAttribute('value')).toEqual('1'); - expect(element(by.id('link-1')).getAttribute('href')).toBe(''); - }); - - it('should execute ng-click but not reload when href empty string', function() { - element(by.id('link-2')).click(); - expect(element(by.model('value')).getAttribute('value')).toEqual('2'); - expect(element(by.id('link-2')).getAttribute('href')).toBe(''); - }); - - it('should execute ng-click and change url when ng-href specified', function() { - expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\/123$/); - - element(by.id('link-3')).click(); - - // At this point, we navigate away from an Angular page, so we need - // to use browser.driver to get the base webdriver. - - browser.wait(function() { - return browser.driver.getCurrentUrl().then(function(url) { - return url.match(/\/123$/); - }); - }, 5000, 'page should navigate to /123'); - }); - - xit('should execute ng-click but not reload when href empty string and name specified', function() { - element(by.id('link-4')).click(); - expect(element(by.model('value')).getAttribute('value')).toEqual('4'); - expect(element(by.id('link-4')).getAttribute('href')).toBe(''); - }); - - it('should execute ng-click but not reload when no href but name specified', function() { - element(by.id('link-5')).click(); - expect(element(by.model('value')).getAttribute('value')).toEqual('5'); - expect(element(by.id('link-5')).getAttribute('href')).toBe(null); - }); - - it('should only change url when only ng-href', function() { - element(by.model('value')).clear(); - element(by.model('value')).sendKeys('6'); - expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\/6$/); - - element(by.id('link-6')).click(); - - // At this point, we navigate away from an Angular page, so we need - // to use browser.driver to get the base webdriver. - browser.wait(function() { - return browser.driver.getCurrentUrl().then(function(url) { - return url.match(/\/6$/); - }); - }, 5000, 'page should navigate to /6'); - }); - -
- */ - -/** - * @ngdoc directive - * @name ngSrc - * @restrict A - * @priority 99 - * - * @description - * Using Angular markup like `{{hash}}` in a `src` attribute doesn't - * work right: The browser will fetch from the URL with the literal - * text `{{hash}}` until Angular replaces the expression inside - * `{{hash}}`. The `ngSrc` directive solves this problem. - * - * The buggy way to write it: - * ```html - * - * ``` - * - * The correct way to write it: - * ```html - * - * ``` - * - * @element IMG - * @param {template} ngSrc any string which can contain `{{}}` markup. - */ - -/** - * @ngdoc directive - * @name ngSrcset - * @restrict A - * @priority 99 - * - * @description - * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't - * work right: The browser will fetch from the URL with the literal - * text `{{hash}}` until Angular replaces the expression inside - * `{{hash}}`. The `ngSrcset` directive solves this problem. - * - * The buggy way to write it: - * ```html - * - * ``` - * - * The correct way to write it: - * ```html - * - * ``` - * - * @element IMG - * @param {template} ngSrcset any string which can contain `{{}}` markup. - */ - -/** - * @ngdoc directive - * @name ngDisabled - * @restrict A - * @priority 100 - * - * @description - * - * We shouldn't do this, because it will make the button enabled on Chrome/Firefox but not on IE8 and older IEs: - * ```html - *
- * - *
- * ``` - * - * The HTML specification does not require browsers to preserve the values of boolean attributes - * such as disabled. (Their presence means true and their absence means false.) - * If we put an Angular interpolation expression into such an attribute then the - * binding information would be lost when the browser removes the attribute. - * The `ngDisabled` directive solves this problem for the `disabled` attribute. - * This complementary directive is not removed by the browser and so provides - * a permanent reliable place to store the binding information. - * - * @example - - - Click me to toggle:
- -
- - it('should toggle button', function() { - expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy(); - element(by.model('checked')).click(); - expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy(); - }); - -
- * - * @element INPUT - * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy, - * then special attribute "disabled" will be set on the element - */ - - -/** - * @ngdoc directive - * @name ngChecked - * @restrict A - * @priority 100 - * - * @description - * The HTML specification does not require browsers to preserve the values of boolean attributes - * such as checked. (Their presence means true and their absence means false.) - * If we put an Angular interpolation expression into such an attribute then the - * binding information would be lost when the browser removes the attribute. - * The `ngChecked` directive solves this problem for the `checked` attribute. - * This complementary directive is not removed by the browser and so provides - * a permanent reliable place to store the binding information. - * @example - - - Check me to check both:
- -
- - it('should check both checkBoxes', function() { - expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy(); - element(by.model('master')).click(); - expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy(); - }); - -
- * - * @element INPUT - * @param {expression} ngChecked If the {@link guide/expression expression} is truthy, - * then special attribute "checked" will be set on the element - */ - - -/** - * @ngdoc directive - * @name ngReadonly - * @restrict A - * @priority 100 - * - * @description - * The HTML specification does not require browsers to preserve the values of boolean attributes - * such as readonly. (Their presence means true and their absence means false.) - * If we put an Angular interpolation expression into such an attribute then the - * binding information would be lost when the browser removes the attribute. - * The `ngReadonly` directive solves this problem for the `readonly` attribute. - * This complementary directive is not removed by the browser and so provides - * a permanent reliable place to store the binding information. - * @example - - - Check me to make text readonly:
- -
- - it('should toggle readonly attr', function() { - expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeFalsy(); - element(by.model('checked')).click(); - expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeTruthy(); - }); - -
- * - * @element INPUT - * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy, - * then special attribute "readonly" will be set on the element - */ - - -/** - * @ngdoc directive - * @name ngSelected - * @restrict A - * @priority 100 - * - * @description - * The HTML specification does not require browsers to preserve the values of boolean attributes - * such as selected. (Their presence means true and their absence means false.) - * If we put an Angular interpolation expression into such an attribute then the - * binding information would be lost when the browser removes the attribute. - * The `ngSelected` directive solves this problem for the `selected` attribute. - * This complementary directive is not removed by the browser and so provides - * a permanent reliable place to store the binding information. - * - * @example - - - Check me to select:
- -
- - it('should select Greetings!', function() { - expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy(); - element(by.model('selected')).click(); - expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy(); - }); - -
- * - * @element OPTION - * @param {expression} ngSelected If the {@link guide/expression expression} is truthy, - * then special attribute "selected" will be set on the element - */ - -/** - * @ngdoc directive - * @name ngOpen - * @restrict A - * @priority 100 - * - * @description - * The HTML specification does not require browsers to preserve the values of boolean attributes - * such as open. (Their presence means true and their absence means false.) - * If we put an Angular interpolation expression into such an attribute then the - * binding information would be lost when the browser removes the attribute. - * The `ngOpen` directive solves this problem for the `open` attribute. - * This complementary directive is not removed by the browser and so provides - * a permanent reliable place to store the binding information. - * @example - - - Check me check multiple:
-
- Show/Hide me -
-
- - it('should toggle open', function() { - expect(element(by.id('details')).getAttribute('open')).toBeFalsy(); - element(by.model('open')).click(); - expect(element(by.id('details')).getAttribute('open')).toBeTruthy(); - }); - -
- * - * @element DETAILS - * @param {expression} ngOpen If the {@link guide/expression expression} is truthy, - * then special attribute "open" will be set on the element - */ - -var ngAttributeAliasDirectives = {}; - - -// boolean attrs are evaluated -forEach(BOOLEAN_ATTR, function(propName, attrName) { - // binding to multiple is not supported - if (propName == "multiple") return; - - var normalized = directiveNormalize('ng-' + attrName); - ngAttributeAliasDirectives[normalized] = function() { - return { - restrict: 'A', - priority: 100, - link: function(scope, element, attr) { - scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) { - attr.$set(attrName, !!value); - }); - } - }; - }; -}); - -// aliased input attrs are evaluated -forEach(ALIASED_ATTR, function(htmlAttr, ngAttr) { - ngAttributeAliasDirectives[ngAttr] = function() { - return { - priority: 100, - link: function(scope, element, attr) { - //special case ngPattern when a literal regular expression value - //is used as the expression (this way we don't have to watch anything). - if (ngAttr === "ngPattern" && attr.ngPattern.charAt(0) == "/") { - var match = attr.ngPattern.match(REGEX_STRING_REGEXP); - if (match) { - attr.$set("ngPattern", new RegExp(match[1], match[2])); - return; - } - } - - scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) { - attr.$set(ngAttr, value); - }); - } - }; - }; -}); - -// ng-src, ng-srcset, ng-href are interpolated -forEach(['src', 'srcset', 'href'], function(attrName) { - var normalized = directiveNormalize('ng-' + attrName); - ngAttributeAliasDirectives[normalized] = function() { - return { - priority: 99, // it needs to run after the attributes are interpolated - link: function(scope, element, attr) { - var propName = attrName, - name = attrName; - - if (attrName === 'href' && - toString.call(element.prop('href')) === '[object SVGAnimatedString]') { - name = 'xlinkHref'; - attr.$attr[name] = 'xlink:href'; - propName = null; - } - - attr.$observe(normalized, function(value) { - if (!value) { - if (attrName === 'href') { - attr.$set(name, null); - } - return; - } - - attr.$set(name, value); - - // on IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist - // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need - // to set the property as well to achieve the desired effect. - // we use attr[attrName] value since $set can sanitize the url. - if (msie && propName) element.prop(propName, attr[name]); - }); - } - }; - }; -}); - -/* global -nullFormCtrl, -SUBMITTED_CLASS, addSetValidityMethod: true - */ -var nullFormCtrl = { - $addControl: noop, - $$renameControl: nullFormRenameControl, - $removeControl: noop, - $setValidity: noop, - $setDirty: noop, - $setPristine: noop, - $setSubmitted: noop -}, -SUBMITTED_CLASS = 'ng-submitted'; - -function nullFormRenameControl(control, name) { - control.$name = name; -} - -/** - * @ngdoc type - * @name form.FormController - * - * @property {boolean} $pristine True if user has not interacted with the form yet. - * @property {boolean} $dirty True if user has already interacted with the form. - * @property {boolean} $valid True if all of the containing forms and controls are valid. - * @property {boolean} $invalid True if at least one containing control or form is invalid. - * @property {boolean} $submitted True if user has submitted the form even if its invalid. - * - * @property {Object} $error Is an object hash, containing references to controls or - * forms with failing validators, where: - * - * - keys are validation tokens (error names), - * - values are arrays of controls or forms that have a failing validator for given error name. - * - * Built-in validation tokens: - * - * - `email` - * - `max` - * - `maxlength` - * - `min` - * - `minlength` - * - `number` - * - `pattern` - * - `required` - * - `url` - * - `date` - * - `datetimelocal` - * - `time` - * - `week` - * - `month` - * - * @description - * `FormController` keeps track of all its controls and nested forms as well as the state of them, - * such as being valid/invalid or dirty/pristine. - * - * Each {@link ng.directive:form form} directive creates an instance - * of `FormController`. - * - */ -//asks for $scope to fool the BC controller module -FormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate']; -function FormController(element, attrs, $scope, $animate, $interpolate) { - var form = this, - controls = []; - - var parentForm = form.$$parentForm = element.parent().controller('form') || nullFormCtrl; - - // init state - form.$error = {}; - form.$$success = {}; - form.$pending = undefined; - form.$name = $interpolate(attrs.name || attrs.ngForm || '')($scope); - form.$dirty = false; - form.$pristine = true; - form.$valid = true; - form.$invalid = false; - form.$submitted = false; - - parentForm.$addControl(form); - - /** - * @ngdoc method - * @name form.FormController#$rollbackViewValue - * - * @description - * Rollback all form controls pending updates to the `$modelValue`. - * - * Updates may be pending by a debounced event or because the input is waiting for a some future - * event defined in `ng-model-options`. This method is typically needed by the reset button of - * a form that uses `ng-model-options` to pend updates. - */ - form.$rollbackViewValue = function() { - forEach(controls, function(control) { - control.$rollbackViewValue(); - }); - }; - - /** - * @ngdoc method - * @name form.FormController#$commitViewValue - * - * @description - * Commit all form controls pending updates to the `$modelValue`. - * - * Updates may be pending by a debounced event or because the input is waiting for a some future - * event defined in `ng-model-options`. This method is rarely needed as `NgModelController` - * usually handles calling this in response to input events. - */ - form.$commitViewValue = function() { - forEach(controls, function(control) { - control.$commitViewValue(); - }); - }; - - /** - * @ngdoc method - * @name form.FormController#$addControl - * - * @description - * Register a control with the form. - * - * Input elements using ngModelController do this automatically when they are linked. - */ - form.$addControl = function(control) { - // Breaking change - before, inputs whose name was "hasOwnProperty" were quietly ignored - // and not added to the scope. Now we throw an error. - assertNotHasOwnProperty(control.$name, 'input'); - controls.push(control); - - if (control.$name) { - form[control.$name] = control; - } - }; - - // Private API: rename a form control - form.$$renameControl = function(control, newName) { - var oldName = control.$name; - - if (form[oldName] === control) { - delete form[oldName]; - } - form[newName] = control; - control.$name = newName; - }; - - /** - * @ngdoc method - * @name form.FormController#$removeControl - * - * @description - * Deregister a control from the form. - * - * Input elements using ngModelController do this automatically when they are destroyed. - */ - form.$removeControl = function(control) { - if (control.$name && form[control.$name] === control) { - delete form[control.$name]; - } - forEach(form.$pending, function(value, name) { - form.$setValidity(name, null, control); - }); - forEach(form.$error, function(value, name) { - form.$setValidity(name, null, control); - }); - - arrayRemove(controls, control); - }; - - - /** - * @ngdoc method - * @name form.FormController#$setValidity - * - * @description - * Sets the validity of a form control. - * - * This method will also propagate to parent forms. - */ - addSetValidityMethod({ - ctrl: this, - $element: element, - set: function(object, property, control) { - var list = object[property]; - if (!list) { - object[property] = [control]; - } else { - var index = list.indexOf(control); - if (index === -1) { - list.push(control); - } - } - }, - unset: function(object, property, control) { - var list = object[property]; - if (!list) { - return; - } - arrayRemove(list, control); - if (list.length === 0) { - delete object[property]; - } - }, - parentForm: parentForm, - $animate: $animate - }); - - /** - * @ngdoc method - * @name form.FormController#$setDirty - * - * @description - * Sets the form to a dirty state. - * - * This method can be called to add the 'ng-dirty' class and set the form to a dirty - * state (ng-dirty class). This method will also propagate to parent forms. - */ - form.$setDirty = function() { - $animate.removeClass(element, PRISTINE_CLASS); - $animate.addClass(element, DIRTY_CLASS); - form.$dirty = true; - form.$pristine = false; - parentForm.$setDirty(); - }; - - /** - * @ngdoc method - * @name form.FormController#$setPristine - * - * @description - * Sets the form to its pristine state. - * - * This method can be called to remove the 'ng-dirty' class and set the form to its pristine - * state (ng-pristine class). This method will also propagate to all the controls contained - * in this form. - * - * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after - * saving or resetting it. - */ - form.$setPristine = function() { - $animate.setClass(element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS); - form.$dirty = false; - form.$pristine = true; - form.$submitted = false; - forEach(controls, function(control) { - control.$setPristine(); - }); - }; - - /** - * @ngdoc method - * @name form.FormController#$setUntouched - * - * @description - * Sets the form to its untouched state. - * - * This method can be called to remove the 'ng-touched' class and set the form controls to their - * untouched state (ng-untouched class). - * - * Setting a form controls back to their untouched state is often useful when setting the form - * back to its pristine state. - */ - form.$setUntouched = function() { - forEach(controls, function(control) { - control.$setUntouched(); - }); - }; - - /** - * @ngdoc method - * @name form.FormController#$setSubmitted - * - * @description - * Sets the form to its submitted state. - */ - form.$setSubmitted = function() { - $animate.addClass(element, SUBMITTED_CLASS); - form.$submitted = true; - parentForm.$setSubmitted(); - }; -} - -/** - * @ngdoc directive - * @name ngForm - * @restrict EAC - * - * @description - * Nestable alias of {@link ng.directive:form `form`} directive. HTML - * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a - * sub-group of controls needs to be determined. - * - * Note: the purpose of `ngForm` is to group controls, - * but not to be a replacement for the `
` tag with all of its capabilities - * (e.g. posting to the server, ...). - * - * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into - * related scope, under this name. - * - */ - - /** - * @ngdoc directive - * @name form - * @restrict E - * - * @description - * Directive that instantiates - * {@link form.FormController FormController}. - * - * If the `name` attribute is specified, the form controller is published onto the current scope under - * this name. - * - * # Alias: {@link ng.directive:ngForm `ngForm`} - * - * In Angular forms can be nested. This means that the outer form is valid when all of the child - * forms are valid as well. However, browsers do not allow nesting of `` elements, so - * Angular provides the {@link ng.directive:ngForm `ngForm`} directive which behaves identically to - * `` but can be nested. This allows you to have nested forms, which is very useful when - * using Angular validation directives in forms that are dynamically generated using the - * {@link ng.directive:ngRepeat `ngRepeat`} directive. Since you cannot dynamically generate the `name` - * attribute of input elements using interpolation, you have to wrap each set of repeated inputs in an - * `ngForm` directive and nest these in an outer `form` element. - * - * - * # CSS classes - * - `ng-valid` is set if the form is valid. - * - `ng-invalid` is set if the form is invalid. - * - `ng-pristine` is set if the form is pristine. - * - `ng-dirty` is set if the form is dirty. - * - `ng-submitted` is set if the form was submitted. - * - * Keep in mind that ngAnimate can detect each of these classes when added and removed. - * - * - * # Submitting a form and preventing the default action - * - * Since the role of forms in client-side Angular applications is different than in classical - * roundtrip apps, it is desirable for the browser not to translate the form submission into a full - * page reload that sends the data to the server. Instead some javascript logic should be triggered - * to handle the form submission in an application-specific way. - * - * For this reason, Angular prevents the default action (form submission to the server) unless the - * `` element has an `action` attribute specified. - * - * You can use one of the following two ways to specify what javascript method should be called when - * a form is submitted: - * - * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element - * - {@link ng.directive:ngClick ngClick} directive on the first - * button or input field of type submit (input[type=submit]) - * - * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit} - * or {@link ng.directive:ngClick ngClick} directives. - * This is because of the following form submission rules in the HTML specification: - * - * - If a form has only one input field then hitting enter in this field triggers form submit - * (`ngSubmit`) - * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter - * doesn't trigger submit - * - if a form has one or more input fields and one or more buttons or input[type=submit] then - * hitting enter in any of the input fields will trigger the click handler on the *first* button or - * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`) - * - * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is - * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit` - * to have access to the updated model. - * - * ## Animation Hooks - * - * Animations in ngForm are triggered when any of the associated CSS classes are added and removed. - * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any - * other validations that are performed within the form. Animations in ngForm are similar to how - * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well - * as JS animations. - * - * The following example shows a simple way to utilize CSS transitions to style a form element - * that has been rendered as invalid after it has been validated: - * - *
- * //be sure to include ngAnimate as a module to hook into more
- * //advanced animations
- * .my-form {
- *   transition:0.5s linear all;
- *   background: white;
- * }
- * .my-form.ng-invalid {
- *   background: red;
- *   color:white;
- * }
- * 
- * - * @example - - - - - - userType: - Required!
- userType = {{userType}}
- myForm.input.$valid = {{myForm.input.$valid}}
- myForm.input.$error = {{myForm.input.$error}}
- myForm.$valid = {{myForm.$valid}}
- myForm.$error.required = {{!!myForm.$error.required}}
- -
- - it('should initialize to model', function() { - var userType = element(by.binding('userType')); - var valid = element(by.binding('myForm.input.$valid')); - - expect(userType.getText()).toContain('guest'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - var userType = element(by.binding('userType')); - var valid = element(by.binding('myForm.input.$valid')); - var userInput = element(by.model('userType')); - - userInput.clear(); - userInput.sendKeys(''); - - expect(userType.getText()).toEqual('userType ='); - expect(valid.getText()).toContain('false'); - }); - -
- * - * @param {string=} name Name of the form. If specified, the form controller will be published into - * related scope, under this name. - */ -var formDirectiveFactory = function(isNgForm) { - return ['$timeout', function($timeout) { - var formDirective = { - name: 'form', - restrict: isNgForm ? 'EAC' : 'E', - controller: FormController, - compile: function ngFormCompile(formElement) { - // Setup initial state of the control - formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS); - - return { - pre: function ngFormPreLink(scope, formElement, attr, controller) { - // if `action` attr is not present on the form, prevent the default action (submission) - if (!('action' in attr)) { - // we can't use jq events because if a form is destroyed during submission the default - // action is not prevented. see #1238 - // - // IE 9 is not affected because it doesn't fire a submit event and try to do a full - // page reload if the form was destroyed by submission of the form via a click handler - // on a button in the form. Looks like an IE9 specific bug. - var handleFormSubmission = function(event) { - scope.$apply(function() { - controller.$commitViewValue(); - controller.$setSubmitted(); - }); - - event.preventDefault - ? event.preventDefault() - : event.returnValue = false; // IE - }; - - addEventListenerFn(formElement[0], 'submit', handleFormSubmission); - - // unregister the preventDefault listener so that we don't not leak memory but in a - // way that will achieve the prevention of the default action. - formElement.on('$destroy', function() { - $timeout(function() { - removeEventListenerFn(formElement[0], 'submit', handleFormSubmission); - }, 0, false); - }); - } - - var parentFormCtrl = controller.$$parentForm, - alias = controller.$name; - - if (alias) { - setter(scope, alias, controller, alias); - attr.$observe(attr.name ? 'name' : 'ngForm', function(newValue) { - if (alias === newValue) return; - setter(scope, alias, undefined, alias); - alias = newValue; - setter(scope, alias, controller, alias); - parentFormCtrl.$$renameControl(controller, alias); - }); - } - formElement.on('$destroy', function() { - parentFormCtrl.$removeControl(controller); - if (alias) { - setter(scope, alias, undefined, alias); - } - extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards - }); - } - }; - } - }; - - return formDirective; - }]; -}; - -var formDirective = formDirectiveFactory(); -var ngFormDirective = formDirectiveFactory(true); - -/* global VALID_CLASS: true, - INVALID_CLASS: true, - PRISTINE_CLASS: true, - DIRTY_CLASS: true, - UNTOUCHED_CLASS: true, - TOUCHED_CLASS: true, -*/ - -// Regex code is obtained from SO: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231 -var ISO_DATE_REGEXP = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/; -var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/; -var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i; -var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/; -var DATE_REGEXP = /^(\d{4})-(\d{2})-(\d{2})$/; -var DATETIMELOCAL_REGEXP = /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/; -var WEEK_REGEXP = /^(\d{4})-W(\d\d)$/; -var MONTH_REGEXP = /^(\d{4})-(\d\d)$/; -var TIME_REGEXP = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/; -var DEFAULT_REGEXP = /(\s+|^)default(\s+|$)/; - -var $ngModelMinErr = new minErr('ngModel'); - -var inputType = { - - /** - * @ngdoc input - * @name input[text] - * - * @description - * Standard HTML text input with angular data binding, inherited by most of the `input` elements. - * - * - * @param {string} ngModel Assignable angular expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Adds `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match - * a RegExp found by evaluating the Angular expression given in the attribute value. - * If the expression evaluates to a RegExp object then this is used directly. - * If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$` - * characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. - * @param {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input. - * This parameter is ignored for input[type=password] controls, which will never trim the - * input. - * - * @example - - - -
- Single word: - - Required! - - Single word only! - - text = {{text}}
- myForm.input.$valid = {{myForm.input.$valid}}
- myForm.input.$error = {{myForm.input.$error}}
- myForm.$valid = {{myForm.$valid}}
- myForm.$error.required = {{!!myForm.$error.required}}
-
-
- - var text = element(by.binding('text')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('text')); - - it('should initialize to model', function() { - expect(text.getText()).toContain('guest'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - input.clear(); - input.sendKeys(''); - - expect(text.getText()).toEqual('text ='); - expect(valid.getText()).toContain('false'); - }); - - it('should be invalid if multi word', function() { - input.clear(); - input.sendKeys('hello world'); - - expect(valid.getText()).toContain('false'); - }); - -
- */ - 'text': textInputType, - - /** - * @ngdoc input - * @name input[date] - * - * @description - * Input with date validation and transformation. In browsers that do not yet support - * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601 - * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many - * modern browsers do not yet support this input type, it is important to provide cues to users on the - * expected input format via a placeholder or label. - * - * The model must always be a Date object, otherwise Angular will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable angular expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a - * valid ISO date string (yyyy-MM-dd). - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be - * a valid ISO date string (yyyy-MM-dd). - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
- Pick a date in 2013: - - - Required! - - Not a valid date! - value = {{value | date: "yyyy-MM-dd"}}
- myForm.input.$valid = {{myForm.input.$valid}}
- myForm.input.$error = {{myForm.input.$error}}
- myForm.$valid = {{myForm.$valid}}
- myForm.$error.required = {{!!myForm.$error.required}}
-
-
- - var value = element(by.binding('value | date: "yyyy-MM-dd"')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('value')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (see https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2013-10-22'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-01-01'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
- */ - 'date': createDateInputType('date', DATE_REGEXP, - createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']), - 'yyyy-MM-dd'), - - /** - * @ngdoc input - * @name input[datetime-local] - * - * @description - * Input with datetime validation and transformation. In browsers that do not yet support - * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`. - * - * The model must always be a Date object, otherwise Angular will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable angular expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a - * valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be - * a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
- Pick a date between in 2013: - - - Required! - - Not a valid date! - value = {{value | date: "yyyy-MM-ddTHH:mm:ss"}}
- myForm.input.$valid = {{myForm.input.$valid}}
- myForm.input.$error = {{myForm.input.$error}}
- myForm.$valid = {{myForm.$valid}}
- myForm.$error.required = {{!!myForm.$error.required}}
-
-
- - var value = element(by.binding('value | date: "yyyy-MM-ddTHH:mm:ss"')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('value')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2010-12-28T14:57:00'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-01-01T23:59:00'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
- */ - 'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP, - createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']), - 'yyyy-MM-ddTHH:mm:ss.sss'), - - /** - * @ngdoc input - * @name input[time] - * - * @description - * Input with time validation and transformation. In browsers that do not yet support - * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a - * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`. - * - * The model must always be a Date object, otherwise Angular will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable angular expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a - * valid ISO time format (HH:mm:ss). - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be a - * valid ISO time format (HH:mm:ss). - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
- Pick a between 8am and 5pm: - - - Required! - - Not a valid date! - value = {{value | date: "HH:mm:ss"}}
- myForm.input.$valid = {{myForm.input.$valid}}
- myForm.input.$error = {{myForm.input.$error}}
- myForm.$valid = {{myForm.$valid}}
- myForm.$error.required = {{!!myForm.$error.required}}
-
-
- - var value = element(by.binding('value | date: "HH:mm:ss"')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('value')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('14:57:00'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('23:59:00'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
- */ - 'time': createDateInputType('time', TIME_REGEXP, - createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']), - 'HH:mm:ss.sss'), - - /** - * @ngdoc input - * @name input[week] - * - * @description - * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support - * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * week format (yyyy-W##), for example: `2013-W02`. - * - * The model must always be a Date object, otherwise Angular will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable angular expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a - * valid ISO week format (yyyy-W##). - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be - * a valid ISO week format (yyyy-W##). - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
- Pick a date between in 2013: - - - Required! - - Not a valid date! - value = {{value | date: "yyyy-Www"}}
- myForm.input.$valid = {{myForm.input.$valid}}
- myForm.input.$error = {{myForm.input.$error}}
- myForm.$valid = {{myForm.$valid}}
- myForm.$error.required = {{!!myForm.$error.required}}
-
-
- - var value = element(by.binding('value | date: "yyyy-Www"')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('value')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2013-W01'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-W01'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
- */ - 'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'), - - /** - * @ngdoc input - * @name input[month] - * - * @description - * Input with month validation and transformation. In browsers that do not yet support - * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 - * month format (yyyy-MM), for example: `2009-01`. - * - * The model must always be a Date object, otherwise Angular will throw an error. - * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. - * If the model is not set to the first of the month, the next view to model update will set it - * to the first of the month. - * - * The timezone to be used to read/write the `Date` instance in the model can be defined using - * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. - * - * @param {string} ngModel Assignable angular expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be - * a valid ISO month format (yyyy-MM). - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must - * be a valid ISO month format (yyyy-MM). - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
- Pick a month int 2013: - - - Required! - - Not a valid month! - value = {{value | date: "yyyy-MM"}}
- myForm.input.$valid = {{myForm.input.$valid}}
- myForm.input.$error = {{myForm.input.$error}}
- myForm.$valid = {{myForm.$valid}}
- myForm.$error.required = {{!!myForm.$error.required}}
-
-
- - var value = element(by.binding('value | date: "yyyy-MM"')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('value')); - - // currently protractor/webdriver does not support - // sending keys to all known HTML5 input controls - // for various browsers (https://github.com/angular/protractor/issues/562). - function setInput(val) { - // set the value of the element and force validation. - var scr = "var ipt = document.getElementById('exampleInput'); " + - "ipt.value = '" + val + "';" + - "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; - browser.executeScript(scr); - } - - it('should initialize to model', function() { - expect(value.getText()).toContain('2013-10'); - expect(valid.getText()).toContain('myForm.input.$valid = true'); - }); - - it('should be invalid if empty', function() { - setInput(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - - it('should be invalid if over max', function() { - setInput('2015-01'); - expect(value.getText()).toContain(''); - expect(valid.getText()).toContain('myForm.input.$valid = false'); - }); - -
- */ - 'month': createDateInputType('month', MONTH_REGEXP, - createDateParser(MONTH_REGEXP, ['yyyy', 'MM']), - 'yyyy-MM'), - - /** - * @ngdoc input - * @name input[number] - * - * @description - * Text input with number validation and transformation. Sets the `number` validation - * error if not a valid number. - * - * The model must always be a number, otherwise Angular will throw an error. - * - * @param {string} ngModel Assignable angular expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. - * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match - * a RegExp found by evaluating the Angular expression given in the attribute value. - * If the expression evaluates to a RegExp object then this is used directly. - * If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$` - * characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. - * @param {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
- Number: - - Required! - - Not valid number! - value = {{value}}
- myForm.input.$valid = {{myForm.input.$valid}}
- myForm.input.$error = {{myForm.input.$error}}
- myForm.$valid = {{myForm.$valid}}
- myForm.$error.required = {{!!myForm.$error.required}}
-
-
- - var value = element(by.binding('value')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('value')); - - it('should initialize to model', function() { - expect(value.getText()).toContain('12'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - input.clear(); - input.sendKeys(''); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('false'); - }); - - it('should be invalid if over max', function() { - input.clear(); - input.sendKeys('123'); - expect(value.getText()).toEqual('value ='); - expect(valid.getText()).toContain('false'); - }); - -
- */ - 'number': numberInputType, - - - /** - * @ngdoc input - * @name input[url] - * - * @description - * Text input with URL validation. Sets the `url` validation error key if the content is not a - * valid URL. - * - *
- * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex - * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify - * the built-in validators (see the {@link guide/forms Forms guide}) - *
- * - * @param {string} ngModel Assignable angular expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match - * a RegExp found by evaluating the Angular expression given in the attribute value. - * If the expression evaluates to a RegExp object then this is used directly. - * If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$` - * characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. - * @param {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
- URL: - - Required! - - Not valid url! - text = {{text}}
- myForm.input.$valid = {{myForm.input.$valid}}
- myForm.input.$error = {{myForm.input.$error}}
- myForm.$valid = {{myForm.$valid}}
- myForm.$error.required = {{!!myForm.$error.required}}
- myForm.$error.url = {{!!myForm.$error.url}}
-
-
- - var text = element(by.binding('text')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('text')); - - it('should initialize to model', function() { - expect(text.getText()).toContain('http://google.com'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - input.clear(); - input.sendKeys(''); - - expect(text.getText()).toEqual('text ='); - expect(valid.getText()).toContain('false'); - }); - - it('should be invalid if not url', function() { - input.clear(); - input.sendKeys('box'); - - expect(valid.getText()).toContain('false'); - }); - -
- */ - 'url': urlInputType, - - - /** - * @ngdoc input - * @name input[email] - * - * @description - * Text input with email validation. Sets the `email` validation error key if not a valid email - * address. - * - *
- * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex - * used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can - * use `ng-pattern` or modify the built-in validators (see the {@link guide/forms Forms guide}) - *
- * - * @param {string} ngModel Assignable angular expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. - * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string - * that contains the regular expression body that will be converted to a regular expression - * as in the ngPattern directive. - * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match - * a RegExp found by evaluating the Angular expression given in the attribute value. - * If the expression evaluates to a RegExp object then this is used directly. - * If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$` - * characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. - * @param {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
- Email: - - Required! - - Not valid email! - text = {{text}}
- myForm.input.$valid = {{myForm.input.$valid}}
- myForm.input.$error = {{myForm.input.$error}}
- myForm.$valid = {{myForm.$valid}}
- myForm.$error.required = {{!!myForm.$error.required}}
- myForm.$error.email = {{!!myForm.$error.email}}
-
-
- - var text = element(by.binding('text')); - var valid = element(by.binding('myForm.input.$valid')); - var input = element(by.model('text')); - - it('should initialize to model', function() { - expect(text.getText()).toContain('me@example.com'); - expect(valid.getText()).toContain('true'); - }); - - it('should be invalid if empty', function() { - input.clear(); - input.sendKeys(''); - expect(text.getText()).toEqual('text ='); - expect(valid.getText()).toContain('false'); - }); - - it('should be invalid if not email', function() { - input.clear(); - input.sendKeys('xxx'); - - expect(valid.getText()).toContain('false'); - }); - -
- */ - 'email': emailInputType, - - - /** - * @ngdoc input - * @name input[radio] - * - * @description - * HTML radio button. - * - * @param {string} ngModel Assignable angular expression to data-bind to. - * @param {string} value The value to which the expression should be set when selected. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * @param {string} ngValue Angular expression which sets the value to which the expression should - * be set when selected. - * - * @example - - - -
- Red
- Green
- Blue
- color = {{color | json}}
-
- Note that `ng-value="specialValue"` sets radio item's value to be the value of `$scope.specialValue`. -
- - it('should change state', function() { - var color = element(by.binding('color')); - - expect(color.getText()).toContain('blue'); - - element.all(by.model('color')).get(0).click(); - - expect(color.getText()).toContain('red'); - }); - -
- */ - 'radio': radioInputType, - - - /** - * @ngdoc input - * @name input[checkbox] - * - * @description - * HTML checkbox. - * - * @param {string} ngModel Assignable angular expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {expression=} ngTrueValue The value to which the expression should be set when selected. - * @param {expression=} ngFalseValue The value to which the expression should be set when not selected. - * @param {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * - * @example - - - -
- Value1:
- Value2:
- value1 = {{value1}}
- value2 = {{value2}}
-
-
- - it('should change state', function() { - var value1 = element(by.binding('value1')); - var value2 = element(by.binding('value2')); - - expect(value1.getText()).toContain('true'); - expect(value2.getText()).toContain('YES'); - - element(by.model('value1')).click(); - element(by.model('value2')).click(); - - expect(value1.getText()).toContain('false'); - expect(value2.getText()).toContain('NO'); - }); - -
- */ - 'checkbox': checkboxInputType, - - 'hidden': noop, - 'button': noop, - 'submit': noop, - 'reset': noop, - 'file': noop -}; - -function stringBasedInputType(ctrl) { - ctrl.$formatters.push(function(value) { - return ctrl.$isEmpty(value) ? value : value.toString(); - }); -} - -function textInputType(scope, element, attr, ctrl, $sniffer, $browser) { - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - stringBasedInputType(ctrl); -} - -function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) { - var placeholder = element[0].placeholder, noevent = {}; - var type = lowercase(element[0].type); - - // In composition mode, users are still inputing intermediate text buffer, - // hold the listener until composition is done. - // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent - if (!$sniffer.android) { - var composing = false; - - element.on('compositionstart', function(data) { - composing = true; - }); - - element.on('compositionend', function() { - composing = false; - listener(); - }); - } - - var listener = function(ev) { - if (composing) return; - var value = element.val(), - event = ev && ev.type; - - // IE (11 and under) seem to emit an 'input' event if the placeholder value changes. - // We don't want to dirty the value when this happens, so we abort here. Unfortunately, - // IE also sends input events for other non-input-related things, (such as focusing on a - // form control), so this change is not entirely enough to solve this. - if (msie && (ev || noevent).type === 'input' && element[0].placeholder !== placeholder) { - placeholder = element[0].placeholder; - return; - } - - // By default we will trim the value - // If the attribute ng-trim exists we will avoid trimming - // If input type is 'password', the value is never trimmed - if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) { - value = trim(value); - } - - // If a control is suffering from bad input (due to native validators), browsers discard its - // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the - // control's value is the same empty value twice in a row. - if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) { - ctrl.$setViewValue(value, event); - } - }; - - // if the browser does support "input" event, we are fine - except on IE9 which doesn't fire the - // input event on backspace, delete or cut - if ($sniffer.hasEvent('input')) { - element.on('input', listener); - } else { - var timeout; - - var deferListener = function(ev) { - if (!timeout) { - timeout = $browser.defer(function() { - listener(ev); - timeout = null; - }); - } - }; - - element.on('keydown', function(event) { - var key = event.keyCode; - - // ignore - // command modifiers arrows - if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return; - - deferListener(event); - }); - - // if user modifies input value using context menu in IE, we need "paste" and "cut" events to catch it - if ($sniffer.hasEvent('paste')) { - element.on('paste cut', deferListener); - } - } - - // if user paste into input using mouse on older browser - // or form autocomplete on newer browser, we need "change" event to catch it - element.on('change', listener); - - ctrl.$render = function() { - element.val(ctrl.$isEmpty(ctrl.$modelValue) ? '' : ctrl.$viewValue); - }; -} - -function weekParser(isoWeek, existingDate) { - if (isDate(isoWeek)) { - return isoWeek; - } - - if (isString(isoWeek)) { - WEEK_REGEXP.lastIndex = 0; - var parts = WEEK_REGEXP.exec(isoWeek); - if (parts) { - var year = +parts[1], - week = +parts[2], - hours = 0, - minutes = 0, - seconds = 0, - milliseconds = 0, - firstThurs = getFirstThursdayOfYear(year), - addDays = (week - 1) * 7; - - if (existingDate) { - hours = existingDate.getHours(); - minutes = existingDate.getMinutes(); - seconds = existingDate.getSeconds(); - milliseconds = existingDate.getMilliseconds(); - } - - return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); - } - } - - return NaN; -} - -function createDateParser(regexp, mapping) { - return function(iso, date) { - var parts, map; - - if (isDate(iso)) { - return iso; - } - - if (isString(iso)) { - // When a date is JSON'ified to wraps itself inside of an extra - // set of double quotes. This makes the date parsing code unable - // to match the date string and parse it as a date. - if (iso.charAt(0) == '"' && iso.charAt(iso.length - 1) == '"') { - iso = iso.substring(1, iso.length - 1); - } - if (ISO_DATE_REGEXP.test(iso)) { - return new Date(iso); - } - regexp.lastIndex = 0; - parts = regexp.exec(iso); - - if (parts) { - parts.shift(); - if (date) { - map = { - yyyy: date.getFullYear(), - MM: date.getMonth() + 1, - dd: date.getDate(), - HH: date.getHours(), - mm: date.getMinutes(), - ss: date.getSeconds(), - sss: date.getMilliseconds() / 1000 - }; - } else { - map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 }; - } - - forEach(parts, function(part, index) { - if (index < mapping.length) { - map[mapping[index]] = +part; - } - }); - return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0); - } - } - - return NaN; - }; -} - -function createDateInputType(type, regexp, parseDate, format) { - return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) { - badInputChecker(scope, element, attr, ctrl); - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - var timezone = ctrl && ctrl.$options && ctrl.$options.timezone; - var previousDate; - - ctrl.$$parserName = type; - ctrl.$parsers.push(function(value) { - if (ctrl.$isEmpty(value)) return null; - if (regexp.test(value)) { - // Note: We cannot read ctrl.$modelValue, as there might be a different - // parser/formatter in the processing chain so that the model - // contains some different data format! - var parsedDate = parseDate(value, previousDate); - if (timezone === 'UTC') { - parsedDate.setMinutes(parsedDate.getMinutes() - parsedDate.getTimezoneOffset()); - } - return parsedDate; - } - return undefined; - }); - - ctrl.$formatters.push(function(value) { - if (!ctrl.$isEmpty(value)) { - if (!isDate(value)) { - throw $ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value); - } - previousDate = value; - if (previousDate && timezone === 'UTC') { - var timezoneOffset = 60000 * previousDate.getTimezoneOffset(); - previousDate = new Date(previousDate.getTime() + timezoneOffset); - } - return $filter('date')(value, format, timezone); - } else { - previousDate = null; - } - return ''; - }); - - if (isDefined(attr.min) || attr.ngMin) { - var minVal; - ctrl.$validators.min = function(value) { - return ctrl.$isEmpty(value) || isUndefined(minVal) || parseDate(value) >= minVal; - }; - attr.$observe('min', function(val) { - minVal = parseObservedDateValue(val); - ctrl.$validate(); - }); - } - - if (isDefined(attr.max) || attr.ngMax) { - var maxVal; - ctrl.$validators.max = function(value) { - return ctrl.$isEmpty(value) || isUndefined(maxVal) || parseDate(value) <= maxVal; - }; - attr.$observe('max', function(val) { - maxVal = parseObservedDateValue(val); - ctrl.$validate(); - }); - } - // Override the standard $isEmpty to detect invalid dates as well - ctrl.$isEmpty = function(value) { - // Invalid Date: getTime() returns NaN - return !value || (value.getTime && value.getTime() !== value.getTime()); - }; - - function parseObservedDateValue(val) { - return isDefined(val) ? (isDate(val) ? val : parseDate(val)) : undefined; - } - }; -} - -function badInputChecker(scope, element, attr, ctrl) { - var node = element[0]; - var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity); - if (nativeValidation) { - ctrl.$parsers.push(function(value) { - var validity = element.prop(VALIDITY_STATE_PROPERTY) || {}; - // Detect bug in FF35 for input[email] (https://bugzilla.mozilla.org/show_bug.cgi?id=1064430): - // - also sets validity.badInput (should only be validity.typeMismatch). - // - see http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#e-mail-state-(type=email) - // - can ignore this case as we can still read out the erroneous email... - return validity.badInput && !validity.typeMismatch ? undefined : value; - }); - } -} - -function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) { - badInputChecker(scope, element, attr, ctrl); - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - - ctrl.$$parserName = 'number'; - ctrl.$parsers.push(function(value) { - if (ctrl.$isEmpty(value)) return null; - if (NUMBER_REGEXP.test(value)) return parseFloat(value); - return undefined; - }); - - ctrl.$formatters.push(function(value) { - if (!ctrl.$isEmpty(value)) { - if (!isNumber(value)) { - throw $ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value); - } - value = value.toString(); - } - return value; - }); - - if (attr.min || attr.ngMin) { - var minVal; - ctrl.$validators.min = function(value) { - return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal; - }; - - attr.$observe('min', function(val) { - if (isDefined(val) && !isNumber(val)) { - val = parseFloat(val, 10); - } - minVal = isNumber(val) && !isNaN(val) ? val : undefined; - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - }); - } - - if (attr.max || attr.ngMax) { - var maxVal; - ctrl.$validators.max = function(value) { - return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal; - }; - - attr.$observe('max', function(val) { - if (isDefined(val) && !isNumber(val)) { - val = parseFloat(val, 10); - } - maxVal = isNumber(val) && !isNaN(val) ? val : undefined; - // TODO(matsko): implement validateLater to reduce number of validations - ctrl.$validate(); - }); - } -} - -function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) { - // Note: no badInputChecker here by purpose as `url` is only a validation - // in browsers, i.e. we can always read out input.value even if it is not valid! - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - stringBasedInputType(ctrl); - - ctrl.$$parserName = 'url'; - ctrl.$validators.url = function(value) { - return ctrl.$isEmpty(value) || URL_REGEXP.test(value); - }; -} - -function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) { - // Note: no badInputChecker here by purpose as `url` is only a validation - // in browsers, i.e. we can always read out input.value even if it is not valid! - baseInputType(scope, element, attr, ctrl, $sniffer, $browser); - stringBasedInputType(ctrl); - - ctrl.$$parserName = 'email'; - ctrl.$validators.email = function(value) { - return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value); - }; -} - -function radioInputType(scope, element, attr, ctrl) { - // make the name unique, if not defined - if (isUndefined(attr.name)) { - element.attr('name', nextUid()); - } - - var listener = function(ev) { - if (element[0].checked) { - ctrl.$setViewValue(attr.value, ev && ev.type); - } - }; - - element.on('click', listener); - - ctrl.$render = function() { - var value = attr.value; - element[0].checked = (value == ctrl.$viewValue); - }; - - attr.$observe('value', ctrl.$render); -} - -function parseConstantExpr($parse, context, name, expression, fallback) { - var parseFn; - if (isDefined(expression)) { - parseFn = $parse(expression); - if (!parseFn.constant) { - throw minErr('ngModel')('constexpr', 'Expected constant expression for `{0}`, but saw ' + - '`{1}`.', name, expression); - } - return parseFn(context); - } - return fallback; -} - -function checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) { - var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true); - var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false); - - var listener = function(ev) { - ctrl.$setViewValue(element[0].checked, ev && ev.type); - }; - - element.on('click', listener); - - ctrl.$render = function() { - element[0].checked = ctrl.$viewValue; - }; - - // Override the standard `$isEmpty` because an empty checkbox is never equal to the trueValue - ctrl.$isEmpty = function(value) { - return value !== trueValue; - }; - - ctrl.$formatters.push(function(value) { - return equals(value, trueValue); - }); - - ctrl.$parsers.push(function(value) { - return value ? trueValue : falseValue; - }); -} - - -/** - * @ngdoc directive - * @name textarea - * @restrict E - * - * @description - * HTML textarea element control with angular data-binding. The data-binding and validation - * properties of this element are exactly the same as those of the - * {@link ng.directive:input input element}. - * - * @param {string} ngModel Assignable angular expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to - * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of - * `required` when you want to data-bind to the `required` attribute. - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. - * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the - * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for - * patterns defined as scope expressions. - * @param {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input. - */ - - -/** - * @ngdoc directive - * @name input - * @restrict E - * - * @description - * HTML input element control. When used together with {@link ngModel `ngModel`}, it provides data-binding, - * input state control, and validation. - * Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers. - * - *
- * **Note:** Not every feature offered is available for all input types. - * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`. - *
- * - * @param {string} ngModel Assignable angular expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {string=} required Sets `required` validation error key if the value is not entered. - * @param {boolean=} ngRequired Sets `required` attribute if set to true - * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than - * minlength. - * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than - * maxlength. - * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the - * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for - * patterns defined as scope expressions. - * @param {string=} ngChange Angular expression to be executed when input changes due to user - * interaction with the input element. - * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input. - * This parameter is ignored for input[type=password] controls, which will never trim the - * input. - * - * @example - - - -
-
- User name: - - Required!
- Last name: - - Too short! - - Too long!
-
-
- user = {{user}}
- myForm.userName.$valid = {{myForm.userName.$valid}}
- myForm.userName.$error = {{myForm.userName.$error}}
- myForm.lastName.$valid = {{myForm.lastName.$valid}}
- myForm.lastName.$error = {{myForm.lastName.$error}}
- myForm.$valid = {{myForm.$valid}}
- myForm.$error.required = {{!!myForm.$error.required}}
- myForm.$error.minlength = {{!!myForm.$error.minlength}}
- myForm.$error.maxlength = {{!!myForm.$error.maxlength}}
-
-
- - var user = element(by.exactBinding('user')); - var userNameValid = element(by.binding('myForm.userName.$valid')); - var lastNameValid = element(by.binding('myForm.lastName.$valid')); - var lastNameError = element(by.binding('myForm.lastName.$error')); - var formValid = element(by.binding('myForm.$valid')); - var userNameInput = element(by.model('user.name')); - var userLastInput = element(by.model('user.last')); - - it('should initialize to model', function() { - expect(user.getText()).toContain('{"name":"guest","last":"visitor"}'); - expect(userNameValid.getText()).toContain('true'); - expect(formValid.getText()).toContain('true'); - }); - - it('should be invalid if empty when required', function() { - userNameInput.clear(); - userNameInput.sendKeys(''); - - expect(user.getText()).toContain('{"last":"visitor"}'); - expect(userNameValid.getText()).toContain('false'); - expect(formValid.getText()).toContain('false'); - }); - - it('should be valid if empty when min length is set', function() { - userLastInput.clear(); - userLastInput.sendKeys(''); - - expect(user.getText()).toContain('{"name":"guest","last":""}'); - expect(lastNameValid.getText()).toContain('true'); - expect(formValid.getText()).toContain('true'); - }); - - it('should be invalid if less than required min length', function() { - userLastInput.clear(); - userLastInput.sendKeys('xx'); - - expect(user.getText()).toContain('{"name":"guest"}'); - expect(lastNameValid.getText()).toContain('false'); - expect(lastNameError.getText()).toContain('minlength'); - expect(formValid.getText()).toContain('false'); - }); - - it('should be invalid if longer than max length', function() { - userLastInput.clear(); - userLastInput.sendKeys('some ridiculously long name'); - - expect(user.getText()).toContain('{"name":"guest"}'); - expect(lastNameValid.getText()).toContain('false'); - expect(lastNameError.getText()).toContain('maxlength'); - expect(formValid.getText()).toContain('false'); - }); - -
- */ -var inputDirective = ['$browser', '$sniffer', '$filter', '$parse', - function($browser, $sniffer, $filter, $parse) { - return { - restrict: 'E', - require: ['?ngModel'], - link: { - pre: function(scope, element, attr, ctrls) { - if (ctrls[0]) { - (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrls[0], $sniffer, - $browser, $filter, $parse); - } - } - } - }; -}]; - -var VALID_CLASS = 'ng-valid', - INVALID_CLASS = 'ng-invalid', - PRISTINE_CLASS = 'ng-pristine', - DIRTY_CLASS = 'ng-dirty', - UNTOUCHED_CLASS = 'ng-untouched', - TOUCHED_CLASS = 'ng-touched', - PENDING_CLASS = 'ng-pending'; - -/** - * @ngdoc type - * @name ngModel.NgModelController - * - * @property {string} $viewValue Actual string value in the view. - * @property {*} $modelValue The value in the model that the control is bound to. - * @property {Array.} $parsers Array of functions to execute, as a pipeline, whenever - the control reads value from the DOM. The functions are called in array order, each passing - its return value through to the next. The last return value is forwarded to the - {@link ngModel.NgModelController#$validators `$validators`} collection. - -Parsers are used to sanitize / convert the {@link ngModel.NgModelController#$viewValue -`$viewValue`}. - -Returning `undefined` from a parser means a parse error occurred. In that case, -no {@link ngModel.NgModelController#$validators `$validators`} will run and the `ngModel` -will be set to `undefined` unless {@link ngModelOptions `ngModelOptions.allowInvalid`} -is set to `true`. The parse error is stored in `ngModel.$error.parse`. - - * - * @property {Array.} $formatters Array of functions to execute, as a pipeline, whenever - the model value changes. The functions are called in reverse array order, each passing the value through to the - next. The last return value is used as the actual DOM value. - Used to format / convert values for display in the control. - * ```js - * function formatter(value) { - * if (value) { - * return value.toUpperCase(); - * } - * } - * ngModel.$formatters.push(formatter); - * ``` - * - * @property {Object.} $validators A collection of validators that are applied - * whenever the model value changes. The key value within the object refers to the name of the - * validator while the function refers to the validation operation. The validation operation is - * provided with the model value as an argument and must return a true or false value depending - * on the response of that validation. - * - * ```js - * ngModel.$validators.validCharacters = function(modelValue, viewValue) { - * var value = modelValue || viewValue; - * return /[0-9]+/.test(value) && - * /[a-z]+/.test(value) && - * /[A-Z]+/.test(value) && - * /\W+/.test(value); - * }; - * ``` - * - * @property {Object.} $asyncValidators A collection of validations that are expected to - * perform an asynchronous validation (e.g. a HTTP request). The validation function that is provided - * is expected to return a promise when it is run during the model validation process. Once the promise - * is delivered then the validation status will be set to true when fulfilled and false when rejected. - * When the asynchronous validators are triggered, each of the validators will run in parallel and the model - * value will only be updated once all validators have been fulfilled. As long as an asynchronous validator - * is unfulfilled, its key will be added to the controllers `$pending` property. Also, all asynchronous validators - * will only run once all synchronous validators have passed. - * - * Please note that if $http is used then it is important that the server returns a success HTTP response code - * in order to fulfill the validation and a status level of `4xx` in order to reject the validation. - * - * ```js - * ngModel.$asyncValidators.uniqueUsername = function(modelValue, viewValue) { - * var value = modelValue || viewValue; - * - * // Lookup user by username - * return $http.get('/api/users/' + value). - * then(function resolved() { - * //username exists, this means validation fails - * return $q.reject('exists'); - * }, function rejected() { - * //username does not exist, therefore this validation passes - * return true; - * }); - * }; - * ``` - * - * @property {Array.} $viewChangeListeners Array of functions to execute whenever the - * view value has changed. It is called with no arguments, and its return value is ignored. - * This can be used in place of additional $watches against the model value. - * - * @property {Object} $error An object hash with all failing validator ids as keys. - * @property {Object} $pending An object hash with all pending validator ids as keys. - * - * @property {boolean} $untouched True if control has not lost focus yet. - * @property {boolean} $touched True if control has lost focus. - * @property {boolean} $pristine True if user has not interacted with the control yet. - * @property {boolean} $dirty True if user has already interacted with the control. - * @property {boolean} $valid True if there is no error. - * @property {boolean} $invalid True if at least one error on the control. - * @property {string} $name The name attribute of the control. - * - * @description - * - * `NgModelController` provides API for the `ng-model` directive. The controller contains - * services for data-binding, validation, CSS updates, and value formatting and parsing. It - * purposefully does not contain any logic which deals with DOM rendering or listening to - * DOM events. Such DOM related logic should be provided by other directives which make use of - * `NgModelController` for data-binding. - * - * ## Custom Control Example - * This example shows how to use `NgModelController` with a custom control to achieve - * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`) - * collaborate together to achieve the desired result. - * - * Note that `contenteditable` is an HTML5 attribute, which tells the browser to let the element - * contents be edited in place by the user. This will not work on older browsers. - * - * We are using the {@link ng.service:$sce $sce} service here and include the {@link ngSanitize $sanitize} - * module to automatically remove "bad" content like inline event listener (e.g. ``). - * However, as we are using `$sce` the model can still decide to provide unsafe content if it marks - * that content using the `$sce` service. - * - * - - [contenteditable] { - border: 1px solid black; - background-color: white; - min-height: 20px; - } - - .ng-invalid { - border: 1px solid red; - } - - - - angular.module('customControl', ['ngSanitize']). - directive('contenteditable', ['$sce', function($sce) { - return { - restrict: 'A', // only activate on element attribute - require: '?ngModel', // get a hold of NgModelController - link: function(scope, element, attrs, ngModel) { - if (!ngModel) return; // do nothing if no ng-model - - // Specify how UI should be updated - ngModel.$render = function() { - element.html($sce.getTrustedHtml(ngModel.$viewValue || '')); - }; - - // Listen for change events to enable binding - element.on('blur keyup change', function() { - scope.$evalAsync(read); - }); - read(); // initialize - - // Write data to the model - function read() { - var html = element.html(); - // When we clear the content editable the browser leaves a
behind - // If strip-br attribute is provided then we strip this out - if ( attrs.stripBr && html == '
' ) { - html = ''; - } - ngModel.$setViewValue(html); - } - } - }; - }]); -
- -
-
Change me!
- Required! -
- -
-
- - it('should data-bind and become invalid', function() { - if (browser.params.browser == 'safari' || browser.params.browser == 'firefox') { - // SafariDriver can't handle contenteditable - // and Firefox driver can't clear contenteditables very well - return; - } - var contentEditable = element(by.css('[contenteditable]')); - var content = 'Change me!'; - - expect(contentEditable.getText()).toEqual(content); - - contentEditable.clear(); - contentEditable.sendKeys(protractor.Key.BACK_SPACE); - expect(contentEditable.getText()).toEqual(''); - expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/); - }); - - *
- * - * - */ -var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$rootScope', '$q', '$interpolate', - function($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $rootScope, $q, $interpolate) { - this.$viewValue = Number.NaN; - this.$modelValue = Number.NaN; - this.$validators = {}; - this.$asyncValidators = {}; - this.$parsers = []; - this.$formatters = []; - this.$viewChangeListeners = []; - this.$untouched = true; - this.$touched = false; - this.$pristine = true; - this.$dirty = false; - this.$valid = true; - this.$invalid = false; - this.$error = {}; // keep invalid keys here - this.$$success = {}; // keep valid keys here - this.$pending = undefined; // keep pending keys here - this.$name = $interpolate($attr.name || '', false)($scope); - - - var parsedNgModel = $parse($attr.ngModel), - pendingDebounce = null, - ctrl = this; - - var ngModelGet = function ngModelGet() { - var modelValue = parsedNgModel($scope); - if (ctrl.$options && ctrl.$options.getterSetter && isFunction(modelValue)) { - modelValue = modelValue(); - } - return modelValue; - }; - - var ngModelSet = function ngModelSet(newValue) { - var getterSetter; - if (ctrl.$options && ctrl.$options.getterSetter && - isFunction(getterSetter = parsedNgModel($scope))) { - - getterSetter(ctrl.$modelValue); - } else { - parsedNgModel.assign($scope, ctrl.$modelValue); - } - }; - - this.$$setOptions = function(options) { - ctrl.$options = options; - - if (!parsedNgModel.assign && (!options || !options.getterSetter)) { - throw $ngModelMinErr('nonassign', "Expression '{0}' is non-assignable. Element: {1}", - $attr.ngModel, startingTag($element)); - } - }; - - /** - * @ngdoc method - * @name ngModel.NgModelController#$render - * - * @description - * Called when the view needs to be updated. It is expected that the user of the ng-model - * directive will implement this method. - * - * The `$render()` method is invoked in the following situations: - * - * * `$rollbackViewValue()` is called. If we are rolling back the view value to the last - * committed value then `$render()` is called to update the input control. - * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and - * the `$viewValue` are different to last time. - * - * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of - * `$modelValue` and `$viewValue` are actually different to their previous value. If `$modelValue` - * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be - * invoked if you only change a property on the objects. - */ - this.$render = noop; - - /** - * @ngdoc method - * @name ngModel.NgModelController#$isEmpty - * - * @description - * This is called when we need to determine if the value of the input is empty. - * - * For instance, the required directive does this to work out if the input has data or not. - * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`. - * - * You can override this for input directives whose concept of being empty is different to the - * default. The `checkboxInputType` directive does this because in its case a value of `false` - * implies empty. - * - * @param {*} value Model value to check. - * @returns {boolean} True if `value` is empty. - */ - this.$isEmpty = function(value) { - return isUndefined(value) || value === '' || value === null || value !== value; - }; - - var parentForm = $element.inheritedData('$formController') || nullFormCtrl, - currentValidationRunId = 0; - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setValidity - * - * @description - * Change the validity state, and notify the form. - * - * This method can be called within $parsers/$formatters or a custom validation implementation. - * However, in most cases it should be sufficient to use the `ngModel.$validators` and - * `ngModel.$asyncValidators` collections which will call `$setValidity` automatically. - * - * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be assigned - * to either `$error[validationErrorKey]` or `$pending[validationErrorKey]` - * (for unfulfilled `$asyncValidators`), so that it is available for data-binding. - * The `validationErrorKey` should be in camelCase and will get converted into dash-case - * for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error` - * class and can be bound to as `{{someForm.someControl.$error.myError}}` . - * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined), - * or skipped (null). Pending is used for unfulfilled `$asyncValidators`. - * Skipped is used by Angular when validators do not run because of parse errors and - * when `$asyncValidators` do not run because any of the `$validators` failed. - */ - addSetValidityMethod({ - ctrl: this, - $element: $element, - set: function(object, property) { - object[property] = true; - }, - unset: function(object, property) { - delete object[property]; - }, - parentForm: parentForm, - $animate: $animate - }); - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setPristine - * - * @description - * Sets the control to its pristine state. - * - * This method can be called to remove the 'ng-dirty' class and set the control to its pristine - * state (ng-pristine class). A model is considered to be pristine when the model has not been changed - * from when first compiled within then form. - */ - this.$setPristine = function() { - ctrl.$dirty = false; - ctrl.$pristine = true; - $animate.removeClass($element, DIRTY_CLASS); - $animate.addClass($element, PRISTINE_CLASS); - }; - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setUntouched - * - * @description - * Sets the control to its untouched state. - * - * This method can be called to remove the 'ng-touched' class and set the control to its - * untouched state (ng-untouched class). Upon compilation, a model is set as untouched - * by default, however this function can be used to restore that state if the model has - * already been touched by the user. - */ - this.$setUntouched = function() { - ctrl.$touched = false; - ctrl.$untouched = true; - $animate.setClass($element, UNTOUCHED_CLASS, TOUCHED_CLASS); - }; - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setTouched - * - * @description - * Sets the control to its touched state. - * - * This method can be called to remove the 'ng-untouched' class and set the control to its - * touched state (ng-touched class). A model is considered to be touched when the user has - * first interacted (focussed) on the model input element and then shifted focus away (blurred) - * from the input element. - */ - this.$setTouched = function() { - ctrl.$touched = true; - ctrl.$untouched = false; - $animate.setClass($element, TOUCHED_CLASS, UNTOUCHED_CLASS); - }; - - /** - * @ngdoc method - * @name ngModel.NgModelController#$rollbackViewValue - * - * @description - * Cancel an update and reset the input element's value to prevent an update to the `$modelValue`, - * which may be caused by a pending debounced event or because the input is waiting for a some - * future event. - * - * If you have an input that uses `ng-model-options` to set up debounced events or events such - * as blur you can have a situation where there is a period when the `$viewValue` - * is out of synch with the ngModel's `$modelValue`. - * - * In this case, you can run into difficulties if you try to update the ngModel's `$modelValue` - * programmatically before these debounced/future events have resolved/occurred, because Angular's - * dirty checking mechanism is not able to tell whether the model has actually changed or not. - * - * The `$rollbackViewValue()` method should be called before programmatically changing the model of an - * input which may have such events pending. This is important in order to make sure that the - * input field will be updated with the new model value and any pending operations are cancelled. - * - * - * - * angular.module('cancel-update-example', []) - * - * .controller('CancelUpdateController', ['$scope', function($scope) { - * $scope.resetWithCancel = function(e) { - * if (e.keyCode == 27) { - * $scope.myForm.myInput1.$rollbackViewValue(); - * $scope.myValue = ''; - * } - * }; - * $scope.resetWithoutCancel = function(e) { - * if (e.keyCode == 27) { - * $scope.myValue = ''; - * } - * }; - * }]); - * - * - *
- *

Try typing something in each input. See that the model only updates when you - * blur off the input. - *

- *

Now see what happens if you start typing then press the Escape key

- * - *
- *

With $rollbackViewValue()

- *
- * myValue: "{{ myValue }}" - * - *

Without $rollbackViewValue()

- *
- * myValue: "{{ myValue }}" - *
- *
- *
- *
- */ - this.$rollbackViewValue = function() { - $timeout.cancel(pendingDebounce); - ctrl.$viewValue = ctrl.$$lastCommittedViewValue; - ctrl.$render(); - }; - - /** - * @ngdoc method - * @name ngModel.NgModelController#$validate - * - * @description - * Runs each of the registered validators (first synchronous validators and then asynchronous validators). - */ - this.$validate = function() { - // ignore $validate before model is initialized - if (isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)) { - return; - } - this.$$parseAndValidate(); - }; - - this.$$runValidators = function(parseValid, modelValue, viewValue, doneCallback) { - currentValidationRunId++; - var localValidationRunId = currentValidationRunId; - - // check parser error - if (!processParseErrors(parseValid)) { - validationDone(false); - return; - } - if (!processSyncValidators()) { - validationDone(false); - return; - } - processAsyncValidators(); - - function processParseErrors(parseValid) { - var errorKey = ctrl.$$parserName || 'parse'; - if (parseValid === undefined) { - setValidity(errorKey, null); - } else { - setValidity(errorKey, parseValid); - if (!parseValid) { - forEach(ctrl.$validators, function(v, name) { - setValidity(name, null); - }); - forEach(ctrl.$asyncValidators, function(v, name) { - setValidity(name, null); - }); - return false; - } - } - return true; - } - - function processSyncValidators() { - var syncValidatorsValid = true; - forEach(ctrl.$validators, function(validator, name) { - var result = validator(modelValue, viewValue); - syncValidatorsValid = syncValidatorsValid && result; - setValidity(name, result); - }); - if (!syncValidatorsValid) { - forEach(ctrl.$asyncValidators, function(v, name) { - setValidity(name, null); - }); - return false; - } - return true; - } - - function processAsyncValidators() { - var validatorPromises = []; - var allValid = true; - forEach(ctrl.$asyncValidators, function(validator, name) { - var promise = validator(modelValue, viewValue); - if (!isPromiseLike(promise)) { - throw $ngModelMinErr("$asyncValidators", - "Expected asynchronous validator to return a promise but got '{0}' instead.", promise); - } - setValidity(name, undefined); - validatorPromises.push(promise.then(function() { - setValidity(name, true); - }, function(error) { - allValid = false; - setValidity(name, false); - })); - }); - if (!validatorPromises.length) { - validationDone(true); - } else { - $q.all(validatorPromises).then(function() { - validationDone(allValid); - }, noop); - } - } - - function setValidity(name, isValid) { - if (localValidationRunId === currentValidationRunId) { - ctrl.$setValidity(name, isValid); - } - } - - function validationDone(allValid) { - if (localValidationRunId === currentValidationRunId) { - - doneCallback(allValid); - } - } - }; - - /** - * @ngdoc method - * @name ngModel.NgModelController#$commitViewValue - * - * @description - * Commit a pending update to the `$modelValue`. - * - * Updates may be pending by a debounced event or because the input is waiting for a some future - * event defined in `ng-model-options`. this method is rarely needed as `NgModelController` - * usually handles calling this in response to input events. - */ - this.$commitViewValue = function() { - var viewValue = ctrl.$viewValue; - - $timeout.cancel(pendingDebounce); - - // If the view value has not changed then we should just exit, except in the case where there is - // a native validator on the element. In this case the validation state may have changed even though - // the viewValue has stayed empty. - if (ctrl.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !ctrl.$$hasNativeValidators)) { - return; - } - ctrl.$$lastCommittedViewValue = viewValue; - - // change to dirty - if (ctrl.$pristine) { - ctrl.$dirty = true; - ctrl.$pristine = false; - $animate.removeClass($element, PRISTINE_CLASS); - $animate.addClass($element, DIRTY_CLASS); - parentForm.$setDirty(); - } - this.$$parseAndValidate(); - }; - - this.$$parseAndValidate = function() { - var viewValue = ctrl.$$lastCommittedViewValue; - var modelValue = viewValue; - var parserValid = isUndefined(modelValue) ? undefined : true; - - if (parserValid) { - for (var i = 0; i < ctrl.$parsers.length; i++) { - modelValue = ctrl.$parsers[i](modelValue); - if (isUndefined(modelValue)) { - parserValid = false; - break; - } - } - } - if (isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)) { - // ctrl.$modelValue has not been touched yet... - ctrl.$modelValue = ngModelGet(); - } - var prevModelValue = ctrl.$modelValue; - var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid; - if (allowInvalid) { - ctrl.$modelValue = modelValue; - writeToModelIfNeeded(); - } - ctrl.$$runValidators(parserValid, modelValue, viewValue, function(allValid) { - if (!allowInvalid) { - // Note: Don't check ctrl.$valid here, as we could have - // external validators (e.g. calculated on the server), - // that just call $setValidity and need the model value - // to calculate their validity. - ctrl.$modelValue = allValid ? modelValue : undefined; - writeToModelIfNeeded(); - } - }); - - function writeToModelIfNeeded() { - if (ctrl.$modelValue !== prevModelValue) { - ctrl.$$writeModelToScope(); - } - } - }; - - this.$$writeModelToScope = function() { - ngModelSet(ctrl.$modelValue); - forEach(ctrl.$viewChangeListeners, function(listener) { - try { - listener(); - } catch (e) { - $exceptionHandler(e); - } - }); - }; - - /** - * @ngdoc method - * @name ngModel.NgModelController#$setViewValue - * - * @description - * Update the view value. - * - * This method should be called when an input directive want to change the view value; typically, - * this is done from within a DOM event handler. - * - * For example {@link ng.directive:input input} calls it when the value of the input changes and - * {@link ng.directive:select select} calls it when an option is selected. - * - * If the new `value` is an object (rather than a string or a number), we should make a copy of the - * object before passing it to `$setViewValue`. This is because `ngModel` does not perform a deep - * watch of objects, it only looks for a change of identity. If you only change the property of - * the object then ngModel will not realise that the object has changed and will not invoke the - * `$parsers` and `$validators` pipelines. - * - * For this reason, you should not change properties of the copy once it has been passed to - * `$setViewValue`. Otherwise you may cause the model value on the scope to change incorrectly. - * - * When this method is called, the new `value` will be staged for committing through the `$parsers` - * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged - * value sent directly for processing, finally to be applied to `$modelValue` and then the - * **expression** specified in the `ng-model` attribute. - * - * Lastly, all the registered change listeners, in the `$viewChangeListeners` list, are called. - * - * In case the {@link ng.directive:ngModelOptions ngModelOptions} directive is used with `updateOn` - * and the `default` trigger is not listed, all those actions will remain pending until one of the - * `updateOn` events is triggered on the DOM element. - * All these actions will be debounced if the {@link ng.directive:ngModelOptions ngModelOptions} - * directive is used with a custom debounce for this particular event. - * - * Note that calling this function does not trigger a `$digest`. - * - * @param {string} value Value from the view. - * @param {string} trigger Event that triggered the update. - */ - this.$setViewValue = function(value, trigger) { - ctrl.$viewValue = value; - if (!ctrl.$options || ctrl.$options.updateOnDefault) { - ctrl.$$debounceViewValueCommit(trigger); - } - }; - - this.$$debounceViewValueCommit = function(trigger) { - var debounceDelay = 0, - options = ctrl.$options, - debounce; - - if (options && isDefined(options.debounce)) { - debounce = options.debounce; - if (isNumber(debounce)) { - debounceDelay = debounce; - } else if (isNumber(debounce[trigger])) { - debounceDelay = debounce[trigger]; - } else if (isNumber(debounce['default'])) { - debounceDelay = debounce['default']; - } - } - - $timeout.cancel(pendingDebounce); - if (debounceDelay) { - pendingDebounce = $timeout(function() { - ctrl.$commitViewValue(); - }, debounceDelay); - } else if ($rootScope.$$phase) { - ctrl.$commitViewValue(); - } else { - $scope.$apply(function() { - ctrl.$commitViewValue(); - }); - } - }; - - // model -> value - // Note: we cannot use a normal scope.$watch as we want to detect the following: - // 1. scope value is 'a' - // 2. user enters 'b' - // 3. ng-change kicks in and reverts scope value to 'a' - // -> scope value did not change since the last digest as - // ng-change executes in apply phase - // 4. view should be changed back to 'a' - $scope.$watch(function ngModelWatch() { - var modelValue = ngModelGet(); - - // if scope model value and ngModel value are out of sync - // TODO(perf): why not move this to the action fn? - if (modelValue !== ctrl.$modelValue) { - ctrl.$modelValue = modelValue; - - var formatters = ctrl.$formatters, - idx = formatters.length; - - var viewValue = modelValue; - while (idx--) { - viewValue = formatters[idx](viewValue); - } - if (ctrl.$viewValue !== viewValue) { - ctrl.$viewValue = ctrl.$$lastCommittedViewValue = viewValue; - ctrl.$render(); - - ctrl.$$runValidators(undefined, modelValue, viewValue, noop); - } - } - - return modelValue; - }); -}]; - - -/** - * @ngdoc directive - * @name ngModel - * - * @element input - * @priority 1 - * - * @description - * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a - * property on the scope using {@link ngModel.NgModelController NgModelController}, - * which is created and exposed by this directive. - * - * `ngModel` is responsible for: - * - * - Binding the view into the model, which other directives such as `input`, `textarea` or `select` - * require. - * - Providing validation behavior (i.e. required, number, email, url). - * - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors). - * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`, `ng-untouched`) including animations. - * - Registering the control with its parent {@link ng.directive:form form}. - * - * Note: `ngModel` will try to bind to the property given by evaluating the expression on the - * current scope. If the property doesn't already exist on this scope, it will be created - * implicitly and added to the scope. - * - * For best practices on using `ngModel`, see: - * - * - [Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes) - * - * For basic examples, how to use `ngModel`, see: - * - * - {@link ng.directive:input input} - * - {@link input[text] text} - * - {@link input[checkbox] checkbox} - * - {@link input[radio] radio} - * - {@link input[number] number} - * - {@link input[email] email} - * - {@link input[url] url} - * - {@link input[date] date} - * - {@link input[datetime-local] datetime-local} - * - {@link input[time] time} - * - {@link input[month] month} - * - {@link input[week] week} - * - {@link ng.directive:select select} - * - {@link ng.directive:textarea textarea} - * - * # CSS classes - * The following CSS classes are added and removed on the associated input/select/textarea element - * depending on the validity of the model. - * - * - `ng-valid`: the model is valid - * - `ng-invalid`: the model is invalid - * - `ng-valid-[key]`: for each valid key added by `$setValidity` - * - `ng-invalid-[key]`: for each invalid key added by `$setValidity` - * - `ng-pristine`: the control hasn't been interacted with yet - * - `ng-dirty`: the control has been interacted with - * - `ng-touched`: the control has been blurred - * - `ng-untouched`: the control hasn't been blurred - * - `ng-pending`: any `$asyncValidators` are unfulfilled - * - * Keep in mind that ngAnimate can detect each of these classes when added and removed. - * - * ## Animation Hooks - * - * Animations within models are triggered when any of the associated CSS classes are added and removed - * on the input element which is attached to the model. These classes are: `.ng-pristine`, `.ng-dirty`, - * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself. - * The animations that are triggered within ngModel are similar to how they work in ngClass and - * animations can be hooked into using CSS transitions, keyframes as well as JS animations. - * - * The following example shows a simple way to utilize CSS transitions to style an input element - * that has been rendered as invalid after it has been validated: - * - *
- * //be sure to include ngAnimate as a module to hook into more
- * //advanced animations
- * .my-input {
- *   transition:0.5s linear all;
- *   background: white;
- * }
- * .my-input.ng-invalid {
- *   background: red;
- *   color:white;
- * }
- * 
- * - * @example - * - - - - Update input to see transitions when valid/invalid. - Integer is a valid value. -
- -
-
- *
- * - * ## Binding to a getter/setter - * - * Sometimes it's helpful to bind `ngModel` to a getter/setter function. A getter/setter is a - * function that returns a representation of the model when called with zero arguments, and sets - * the internal state of a model when called with an argument. It's sometimes useful to use this - * for models that have an internal representation that's different than what the model exposes - * to the view. - * - *
- * **Best Practice:** It's best to keep getters fast because Angular is likely to call them more - * frequently than other parts of your code. - *
- * - * You use this behavior by adding `ng-model-options="{ getterSetter: true }"` to an element that - * has `ng-model` attached to it. You can also add `ng-model-options="{ getterSetter: true }"` to - * a `
`, which will enable this behavior for all ``s within it. See - * {@link ng.directive:ngModelOptions `ngModelOptions`} for more. - * - * The following example shows how to use `ngModel` with a getter/setter: - * - * @example - * - -
- - Name: - - -
user.name = 
-
-
- - angular.module('getterSetterExample', []) - .controller('ExampleController', ['$scope', function($scope) { - var _name = 'Brian'; - $scope.user = { - name: function(newName) { - if (angular.isDefined(newName)) { - _name = newName; - } - return _name; - } - }; - }]); - - *
- */ -var ngModelDirective = function() { - return { - restrict: 'A', - require: ['ngModel', '^?form', '^?ngModelOptions'], - controller: NgModelController, - // Prelink needs to run before any input directive - // so that we can set the NgModelOptions in NgModelController - // before anyone else uses it. - priority: 1, - compile: function ngModelCompile(element) { - // Setup initial state of the control - element.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS); - - return { - pre: function ngModelPreLink(scope, element, attr, ctrls) { - var modelCtrl = ctrls[0], - formCtrl = ctrls[1] || nullFormCtrl; - - modelCtrl.$$setOptions(ctrls[2] && ctrls[2].$options); - - // notify others, especially parent forms - formCtrl.$addControl(modelCtrl); - - attr.$observe('name', function(newValue) { - if (modelCtrl.$name !== newValue) { - formCtrl.$$renameControl(modelCtrl, newValue); - } - }); - - scope.$on('$destroy', function() { - formCtrl.$removeControl(modelCtrl); - }); - }, - post: function ngModelPostLink(scope, element, attr, ctrls) { - var modelCtrl = ctrls[0]; - if (modelCtrl.$options && modelCtrl.$options.updateOn) { - element.on(modelCtrl.$options.updateOn, function(ev) { - modelCtrl.$$debounceViewValueCommit(ev && ev.type); - }); - } - - element.on('blur', function(ev) { - if (modelCtrl.$touched) return; - - scope.$apply(function() { - modelCtrl.$setTouched(); - }); - }); - } - }; - } - }; -}; - - -/** - * @ngdoc directive - * @name ngChange - * - * @description - * Evaluate the given expression when the user changes the input. - * The expression is evaluated immediately, unlike the JavaScript onchange event - * which only triggers at the end of a change (usually, when the user leaves the - * form element or presses the return key). - * - * The `ngChange` expression is only evaluated when a change in the input value causes - * a new value to be committed to the model. - * - * It will not be evaluated: - * * if the value returned from the `$parsers` transformation pipeline has not changed - * * if the input has continued to be invalid since the model will stay `null` - * * if the model is changed programmatically and not by a change to the input value - * - * - * Note, this directive requires `ngModel` to be present. - * - * @element input - * @param {expression} ngChange {@link guide/expression Expression} to evaluate upon change - * in input value. - * - * @example - * - * - * - *
- * - * - *
- * debug = {{confirmed}}
- * counter = {{counter}}
- *
- *
- * - * var counter = element(by.binding('counter')); - * var debug = element(by.binding('confirmed')); - * - * it('should evaluate the expression if changing from view', function() { - * expect(counter.getText()).toContain('0'); - * - * element(by.id('ng-change-example1')).click(); - * - * expect(counter.getText()).toContain('1'); - * expect(debug.getText()).toContain('true'); - * }); - * - * it('should not evaluate the expression if changing from model', function() { - * element(by.id('ng-change-example2')).click(); - - * expect(counter.getText()).toContain('0'); - * expect(debug.getText()).toContain('true'); - * }); - * - *
- */ -var ngChangeDirective = valueFn({ - restrict: 'A', - require: 'ngModel', - link: function(scope, element, attr, ctrl) { - ctrl.$viewChangeListeners.push(function() { - scope.$eval(attr.ngChange); - }); - } -}); - - -var requiredDirective = function() { - return { - restrict: 'A', - require: '?ngModel', - link: function(scope, elm, attr, ctrl) { - if (!ctrl) return; - attr.required = true; // force truthy in case we are on non input element - - ctrl.$validators.required = function(value) { - return !attr.required || !ctrl.$isEmpty(value); - }; - - attr.$observe('required', function() { - ctrl.$validate(); - }); - } - }; -}; - - -var patternDirective = function() { - return { - restrict: 'A', - require: '?ngModel', - link: function(scope, elm, attr, ctrl) { - if (!ctrl) return; - - var regexp, patternExp = attr.ngPattern || attr.pattern; - attr.$observe('pattern', function(regex) { - if (isString(regex) && regex.length > 0) { - regex = new RegExp('^' + regex + '$'); - } - - if (regex && !regex.test) { - throw minErr('ngPattern')('noregexp', - 'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp, - regex, startingTag(elm)); - } - - regexp = regex || undefined; - ctrl.$validate(); - }); - - ctrl.$validators.pattern = function(value) { - return ctrl.$isEmpty(value) || isUndefined(regexp) || regexp.test(value); - }; - } - }; -}; - - -var maxlengthDirective = function() { - return { - restrict: 'A', - require: '?ngModel', - link: function(scope, elm, attr, ctrl) { - if (!ctrl) return; - - var maxlength = 0; - attr.$observe('maxlength', function(value) { - maxlength = int(value) || 0; - ctrl.$validate(); - }); - ctrl.$validators.maxlength = function(modelValue, viewValue) { - return ctrl.$isEmpty(modelValue) || viewValue.length <= maxlength; - }; - } - }; -}; - -var minlengthDirective = function() { - return { - restrict: 'A', - require: '?ngModel', - link: function(scope, elm, attr, ctrl) { - if (!ctrl) return; - - var minlength = 0; - attr.$observe('minlength', function(value) { - minlength = int(value) || 0; - ctrl.$validate(); - }); - ctrl.$validators.minlength = function(modelValue, viewValue) { - return ctrl.$isEmpty(modelValue) || viewValue.length >= minlength; - }; - } - }; -}; - - -/** - * @ngdoc directive - * @name ngList - * - * @description - * Text input that converts between a delimited string and an array of strings. The default - * delimiter is a comma followed by a space - equivalent to `ng-list=", "`. You can specify a custom - * delimiter as the value of the `ngList` attribute - for example, `ng-list=" | "`. - * - * The behaviour of the directive is affected by the use of the `ngTrim` attribute. - * * If `ngTrim` is set to `"false"` then whitespace around both the separator and each - * list item is respected. This implies that the user of the directive is responsible for - * dealing with whitespace but also allows you to use whitespace as a delimiter, such as a - * tab or newline character. - * * Otherwise whitespace around the delimiter is ignored when splitting (although it is respected - * when joining the list items back together) and whitespace around each list item is stripped - * before it is added to the model. - * - * ### Example with Validation - * - * - * - * angular.module('listExample', []) - * .controller('ExampleController', ['$scope', function($scope) { - * $scope.names = ['morpheus', 'neo', 'trinity']; - * }]); - * - * - *
- * List: - * - * Required! - *
- * names = {{names}}
- * myForm.namesInput.$valid = {{myForm.namesInput.$valid}}
- * myForm.namesInput.$error = {{myForm.namesInput.$error}}
- * myForm.$valid = {{myForm.$valid}}
- * myForm.$error.required = {{!!myForm.$error.required}}
- *
- *
- * - * var listInput = element(by.model('names')); - * var names = element(by.exactBinding('names')); - * var valid = element(by.binding('myForm.namesInput.$valid')); - * var error = element(by.css('span.error')); - * - * it('should initialize to model', function() { - * expect(names.getText()).toContain('["morpheus","neo","trinity"]'); - * expect(valid.getText()).toContain('true'); - * expect(error.getCssValue('display')).toBe('none'); - * }); - * - * it('should be invalid if empty', function() { - * listInput.clear(); - * listInput.sendKeys(''); - * - * expect(names.getText()).toContain(''); - * expect(valid.getText()).toContain('false'); - * expect(error.getCssValue('display')).not.toBe('none'); - * }); - * - *
- * - * ### Example - splitting on whitespace - * - * - * - *
{{ list | json }}
- *
- * - * it("should split the text by newlines", function() { - * var listInput = element(by.model('list')); - * var output = element(by.binding('list | json')); - * listInput.sendKeys('abc\ndef\nghi'); - * expect(output.getText()).toContain('[\n "abc",\n "def",\n "ghi"\n]'); - * }); - * - *
- * - * @element input - * @param {string=} ngList optional delimiter that should be used to split the value. - */ -var ngListDirective = function() { - return { - restrict: 'A', - priority: 100, - require: 'ngModel', - link: function(scope, element, attr, ctrl) { - // We want to control whitespace trimming so we use this convoluted approach - // to access the ngList attribute, which doesn't pre-trim the attribute - var ngList = element.attr(attr.$attr.ngList) || ', '; - var trimValues = attr.ngTrim !== 'false'; - var separator = trimValues ? trim(ngList) : ngList; - - var parse = function(viewValue) { - // If the viewValue is invalid (say required but empty) it will be `undefined` - if (isUndefined(viewValue)) return; - - var list = []; - - if (viewValue) { - forEach(viewValue.split(separator), function(value) { - if (value) list.push(trimValues ? trim(value) : value); - }); - } - - return list; - }; - - ctrl.$parsers.push(parse); - ctrl.$formatters.push(function(value) { - if (isArray(value)) { - return value.join(ngList); - } - - return undefined; - }); - - // Override the standard $isEmpty because an empty array means the input is empty. - ctrl.$isEmpty = function(value) { - return !value || !value.length; - }; - } - }; -}; - - -var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/; -/** - * @ngdoc directive - * @name ngValue - * - * @description - * Binds the given expression to the value of `
- - it('should load template defined inside script tag', function() { - element(by.css('#tpl-link')).click(); - expect(element(by.css('#tpl-content')).getText()).toMatch(/Content of the template/); - }); - - - */ -var scriptDirective = ['$templateCache', function($templateCache) { - return { - restrict: 'E', - terminal: true, - compile: function(element, attr) { - if (attr.type == 'text/ng-template') { - var templateUrl = attr.id, - // IE is not consistent, in scripts we have to read .text but in other nodes we have to read .textContent - text = element[0].text; - - $templateCache.put(templateUrl, text); - } - } - }; -}]; - -var ngOptionsMinErr = minErr('ngOptions'); -/** - * @ngdoc directive - * @name select - * @restrict E - * - * @description - * HTML `SELECT` element with angular data-binding. - * - * # `ngOptions` - * - * The `ngOptions` attribute can be used to dynamically generate a list of `