├── .gitignore ├── lib ├── ASP.NET MVC │ └── v3 │ │ ├── System.Web.Mvc.dll │ │ └── System.Web.Mvc.xml ├── ASP.NET Web Pages │ └── v1.0 │ │ ├── Microsoft.Web.Infrastructure.dll │ │ ├── Microsoft.Web.Infrastructure.xml │ │ ├── NuGet.Core.dll │ │ ├── System.Web.Helpers.dll │ │ ├── System.Web.Helpers.xml │ │ ├── System.Web.Razor.dll │ │ ├── System.Web.Razor.xml │ │ ├── System.Web.WebPages.Administration.dll │ │ ├── System.Web.WebPages.Deployment.dll │ │ ├── System.Web.WebPages.Deployment.xml │ │ ├── System.Web.WebPages.Razor.dll │ │ ├── System.Web.WebPages.Razor.xml │ │ ├── System.Web.WebPages.dll │ │ ├── System.Web.WebPages.xml │ │ ├── WebMatrix.Data.dll │ │ ├── WebMatrix.Data.xml │ │ ├── WebMatrix.WebData.dll │ │ └── WebMatrix.WebData.xml └── FSharpPowerPack │ ├── FSharp.Compiler.CodeDom.dll │ ├── FSharp.Compiler.CodeDom.pdb │ ├── FSharp.Compiler.CodeDom.xml │ ├── FSharp.PowerPack.Build.Tasks.dll │ ├── FSharp.PowerPack.Build.Tasks.pdb │ ├── FSharp.PowerPack.Build.Tasks.xml │ ├── FSharp.PowerPack.Compatibility.dll │ ├── FSharp.PowerPack.Compatibility.pdb │ ├── FSharp.PowerPack.Compatibility.xml │ ├── FSharp.PowerPack.Linq.dll │ ├── FSharp.PowerPack.Linq.pdb │ ├── FSharp.PowerPack.Linq.xml │ ├── FSharp.PowerPack.Metadata.dll │ ├── FSharp.PowerPack.Metadata.pdb │ ├── FSharp.PowerPack.Metadata.xml │ ├── FSharp.PowerPack.Parallel.Seq.dll │ ├── FSharp.PowerPack.Parallel.Seq.pdb │ ├── FSharp.PowerPack.Parallel.Seq.xml │ ├── FSharp.PowerPack.dll │ ├── FSharp.PowerPack.pdb │ ├── FSharp.PowerPack.targets │ ├── FSharp.PowerPack.xml │ ├── License.rtf │ ├── fshtmldoc.exe │ ├── fslex.exe │ └── fsyacc.exe ├── readme.md └── src ├── FSRazor.Mvc ├── AssemblyInfo.fs ├── FSRazor.Mvc.fsproj ├── FSRazorViewEngine.fs ├── MvcFSharpCodeParser.fs ├── MvcFSharpRazorCodeGenerator.fs ├── MvcWebPageRazorHost.fs └── PreApplicationStartCode.fs ├── FSRazor.Sample.Mvc ├── Content │ └── Site.css ├── Controllers │ └── HomeController.cs ├── FSRazor.Sample.Mvc.csproj ├── FSRazor.Sample.Mvc.csproj.user ├── Global.asax ├── Global.asax.cs ├── Properties │ └── AssemblyInfo.cs ├── Scripts │ └── jquery-1.4.4.min.js ├── Views │ ├── Home │ │ ├── Index.cshtml │ │ └── Test.fshtml │ ├── Shared │ │ ├── Error.cshtml │ │ └── _Layout.cshtml │ ├── Web.config │ └── _ViewStart.cshtml ├── Web.Debug.config ├── Web.Release.config └── Web.config ├── FSRazor.Sample.WebPages ├── Index.fshtml ├── Web.config └── robots.txt ├── FSRazor.WebPages ├── AssemblyInfo.fs ├── FSRazor.WebPages.fsproj └── PreApplicationStartCode.fs ├── FSRazor.sln └── FSRazor ├── AssemblyInfo.fs ├── FSRazor.fsproj ├── FSharpCodeParser.fs ├── FSharpCodeWriter.fs ├── FSharpRazorCodeGenerator.fs ├── FSharpRazorCodeLanguage.fs └── PreApplicationStartCode.fs /.gitignore: -------------------------------------------------------------------------------- 1 | [Bb]in/ 2 | [Oo]bj/ 3 | *.suo 4 | -------------------------------------------------------------------------------- /lib/ASP.NET MVC/v3/System.Web.Mvc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/ASP.NET MVC/v3/System.Web.Mvc.dll -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/Microsoft.Web.Infrastructure.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/ASP.NET Web Pages/v1.0/Microsoft.Web.Infrastructure.dll -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/Microsoft.Web.Infrastructure.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Microsoft.Web.Infrastructure 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/NuGet.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/ASP.NET Web Pages/v1.0/NuGet.Core.dll -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/System.Web.Helpers.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/ASP.NET Web Pages/v1.0/System.Web.Helpers.dll -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/System.Web.Helpers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | System.Web.Helpers 5 | 6 | 7 | 8 | Displays data as a chart image. 9 | 10 | 11 | Initializes a new instance of the class. 12 | The width, in pixels, of the complete chart image. 13 | The height, in pixels, of the complete chart image. 14 | (Optional) The template (theme) to apply to the chart. 15 | (Optional) The template (theme) path and file name to apply to the chart. 16 | 17 | 18 | Adds a legend to the chart. 19 | The chart. 20 | The text of the legend title. 21 | The unique name of the legend. 22 | 23 | 24 | Provides data points and series attributes for the chart. 25 | The chart. 26 | The unique name of the series. 27 | The chart type of a series. 28 | The name of the chart area used to plot the data series. 29 | The axis label text for the series. 30 | The name of the series associated with the legend. 31 | A value that determines the granularity to display data point markers. 32 | The values to plot along the X-axis. 33 | The name of the field for X-values. 34 | The values to plot along the Y-axis. 35 | A comma-separated list of name or names of the field or fields for Y-values. 36 | 37 | 38 | Adds a title to the chart. 39 | The chart. 40 | The title text. 41 | The unique name of the title. 42 | 43 | 44 | Databinds a chart to a data table, with one series created per unique value in a column. 45 | The chart. 46 | The chart data source. 47 | The name of the column used to group data into the series. 48 | The name of the column for X-values. 49 | A comma-separated list of names of the columns for Y-values. 50 | Other data point properties that can be bound. 51 | The order in which the series will be sorted. The default is "Ascending". 52 | 53 | 54 | Creates and binds series data to the specified data table, and optionally populates multiple Y-values. 55 | The chart. 56 | The chart data source. 57 | The name of the table column used for the series X-values. 58 | 59 | 60 | Gets or sets the name of the file that contains the chart image. 61 | The name of the file. 62 | 63 | 64 | Returns a chart image as a byte array. 65 | The chart. 66 | The image format. The default is "jpeg". 67 | 68 | 69 | Retrieves the specified chart from cache. 70 | The chart. 71 | The identifier of the cache item that contains the chart to retrieve. The key is set when you call the method. 72 | 73 | 74 | Gets or sets the height of the chart image. 75 | The chart height. 76 | 77 | 78 | Saves a chart image to the specified path and file name. 79 | The chart. 80 | The location and name of the image file. 81 | The image file format. 82 | 83 | 84 | Saves a chart in the system cache. 85 | Returns . 86 | The identifier for the chart in the cache. 87 | The number of minutes to keep the chart image in the cache. The default is 20. 88 | 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. 89 | 90 | 91 | Saves a chart as an XML file. 92 | The chart. 93 | The path and filename to save the XML file to. 94 | 95 | 96 | Sets values for the horizontal axis. 97 | The chart. 98 | The title of the horizontal axis. 99 | The minimum value for the horizontal axis. 100 | The maximum value for the horizontal axis. 101 | 102 | 103 | Sets values for the vertical axis. 104 | The chart. 105 | The title of the vertical axis. 106 | The minimum value for the vertical axis. 107 | The maximum value for the vertical axis. 108 | 109 | 110 | Creates a object based on the current object. 111 | The chart. 112 | The format of the image to save the object as. The default is jpeg. 113 | 114 | 115 | Gets or set the width of the chart image. 116 | The chart width. 117 | 118 | 119 | Renders the output of the object as an image. 120 | The chart. 121 | The format of the image. The default is "jpeg". 122 | 123 | 124 | Renders the output of a object that has been cached as an image. 125 | The chart. 126 | The identifier for the chart in the cache. 127 | The format of the image. The default is "jpeg". 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | Provides methods to encrypt passwords or other sensitive data. 137 | 138 | 139 | 140 | Returns a hash value for the specified byte array. 141 | The hash value for . 142 | The data to provide a hash value for. 143 | The algorithm used to generate the hash value. The default is "sha256". 144 | 145 | 146 | Returns a hash value for the specified string. 147 | The hash value for . 148 | The data to provide a hash value for. 149 | The algorithm used to generate the hash value. The default is "sha256". 150 | 151 | 152 | Returns a hash value for the specified password. 153 | The hash value for . 154 | The password to generate a hash value for. 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | Provides methods for working with data in JavaScript Object Notation (JSON) format. 179 | 180 | 181 | Converts data in JavaScript Object Notation (JSON) format into the specified strongly typed data list. 182 | The JSON-encoded data converted to a strongly typed list. 183 | The JSON-encoded string to convert. 184 | The type of the strongly typed list to convert JSON data into. 185 | 186 | 187 | Converts data in JavaScript Object Notation (JSON) format into a data object. 188 | The JSON-encoded data converted to a data object. 189 | The JSON-encoded string to convert. 190 | 191 | 192 | Converts data in JavaScript Object Notation (JSON) format into a data object of a specified type. 193 | The JSON-encoded data converted to the specified type. 194 | The JSON-encoded string to convert. 195 | The type that the data should be converted to. 196 | 197 | 198 | Converts a data object to a string that is in the JavaScript Object Notation (JSON) format. 199 | Returns a string of data converted to the JSON format. 200 | The data object to convert. 201 | 202 | 203 | Converts a data object to a string in JavaScript Object Notation (JSON) format and adds the string to the specified object. 204 | The data object to convert. 205 | The object that contains the converted JSON data. 206 | 207 | 208 | Renders the property names and values of the specified object and any subobjects that it references. 209 | 210 | 211 | Renders the property names and values of the specified object and any subobjects that it references. 212 | 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. 213 | The object to render information for. 214 | Optional. Specifies the depth of nested subobjects to render information for. The default is 10. 215 | Optional. Specifies the maximum number of characters that the method displays for object values. The default is 1000. 216 | 217 | is less than zero. 218 | 219 | is less than or equal to zero. 220 | 221 | 222 | Displays information about the Web server environment that hosts the current Web page. 223 | 224 | 225 | Displays information about the Web server environment. 226 | A string of name-value pairs that contains information about the Web server. 227 | 228 | 229 | Specifies the direction in which to sort a list of items. 230 | 231 | 232 | Sort from smallest to largest. For example, from A to Z. 233 | 234 | 235 | Sort from largest to smallest. For example, from Z to A. 236 | 237 | 238 | Provides a cache to store frequently accessed data. 239 | 240 | 241 | Retrieves the specified item from the object. 242 | The item retrieved from the cache, or null if the item is not found. 243 | The identifier for the cache item to retrieve. 244 | 245 | 246 | Removes the specified item from the object. 247 | The item removed from the object. If the item is not found, returns null. 248 | The identifier for the cache item to remove. 249 | 250 | 251 | Inserts an item into the object. 252 | The identifier for the cache item. 253 | The data to insert into the cache. 254 | Optional. The number of minutes to keep an item in the cache. The default is 20. 255 | 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 on an absolute interval since the time that the item was added to the cache. The default is true, which means that, if you also use the default value for the parameter, a cached item expires 20 minutes after it was last accessed. 256 | The value of is less than or equal to zero. 257 | Sliding expiration is enabled and the value of is greater than a year. 258 | 259 | 260 | Displays data using an HTML table. 261 | 262 | 263 | Initializes a new instance of the class. 264 | The data to display. 265 | A collection of data source column names. By default, this value is auto-populated. 266 | The column name that is used to sort the table by default. 267 | The number of rows that are displayed when paging is displayed. The default is 10. 268 | true to specify that the object can display paging; otherwise false. The default is true. 269 | true to specify that the object can sort based on column; otherwise, false. The default is true. 270 | The ID of the HTML element in the instance that is used for Ajax support in order in order to make partial page updates. 271 | The JavaScript function to call after the HTML element specified by the property has been updated. 272 | The prefix for query-string fields. This value is used in order to support multiple T:System.Web.Helpers.WebGrid objects on the same page. 273 | The query-string field name for the page number. 274 | The query-string field name for the selected row number. 275 | The query-string field name for the sort column. 276 | The query-string field name for the sort direction. 277 | 278 | 279 | Gets the name of the JavaScript function to call after the HTML element specified by the property has been updated. 280 | The element name. 281 | 282 | 283 | Gets the ID of the HTML element in the object that is used for Ajax support in order to make partial-page updates. 284 | The element ID. 285 | 286 | 287 | Binds the specified data to the object. 288 | The populated object. 289 | The data to display. 290 | The names of the columns to bind. 291 | true to enable sorting and paging; otherwise, false. 292 | The number of rows to display for each page of data. 293 | 294 | 295 | Adds a column object to the object. 296 | A column object. 297 | The name of the column. 298 | The header of the column. 299 | A string that specifies the formatting of the column. 300 | A string that specifies the style of the column. 301 | true if the column can be sorted; otherwise, false. The default is true. 302 | 303 | 304 | Gets a collection of column names from the data source. 305 | The collection of column names. 306 | 307 | 308 | Adds a collection of column objects to the object. 309 | A set of columns. 310 | The columns to add. 311 | 312 | 313 | Gets the prefix for query-string fields of a page. 314 | The prefix for query-string fields. 315 | 316 | 317 | Converts a URL into a jQuery Ajax call. 318 | A script used as a jQuery Ajax call. 319 | The URL to convert. 320 | 321 | 322 | Returns HTML that is used to render the instance. 323 | The HTML that represents the populated object. 324 | The CSS class to use to style the table. 325 | The CSS class to use to style the header row of the table. 326 | The CSS class to use to style the footer row of the table. 327 | The CSS class to use to style each row of the table. 328 | The CSS class to use to style the even rows of the table. 329 | The CSS class to use to style the selected rows of the table. 330 | The caption for the table. 331 | true to specify that the header of the table is displayed; otherwise, false. The default is true. 332 | true to specify that the table can add empty rows to ensure the row count is maintained; otherise, false. The default is false. 333 | The text that is used to populate empty rows. The parameter must be set to true to display this value. 334 | The column model for customizing column rendering. 335 | The columns to exclude when auto-populating columns. 336 | A value specifying the mode for rendering paging support. 337 | The text for the link to the first page. 338 | The text for the link to the previous page. 339 | The text for the link to the next page. 340 | The text for the link to the last page. 341 | The number of numeric links to display. 342 | An object that contains the HTML attributes to set for the element. 343 | 344 | 345 | Returns the URL of the page that the object will display based on the specified page index. 346 | The URL of the page that the object will display. 347 | The index of the page to display. 348 | 349 | 350 | Returns a URL used to display the sorted data in the object based on a column name. 351 | The url used to display the sorted data. 352 | The name of the column to sort the grid by. 353 | 354 | 355 | Gets a value that determines whether any row in the object has been selected. 356 | true if a row has been selected; otherwise, false. 357 | 358 | 359 | Gets the number of pages that the object has available to display. 360 | The page count. 361 | 362 | 363 | Gets the query string field name for the page number of the WebGrid. 364 | The column name. 365 | 366 | 367 | Gets or sets the index of the current page to display. 368 | The current page index. 369 | 370 | 371 | Returns the HTML that is required to provide paging support. 372 | A value that specifies paging support. 373 | The text for the link to the first page. 374 | The text for the link to the previous page. 375 | The text for the link to the next page. 376 | The test for the link to the last page. 377 | The number of numeric links to display. 378 | 379 | 380 | Gets a list of rows that are in the object. 381 | The collection of rows. 382 | 383 | 384 | Gets the number of rows to display on each page. 385 | The row count for a page. 386 | 387 | 388 | Gets or sets the index of the selected row. 389 | The row index. 390 | 391 | 392 | Gets the selected row of the object. 393 | The selected row. 394 | 395 | 396 | Gets the query string field name for the selected row number of the WebGrid. 397 | The name of the selected column. 398 | 399 | 400 | Gets or sets the name of the column that is used to sort the object. 401 | The name of the sort column. 402 | 403 | 404 | Gets or sets the direction that the object is sorted. 405 | The sort direction. 406 | 407 | 408 | Gets the query string field name for the sort direction of the WebGrid. 409 | The column prefix and name. 410 | 411 | 412 | Gets the query string field name for the sort column of the WebGrid. 413 | The sort column name. 414 | 415 | 416 | Returns the HTML that is used to render the instance that supports paging. 417 | The HTML that represents the populated object. 418 | The CSS class to use to style the table. 419 | The CSS class to use to style the header row. 420 | The CSS class to use to style the footer row. 421 | The CSS class to use to style odd rows. 422 | The CSS class to use to style even rows. 423 | The CSS class used to use to style the selected row. 424 | The caption for the table. 425 | true to specify that the header of the table is displayed; otherwise, false. The default is true. 426 | true to specify that the table can add empty rows to ensure the row count is maintained; otherise, false. The default is false. 427 | The text that is used to populate empty rows. The parameter must be set to true to display this value. 428 | The column model that is used to customize column rendering. 429 | The columns to exclude when auto-populating columns. 430 | The table footer template. 431 | An object that contains the HTML attributes to set for the element. 432 | 433 | 434 | Gets the total row count for the object. 435 | The row count. 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | Represents an object that lets you display and manage images in in a Web page. 471 | 472 | 473 | Initializes a new instance of the class using a byte array to represent the image. 474 | The image. 475 | 476 | 477 | Initializes a new instance of the class using a stream to represent the image. 478 | The image. 479 | 480 | 481 | Initializes a new instance of the class using a path to represent the image location. 482 | The path of the file that contains the image. 483 | 484 | 485 | Adds a watermark image to the image using the specified image file. 486 | The image. 487 | The path of a file that contains the image. 488 | The width, in pixels, of the watermark image. 489 | The height, in pixels, of the watermark image. 490 | The horizontal alignment for watermark image. Values can be left, right, or center. 491 | The vertical alignment for the watermark image. Values can be top, bottom, or middle. 492 | The opacity for the watermark image, specified as a value between 0 and 100. 493 | The size, in pixels, of the padding around the watermark image. 494 | 495 | 496 | Adds a watermark image to the image using the specified object. 497 | The image. 498 | A object. 499 | The width, in pixels, of the watermark image. 500 | The height, in pixels, of the watermark image. 501 | The horizontal alignment for watermark image. Values can be left, right, or center. 502 | The vertical alignment for the watermark image. Values can be top, bottom, or middle. 503 | The opacity for the watermark image specifies as a value between 0 and 100. 504 | The size, in pixels, of the padding around the watermark image. 505 | 506 | 507 | Adds watermark text to the image. 508 | The image. 509 | The text to use as a watermark. 510 | The color of the watermark text. 511 | The font size of the watermark text. 512 | The font style of the watermark text. 513 | The font type of the watermark text. 514 | The horizontal alignment for watermark text. Values can be left, right, or center. 515 | The vertical alignment for the watermark text. Values can be top, bottom, or middle. 516 | The text opacity for the watermark text specified as a value between 0 and 100. 517 | The size, in pixels, of the padding around the watermark text. 518 | 519 | 520 | Copies the object. 521 | The image. 522 | 523 | 524 | Crops an image. 525 | The cropped image. 526 | The number of pixels to remove from the top. 527 | The number of pixels to remove from the left. 528 | The number of pixels to remove from the bottom. 529 | The number of pixels to remove from the right. 530 | 531 | 532 | Gets or sets the name of the file used by the object. 533 | The file name 534 | 535 | 536 | Flips an image horizontally. 537 | The flipped image. 538 | 539 | 540 | Flips an image vertically. 541 | The flipped image. 542 | 543 | 544 | Returns the image as a byte array. 545 | The image. 546 | The of the object. 547 | 548 | 549 | Returns an image that has been uploaded using the browser. 550 | The image. 551 | (Optional) The name of the file that has been posted. 552 | 553 | 554 | Gets the height, in pixels, of the image. 555 | The height. 556 | 557 | 558 | Gets the format of the image (for example, JPEG or PNG). 559 | The format. 560 | 561 | 562 | Resizes an image. 563 | The resized image. 564 | The width, in pixels, of the object. 565 | The height, in pixels, of the object. 566 | true to preserve the aspect ratio of the image; otherwise, false. 567 | true to prevent the enlargement of the image; otherwise, false. 568 | 569 | 570 | Rotates an image to the left. 571 | The rotated image. 572 | 573 | 574 | Rotates an image to the right. 575 | The rotated image. 576 | 577 | 578 | Saves the image using the specified file name. 579 | The image. 580 | The path to save the image to. 581 | The format used when saving the image file. 582 | true to force that the correct file extension is used for the format specified in ; otherwise, false. 583 | 584 | 585 | Gets the width, in pixels, of the image. 586 | The width. 587 | 588 | 589 | Renders an image to the browser to be displayed. 590 | The image. 591 | (Optional) The file format. 592 | 593 | 594 | Provides a way to construct and send an email message using Simple Mail Transfer Protocol (SMTP). 595 | 596 | 597 | Gets or sets whether Secure Sockets Layer (SSL) is used to encrypt the connection when sending email. 598 | true if SSL is used to encrypt the connection; otherwise, false. 599 | 600 | 601 | Gets or sets the email address of the sender. 602 | The email address of the sender. 603 | 604 | 605 | Gets or sets the sender’s password based on the email account used. 606 | The password of the sender. 607 | 608 | 609 | Sends the specified message to an SMTP server for delivery. 610 | The recipients of this email message. Multiple recipients can be specified by separating them using a semicolon (;). 611 | The subject line for the email message. 612 | The body of the email message. If is true, HTML in the body is interpreted as markup. 613 | The email address of the message sender. 614 | The carbon copy (CC) recipients for the email message, if any. 615 | A collection of file names that specifies the files to attach to the email message. 616 | true to specify that the email message body is in HTML format; false to indicate that the body is in plain-text format. 617 | A collection of headers that are sent with this email message. 618 | 619 | 620 | Gets or sets the port used for SMTP transactions. 621 | The port used for SMTP transactions. 622 | 623 | 624 | Gets or sets the SMTP server used to transmit the email message. 625 | The SMTP server. 626 | 627 | 628 | Gets or sets a value that indicates whether the default credentials are sent with the requests. 629 | true if credentials are sent with the email message; otherwise, false. 630 | 631 | 632 | Gets or sets the name of email account name used to send email. 633 | The name of the user. 634 | 635 | 636 | -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/System.Web.Razor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/ASP.NET Web Pages/v1.0/System.Web.Razor.dll -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/System.Web.WebPages.Administration.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/ASP.NET Web Pages/v1.0/System.Web.WebPages.Administration.dll -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/System.Web.WebPages.Deployment.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/ASP.NET Web Pages/v1.0/System.Web.WebPages.Deployment.dll -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/System.Web.WebPages.Deployment.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | System.Web.WebPages.Deployment 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/System.Web.WebPages.Razor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/ASP.NET Web Pages/v1.0/System.Web.WebPages.Razor.dll -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/System.Web.WebPages.Razor.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | System.Web.WebPages.Razor 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/System.Web.WebPages.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/ASP.NET Web Pages/v1.0/System.Web.WebPages.dll -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/WebMatrix.Data.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/ASP.NET Web Pages/v1.0/WebMatrix.Data.dll -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/WebMatrix.Data.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WebMatrix.Data 5 | 6 | 7 | 8 | 9 | 10 | 11 | Provides methods and properties that are used to access and manage data. 12 | 13 | 14 | Closes an open database. 15 | 16 | 17 | Gets the current connection to a database. 18 | The connection. 19 | 20 | 21 | Occurs when a new database connection is opened by a instance. 22 | 23 | 24 | Releases all resources used by a instance. 25 | 26 | 27 | Releases the unmanaged resources used by a instance and optionally releases the managed resources. 28 | true to release both managed and unmanaged resources; false to release only unmanaged resources. 29 | 30 | 31 | Executes a SQL statement using optional parameters. 32 | The count of records affected by the SQL statement. 33 | The SQL statement to execute. 34 | (Optional) Parameters to pass to the SQL statement. 35 | 36 | 37 | Returns the identity column of the most recently inserted row. 38 | The ID of the most recently inserted row. 39 | 40 | 41 | Opens either the specified database file or the database that is specified using a named connection string from the Web.config file. 42 | The database instance. 43 | The name or connection string of the database. 44 | 45 | 46 | Opens a connection to a database using the specified connection string. 47 | The database instance. 48 | The connection string that contains information that is used to connect to a database. 49 | 50 | 51 | Opens a database using a connection string and the specified provider. 52 | The database instance. 53 | The connection string that contains information that is used to connect to a database. 54 | (Optional) The name of the .NET Framework data provider to use to connect to the data source. 55 | 56 | 57 | Queries the database using a SQL statement (optionally passing parameters) and returns the results. 58 | The results of the query. 59 | The SQL statement to execute. 60 | (Optional) Parameters to pass to the SQL statement. 61 | 62 | 63 | Executes a SQL statement (optionally passing parameters) and returns a single record. 64 | The single database record returned by the SQL statement. 65 | The SQL statement to execute. 66 | (Optional) Parameters to pass to the SQL statement. 67 | 68 | 69 | Executes a SQL statement (optionally passing parameters) and returns a single (scalar) value. 70 | The value returned by the SQL statement. 71 | The SQL statement to execute. 72 | (Optional) Parameters to pass to the SQL statement. 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/WebMatrix.WebData.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/ASP.NET Web Pages/v1.0/WebMatrix.WebData.dll -------------------------------------------------------------------------------- /lib/ASP.NET Web Pages/v1.0/WebMatrix.WebData.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WebMatrix.WebData 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | Provides basic role-management methods. 80 | 81 | 82 | 83 | 84 | Adds the specified user names to the specified roles. 85 | The user names to add. 86 | The roles to add the names to. 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | Returns the user names that are associated with the specified role. 96 | The user names for the role. 97 | The name of the role. 98 | 99 | 100 | Returns a value that indicates whether a specified user is in a specified role. 101 | true if the user is in the role; otherwise, false. 102 | The user name. 103 | The name of the role. 104 | 105 | 106 | 107 | Returns a value that indicates whether a specified role exists. 108 | true if the role exists; otherwise, false. 109 | The name of the role. 110 | 111 | 112 | 113 | 114 | 115 | Provides security and authentication features for ASP.NET Razor pages. 116 | 117 | 118 | Changes the password for the specified user. 119 | true if the password is successfully changed; otherwise, false. 120 | The user name. 121 | The current password for the user. 122 | The new password. 123 | 124 | 125 | Gets a value that indicates whether an account has been confirmed as a valid account with the provider. 126 | true if the account is confirmed; otherwise, false. 127 | A confirmation message to pass to the authentication provider. 128 | 129 | 130 | Creates a new user account with the specified user name and password. 131 | A token from the provider that created the account. 132 | The user name. 133 | The password for the user. 134 | (Optional) true to specify that the account must be confirmed; otherwise, false. The default is false. 135 | 136 | 137 | Creates a new user and a new user account. 138 | A token from the provider that created the user and the account. 139 | The user name. 140 | The password for the user. 141 | (Optional) A dictionary that contains additional user attributes. The default is null. 142 | (Optional) true to specify that the account must be confirmed; otherwise, false. The default is false. 143 | 144 | 145 | Gets the ID for the current user. 146 | The ID for the current user. 147 | 148 | 149 | Gets the user name for the current user. 150 | The name of the current user. 151 | 152 | 153 | 154 | Generates a password reset token that can be sent a user in email. 155 | A token from the provider to send to the user. 156 | The user name. 157 | (Optional) The time in minutes until the password reset token expires. The default is 1440 (24 hours). 158 | 159 | 160 | 161 | 162 | 163 | 164 | Gets the ID for a user based on the user name. 165 | The ID of the logged-in user. 166 | The user name. 167 | 168 | 169 | 170 | 171 | Connects to a database that contains user information. 172 | The name of the connection string. 173 | The name of the database table that contains user information. 174 | The name of the database column that contains user IDs. 175 | The name of the database column that contains user names. 176 | true to indicate that tables should be created automatically; false to indicate that tables should not be created automatically. 177 | 178 | 179 | Connects to a database that contains user information using the specified membership or role provider. 180 | The name of the connection string. 181 | The name of the membership provider or role provider. 182 | The name of the database table that contains user information. 183 | The field that contains user identifier numbers. 184 | The field that contains user names. 185 | true to indicate that tables should be created automatically; false to indicate that tables should not be created automatically. 186 | 187 | 188 | 189 | 190 | Gets the authentication status of the current user. 191 | true if the current user is logged in; otherwise, false. The default is false. 192 | 193 | 194 | Returns a value that indicates whether the logged-in user has been confirmed by the provider. 195 | true if the user is confirmed; otherwise, false. 196 | The user name. 197 | 198 | 199 | Returns a value that indicates whether the user name of the logged-in user matches the specified user name. 200 | true if the logged-in user name matches ; otherwise, false. 201 | The user name to compare the logged-in user name to. 202 | 203 | 204 | Logs the user in. 205 | true if the user was logged in; otherwise false. 206 | The user name. 207 | The password for a user. 208 | (Optional) true to specify that the authentication token in the cookie should be persisted beyond the current session; otherwise false. The default is false. 209 | 210 | 211 | Logs the user out. 212 | 213 | 214 | If the user is not authenticated, sets the HTTP status to 401 (Unauthorized). 215 | 216 | 217 | If the current user is not a member of one of the specified roles, sets the HTTP status code to 401 (Unauthorized). 218 | The roles that are authorized to access a page. 219 | 220 | 221 | If the current user does not match the specified user ID, sets the HTTP status to 401 (Unauthorized). 222 | The ID of the user to compare. 223 | 224 | 225 | If the current user does not match the specified user name, sets the HTTP status to 401 (Unauthorized). 226 | The name of the user to compare. 227 | 228 | 229 | Changes a password. 230 | true if the password was changed; otherwise, false. 231 | A password reset token. 232 | The new password. 233 | 234 | 235 | Returns a value that indicates whether the specified user exists in the membership provider database. 236 | true if the membership provider found ; otherwise, false. 237 | The user name. 238 | 239 | 240 | -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.Compiler.CodeDom.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.Compiler.CodeDom.dll -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.Compiler.CodeDom.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.Compiler.CodeDom.pdb -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.Compiler.CodeDom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | FSharp.Compiler.CodeDom 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | Convert string into Option string where null and String.Empty result in None 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | Implementation of the CodeDomProvider for the F# language. 91 | This is specialized version that can be used with ASP.NET. 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | Implementation of the CodeDomProvider for the F# language. 100 | If you intend to use CodeDom with ASP.NET you should use <c>FSharpAspNetCodeProvider</c> instead. 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | Where are we generating member? 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | We use exception for returning value when generating complex 192 | code that returns using imperative "return" statement 193 | 194 | 195 | 196 | 197 | Type of the method 198 | 199 | 200 | 201 | 202 | Types of all local variables in the method 203 | 204 | 205 | 206 | 207 | Names of all type arguments in scope (need to rename T -> 'T etc.) 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | Options, output, ... 216 | 217 | 218 | 219 | 220 | Some unique ID for every namespace (so we don't have name clashes) 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | Hacking for ASP.NET incorrect array initializers 229 | They generate "string" where codedom test suite uses "string[]" 230 | 231 | 232 | 233 | 234 | Reference inherited fields using "fld" instead of "this.fld" 235 | (could be used in the future to allow implicit classes in ASP.NET?) 236 | 237 | 238 | 239 | 240 | No extra configuration 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | Generate code for compile unit (file) 255 | 256 | 257 | 258 | 259 | Generate code for type declaration (not included in namespace) 260 | 261 | 262 | 263 | 264 | Generate code for namespace without compilation unit 265 | 266 | 267 | 268 | 269 | Generates namespace code - takes output from 'preprocessNamespace' 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | Returns CodeNamespace, list of classes with scope (which includes class names 278 | of containing classes and sequence of class renames) 279 | 280 | 281 | 282 | 283 | Generates a main method. 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | Generates method code 325 | Generates comments and than calls 'generatMethod' 326 | 327 | 328 | 329 | 330 | By default all CodeDOM generated methods are 'virtual' which means that 331 | we have to generate "abstract and default" (unless we're in struct or 332 | we're implementing an interface, or the method is overriden) 333 | (NOTE: the same logic isn't properly implemented for properties) 334 | 335 | 336 | 337 | 338 | Abstract method in the interface 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | Abstract property in the interface 350 | 351 | 352 | 353 | 354 | fields 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | Generate expression - with unkonw type 411 | 412 | 413 | 414 | 415 | Matches array or indexer expression and corrects it if the generated CodeDOM is incorrect 416 | 417 | 418 | 419 | 420 | Generates a "this" or "CurrentType" reference depending on whether a reference 421 | is static or not. Used for "ambiguous" references without a type or object qualifier. 422 | 423 | Unfortunately the Code tree isn't so kind as to tell us whether a reference is static 424 | or not up front. Instead we predetermine a set of some static members and 425 | assume all other references are instance references. 426 | 427 | 428 | 429 | 430 | 431 | Tries to resolve type of an expression using a few tricks: 432 | * Fields of current type may have known type 433 | * Properties of current type as well 434 | * We can also try to resolve other properties (sometimes it helps) 435 | * Resolve type for local variables or argument reference 436 | 437 | 438 | 439 | 440 | Tries to resolve if type is an array, so we can generate 441 | appropriate code (it can be either indexer or array, but we need to generate 442 | .Item call for indexers (no overloading is supported by .[]). 443 | Returns: "None" - can't resolve, "Some" resovled (true/false - is it an array?) 444 | 445 | 446 | 447 | 448 | Generate array initializer. Checks generator options for ASP.NET workaround. 449 | 450 | 451 | 452 | 453 | Generate value of primitive expression 454 | 455 | 456 | 457 | 458 | Returns F# conversion function for the specified type (or empty string) 459 | 460 | 461 | 462 | 463 | Are both types numerical types where numeric conversion function can be applied? 464 | 465 | 466 | 467 | 468 | Generates code for binary operator using function for left and right operand 469 | 470 | 471 | 472 | 473 | Preprocess collection with type parameters 474 | Returns array to be used with <c>usingTyParams</c> and 475 | function to be called to generate < ... > code 476 | 477 | 478 | 479 | 480 | Record specified type parameters in the context, call generating function 481 | and then restore the original type parameters 482 | (this works if someone uses nested type parameters with the same name) 483 | 484 | 485 | 486 | 487 | Generate type arguments using context 488 | 489 | 490 | 491 | 492 | Generate type reference using context 493 | (this is most commonly used method) 494 | 495 | 496 | 497 | 498 | Get type reference, but don't rename .NET types to F# types 499 | (this is only needed when calling static methods on the type) 500 | 501 | 502 | 503 | 504 | Get full type reference string using empty context 505 | 506 | 507 | 508 | 509 | Get full type reference using information from context 510 | 511 | 512 | 513 | 514 | Generate type reference with empty context 515 | 516 | 517 | 518 | 519 | Generates type reference (not for arrays) 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | Tries to resolve type of a variable and adds it to the Context dictionary 531 | 532 | 533 | 534 | 535 | Get System.Type of know type (either standard type or resolved) 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | Output string as a valid F# identifier 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | Tries to find .NET type for specified type name 561 | This is used when we need to know type in order to generate something correctly, 562 | but it's just a fallback case 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | Call specified function only on elements of specified type. 619 | (performs dynamic type test using x.GetType()) 620 | 621 | 622 | 623 | 624 | Process collection - keeps context through the whole processing 625 | calls 'f' for every element in sequence and 'fs' between every two elements 626 | as a separator. This is a variant that works on typed collections. 627 | 628 | 629 | 630 | 631 | Process collection - keeps context through the whole processing 632 | calls 'f' for every element in sequence and 'fs' between every two elements 633 | as a separator 634 | 635 | 636 | 637 | 638 | Perform map and filter operations in one 639 | 640 | 641 | 642 | 643 | Create closure to do the counting 644 | (this is usend when we need indexing during collection processing) 645 | 646 | 647 | 648 | 649 | Print object converted to string 650 | 651 | 652 | 653 | 654 | Identity function 655 | 656 | 657 | 658 | 659 | Call function, but give it context as an argument 660 | 661 | 662 | 663 | 664 | Append specified string without line-break 665 | 666 | 667 | 668 | 669 | Break-line and append specified string 670 | 671 | 672 | 673 | 674 | Print unique id using: "+> uniqid" 675 | 676 | 677 | 678 | 679 | Function composition operator 680 | 681 | 682 | 683 | 684 | Create context using specified text writer and options 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | Walks through the CodeDom tree and keeps current "scope" and the result. 723 | The result is collected through entire tree, but the modified scope is 724 | passed only to sub-nodes of the current node. 725 | 726 | First argument is a function that is called for nodes and has a 727 | function as a first argument, scope and result as a second and current node as a third. 728 | The function argument can be used to walk deeper in the tree if wanted. 729 | 730 | 731 | 732 | 733 | Search for members and return flat list of selected members 734 | Function given as an argument returns tuple - first item specifies 735 | if the current element should be included in the result, the second 736 | specifies if we should walk through child members of the current object 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.Build.Tasks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.PowerPack.Build.Tasks.dll -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.Build.Tasks.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.PowerPack.Build.Tasks.pdb -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.Build.Tasks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | FSharp.PowerPack.Build.Tasks 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | Convert string into Option string where null and String.Empty result in None 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.Compatibility.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.PowerPack.Compatibility.dll -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.Compatibility.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.PowerPack.Compatibility.pdb -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.Linq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.PowerPack.Linq.dll -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.Linq.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.PowerPack.Linq.pdb -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.Linq.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | FSharp.PowerPack.Linq 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | Convert the quotation expression to LINQ expression trees 59 | 60 | This operation will only succeed for a subset of quotation expressions. 61 | 62 | Exceptions: InvalidArgumentException will be raised if the input expression is 63 | not in the subset that can be converted to a LINQ expression tree 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | Compile the quotation expression by first converting to LINQ expression trees 72 | 73 | Exceptions: InvalidArgumentException will be raised if the input expression is 74 | not in the subset that can be converted to a LINQ expression tree 75 | 76 | 77 | 78 | 79 | Evaluate the quotation expression by first converting to LINQ expression trees 80 | 81 | Exceptions: InvalidArgumentException will be raised if the input expression is 82 | not in the subset that can be converted to a LINQ expression tree 83 | 84 | 85 | 86 | 87 | Compile the quotation expression by first converting to LINQ expression trees 88 | 89 | Exceptions: InvalidArgumentException will be raised if the input expression is 90 | not in the subset that can be converted to a LINQ expression tree 91 | 92 | 93 | 94 | 95 | Compile the quotation expression by first converting to LINQ expression trees 96 | 97 | Exceptions: InvalidArgumentException will be raised if the input expression is 98 | not in the subset that can be converted to a LINQ expression tree 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | An intrinsic for compiling <c>&lt;@ x <> y @&gt;</c> to expression trees 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | This join operator implements the LINQ GroupJoin operator and the <c>query</c> convertor recognises it as such 115 | 116 | 117 | 118 | 119 | This join operator corresponds to the LINQ Join operator and the <c>query</c> convertor recognises it as such 120 | 121 | 122 | 123 | 124 | When used in queries, this operator corresponds to the LINQ Join operator and the <c>query</c> convertor recognises it as such 125 | 126 | 127 | 128 | 129 | When used in queries, this operator corresponds to the LINQ Max operator and the <c>query</c> convertor recognises it as such 130 | It differs in return type from <c>Seq.maxBy</c> 131 | 132 | 133 | 134 | 135 | When used in queries, this operator corresponds to the LINQ Min operator and the <c>query</c> convertor recognises it as such 136 | It differs in return type from <c>Seq.minBy</c> 137 | 138 | 139 | 140 | 141 | When used in queries, this operator corresponds to the LINQ Contains operator and the <c>query</c> convertor recognises it as such 142 | 143 | 144 | 145 | 146 | Evaluate the quotation expression by first converting to a LINQ expression tree 147 | making use of IQueryable operators and then executing expression tree 148 | 149 | Exceptions: <c>InvalidArgumentException</c> will be raised if the input expression is 150 | not in the subset that can be converted to a LINQ expression tree 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | This function should not be called directly. 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | A set of types used for implementing quotation conversions. 356 | These are public only because targets of Linq Lambda expressions require them to be so 357 | 358 | 359 | 360 | 361 | This module provides Compile and Eval extension members 362 | for F# quotation values, implemented by translating to LINQ 363 | expression trees and using the LINQ dynamic compiler. 364 | 365 | 366 | 367 | 368 | -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.Metadata.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.PowerPack.Metadata.dll -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.Metadata.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.PowerPack.Metadata.pdb -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.Parallel.Seq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.PowerPack.Parallel.Seq.dll -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.Parallel.Seq.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.PowerPack.Parallel.Seq.pdb -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.PowerPack.dll -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/FSharp.PowerPack.pdb -------------------------------------------------------------------------------- /lib/FSharpPowerPack/FSharp.PowerPack.targets: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | 18 | 19 | CallFsLex;CallFsYacc;$(CompileDependsOn) 20 | 21 | 22 | 23 | 28 | 29 | 30 | 31 | 32 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 54 | 55 | 56 | 57 | 58 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | false 77 | 78 | 79 | false 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /lib/FSharpPowerPack/fshtmldoc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/fshtmldoc.exe -------------------------------------------------------------------------------- /lib/FSharpPowerPack/fslex.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/fslex.exe -------------------------------------------------------------------------------- /lib/FSharpPowerPack/fsyacc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahlbyk/FSRazor/0928db515474c4c3d9ece6cd1c26ea091908e35e/lib/FSharpPowerPack/fsyacc.exe -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | FSRazor 2 | ======= 3 | 4 | F# Parser and Code Generator for Razor View Engine 5 | 6 | Stubbed out based on information here: 7 | http://www.infoq.com/news/2011/01/Razor-Extensions 8 | 9 | Help? 10 | ----- 11 | Yes please. 12 | -------------------------------------------------------------------------------- /src/FSRazor.Mvc/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor.Mvc 2 | 3 | open System.Reflection 4 | 5 | [] 6 | [] 7 | [] 8 | [] 9 | [] 10 | [] 11 | 12 | [] 13 | [] 14 | [, "Start")>] 15 | () 16 | -------------------------------------------------------------------------------- /src/FSRazor.Mvc/FSRazor.Mvc.fsproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {8b35b582-da09-45d0-82bd-85aa1b5266af} 9 | Library 10 | FSRazor.Mvc 11 | FSRazor.Mvc 12 | v4.0 13 | FSRazor.Mvc 14 | 15 | 16 | true 17 | full 18 | false 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | 3 23 | bin\Debug\FSRazor.Mvc.XML 24 | 25 | 26 | pdbonly 27 | true 28 | true 29 | bin\Release\ 30 | TRACE 31 | 3 32 | bin\Release\FSRazor.Mvc.XML 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | ..\..\lib\ASP.NET MVC\v3\System.Web.Mvc.dll 43 | 44 | 45 | ..\..\lib\ASP.NET Web Pages\v1.0\System.Web.Razor.dll 46 | 47 | 48 | ..\..\lib\ASP.NET Web Pages\v1.0\System.Web.WebPages.Razor.dll 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | FSRazor 62 | {6cc14b81-8e91-48f9-a616-0aa952757a23} 63 | True 64 | 65 | 66 | 67 | 68 | 75 | -------------------------------------------------------------------------------- /src/FSRazor.Mvc/FSRazorViewEngine.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor.Mvc 2 | 3 | open Microsoft.FSharp.Collections 4 | open System.Web.Mvc 5 | 6 | type FSRazorViewEngine() = 7 | inherit RazorViewEngine() 8 | 9 | let extensions = [| "fshtml"; "cshtml"; "vbhtml" |] 10 | let appendExtensions p = extensions |> Array.map (fun e -> p + e) 11 | let areaLocationFormats = [| "~/Areas/{2}/Views/{1}/{0}."; "~/Areas/{2}/Views/Shared/{0}." |] 12 | let locationFormats = [| "~/Views/{1}/{0}."; "~/Views/Shared/{0}." |] 13 | 14 | do 15 | base.FileExtensions <- extensions 16 | base.AreaViewLocationFormats <- Array.collect appendExtensions areaLocationFormats 17 | base.AreaMasterLocationFormats <- Array.collect appendExtensions areaLocationFormats 18 | base.AreaPartialViewLocationFormats <- Array.collect appendExtensions areaLocationFormats 19 | base.ViewLocationFormats <- Array.collect appendExtensions locationFormats 20 | base.MasterLocationFormats <- Array.collect appendExtensions locationFormats 21 | base.PartialViewLocationFormats <- Array.collect appendExtensions locationFormats 22 | -------------------------------------------------------------------------------- /src/FSRazor.Mvc/MvcFSharpCodeParser.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor.Mvc 2 | 3 | open FSRazor 4 | 5 | type MvcFSharpCodeParser() = 6 | inherit FSharpCodeParser() 7 | -------------------------------------------------------------------------------- /src/FSRazor.Mvc/MvcFSharpRazorCodeGenerator.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor.Mvc 2 | 3 | open FSRazor 4 | 5 | type MvcFSharpRazorCodeGenerator(className, rootNamespaceName, sourceFileName, host) = 6 | inherit FSharpRazorCodeGenerator(className, rootNamespaceName, sourceFileName, host) 7 | -------------------------------------------------------------------------------- /src/FSRazor.Mvc/MvcWebPageRazorHost.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor.Mvc 2 | 3 | open FSRazor 4 | open System.Web.Razor.Generator 5 | open System.Web.Razor.Parser 6 | 7 | type MvcWebPageRazorHost(virtualPath, physicalPath) = 8 | inherit System.Web.Mvc.Razor.MvcWebPageRazorHost(virtualPath, physicalPath) 9 | 10 | override x.DecorateCodeGenerator(incomingCodeGenerator) = 11 | match incomingCodeGenerator with 12 | | g when (g :? FSharpRazorCodeGenerator) 13 | -> new MvcFSharpRazorCodeGenerator(g.ClassName, g.RootNamespaceName, g.SourceFileName, g.Host) :> RazorCodeGenerator 14 | | _ -> base.DecorateCodeGenerator(incomingCodeGenerator) 15 | 16 | override x.DecorateCodeParser(incomingCodeParser) = 17 | match incomingCodeParser with 18 | | p when (p :? FSharpCodeParser) 19 | -> new MvcFSharpCodeParser() :> ParserBase 20 | | _ -> base.DecorateCodeParser(incomingCodeParser) 21 | -------------------------------------------------------------------------------- /src/FSRazor.Mvc/PreApplicationStartCode.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor.Mvc 2 | 3 | open System 4 | open System.ComponentModel 5 | open System.Web.Mvc 6 | 7 | [] 8 | type PreApplicationStartCode() = 9 | static let mutable startWasCalled = false 10 | 11 | static member Start() = 12 | if (not startWasCalled) then 13 | startWasCalled <- true 14 | 15 | FSRazor.PreApplicationStartCode.Start() 16 | 17 | ViewEngines.Engines.Add(new FSRazorViewEngine()); 18 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Content/Site.css: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------- 2 | The base color for this template is #5c87b2. If you'd like 3 | to use a different color start by replacing all instances of 4 | #5c87b2 with your new color. 5 | ----------------------------------------------------------*/ 6 | body 7 | { 8 | background-color: #5c87b2; 9 | font-size: 75%; 10 | font-family: Verdana, Tahoma, Arial, "Helvetica Neue", Helvetica, Sans-Serif; 11 | margin: 0; 12 | padding: 0; 13 | color: #696969; 14 | } 15 | 16 | a:link 17 | { 18 | color: #034af3; 19 | text-decoration: underline; 20 | } 21 | a:visited 22 | { 23 | color: #505abc; 24 | } 25 | a:hover 26 | { 27 | color: #1d60ff; 28 | text-decoration: none; 29 | } 30 | a:active 31 | { 32 | color: #12eb87; 33 | } 34 | 35 | p, ul 36 | { 37 | margin-bottom: 20px; 38 | line-height: 1.6em; 39 | } 40 | 41 | /* HEADINGS 42 | ----------------------------------------------------------*/ 43 | h1, h2, h3, h4, h5, h6 44 | { 45 | font-size: 1.5em; 46 | color: #000; 47 | } 48 | 49 | h1 50 | { 51 | font-size: 2em; 52 | padding-bottom: 0; 53 | margin-bottom: 0; 54 | } 55 | h2 56 | { 57 | padding: 0 0 10px 0; 58 | } 59 | h3 60 | { 61 | font-size: 1.2em; 62 | } 63 | h4 64 | { 65 | font-size: 1.1em; 66 | } 67 | h5, h6 68 | { 69 | font-size: 1em; 70 | } 71 | 72 | /* this rule styles

tags that are the 73 | first child of the left and right table columns */ 74 | .rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2 75 | { 76 | margin-top: 0; 77 | } 78 | 79 | /* PRIMARY LAYOUT ELEMENTS 80 | ----------------------------------------------------------*/ 81 | 82 | /* you can specify a greater or lesser percentage for the 83 | page width. Or, you can specify an exact pixel width. */ 84 | .page 85 | { 86 | width: 90%; 87 | margin-left: auto; 88 | margin-right: auto; 89 | } 90 | 91 | #header 92 | { 93 | position: relative; 94 | margin-bottom: 0px; 95 | color: #000; 96 | padding: 0; 97 | } 98 | 99 | #header h1 100 | { 101 | font-weight: bold; 102 | padding: 5px 0; 103 | margin: -40px 0 0; 104 | color: #fff; 105 | border: none; 106 | line-height: 2em; 107 | font-size: 32px !important; 108 | } 109 | 110 | #main 111 | { 112 | padding: 30px 30px 15px 30px; 113 | background-color: #fff; 114 | margin-bottom: 30px; 115 | _height: 1px; /* only IE6 applies CSS properties starting with an underscore */ 116 | } 117 | 118 | #footer 119 | { 120 | color: #999; 121 | padding: 10px 0; 122 | text-align: center; 123 | line-height: normal; 124 | margin: 0; 125 | font-size: .9em; 126 | } 127 | 128 | /* TAB MENU 129 | ----------------------------------------------------------*/ 130 | ul#menu 131 | { 132 | border-bottom: 1px #5C87B2 solid; 133 | padding: 0 0 2px; 134 | position: relative; 135 | margin: 0; 136 | text-align: right; 137 | } 138 | 139 | ul#menu li 140 | { 141 | display: inline; 142 | list-style: none; 143 | } 144 | 145 | ul#menu li#greeting 146 | { 147 | padding: 10px 20px; 148 | font-weight: bold; 149 | text-decoration: none; 150 | line-height: 2.8em; 151 | color: #fff; 152 | } 153 | 154 | ul#menu li a 155 | { 156 | padding: 10px 20px; 157 | font-weight: bold; 158 | text-decoration: none; 159 | line-height: 2.8em; 160 | background-color: #e8eef4; 161 | color: #034af3; 162 | } 163 | 164 | ul#menu li a:hover 165 | { 166 | background-color: #fff; 167 | text-decoration: none; 168 | } 169 | 170 | ul#menu li a:active 171 | { 172 | background-color: #a6e2a6; 173 | text-decoration: none; 174 | } 175 | 176 | ul#menu li.selected a 177 | { 178 | background-color: #fff; 179 | color: #000; 180 | } 181 | 182 | /* MISC 183 | ----------------------------------------------------------*/ 184 | .clear 185 | { 186 | clear: both; 187 | } 188 | 189 | .error 190 | { 191 | color:Red; 192 | } 193 | 194 | #menucontainer 195 | { 196 | margin-top:40px; 197 | } 198 | 199 | div#title 200 | { 201 | display:block; 202 | float:left; 203 | text-align:left; 204 | } 205 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace FSRazor.Sample.Mvc.Controllers 4 | { 5 | public class HomeController : Controller 6 | { 7 | public ActionResult Index() 8 | { 9 | ViewBag.Message = "Welcome to FSRazor"; 10 | return View(); 11 | } 12 | 13 | public ActionResult Test() 14 | { 15 | return View(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/FSRazor.Sample.Mvc.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 7 | 8 | 2.0 9 | {184DE8A1-FECC-4176-B617-DE3AD3D7D128} 10 | {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 11 | Library 12 | Properties 13 | FSRazor.Sample.Mvc 14 | FSRazor.Sample.Mvc 15 | v4.0 16 | false 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | pdbonly 29 | true 30 | bin\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | False 38 | ..\..\lib\FSharpPowerPack\FSharp.Compiler.CodeDom.dll 39 | True 40 | 41 | 42 | 43 | 44 | 45 | False 46 | ..\..\lib\ASP.NET Web Pages\v1.0\System.Web.Helpers.dll 47 | 48 | 49 | False 50 | ..\..\lib\ASP.NET MVC\v3\System.Web.Mvc.dll 51 | 52 | 53 | False 54 | ..\..\lib\ASP.NET Web Pages\v1.0\System.Web.Razor.dll 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | Global.asax 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | Web.config 73 | 74 | 75 | Web.config 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | {8B35B582-DA09-45D0-82BD-85AA1B5266AF} 92 | FSRazor.Mvc 93 | 94 | 95 | {6CC14B81-8E91-48F9-A616-0AA952757A23} 96 | FSRazor 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | False 118 | True 119 | 7777 120 | / 121 | 122 | 123 | False 124 | False 125 | 126 | 127 | False 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/FSRazor.Sample.Mvc.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | CurrentPage 10 | True 11 | False 12 | False 13 | False 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | False 23 | True 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="FSRazor.Sample.Mvc.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Routing; 3 | 4 | namespace FSRazor.Sample.Mvc 5 | { 6 | public class MvcApplication : System.Web.HttpApplication 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | 13 | public static void RegisterRoutes(RouteCollection routes) 14 | { 15 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 16 | 17 | routes.MapRoute( 18 | "Default", // Route name 19 | "{controller}/{action}/{id}", 20 | new { controller = "Home", action = "Index", id = UrlParameter.Optional } 21 | ); 22 | } 23 | 24 | protected void Application_Start() 25 | { 26 | AreaRegistration.RegisterAllAreas(); 27 | 28 | RegisterGlobalFilters(GlobalFilters.Filters); 29 | RegisterRoutes(RouteTable.Routes); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | [assembly: AssemblyTitle("FSRazor.Sample.Mvc")] 4 | [assembly: AssemblyDescription("")] 5 | [assembly: AssemblyConfiguration("")] 6 | [assembly: AssemblyCompany("Solutionizing.NET")] 7 | [assembly: AssemblyProduct("FSRazor.Sample.Mvc")] 8 | [assembly: AssemblyCopyright("Copyright © Keith Dahlby 2011")] 9 | 10 | [assembly: AssemblyVersion("1.0.0.0")] 11 | [assembly: AssemblyFileVersion("1.0.0.0")] 12 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Home Page"; 3 | } 4 | 5 |

@ViewBag.Message

6 |

7 | To learn more about FSRazor visit https://github.com/dahlbyk/FSRazor. 8 |

9 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Views/Home/Test.fshtml: -------------------------------------------------------------------------------- 1 | 

@("FS" + "Razor")

2 |

@( 3 | let even_odd s = 4 | match s % 2 with 5 | | 0 -> sprintf "%i is even!" s 6 | | _ -> sprintf "%i is odd!" s 7 | DateTime.Now.Second |> even_odd 8 | )

9 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = "Error"; 5 | } 6 | 7 |

8 | Sorry, an error occurred while processing your request. 9 |

10 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | @ViewBag.Title 5 | 6 | 7 | 8 | 9 |
10 | 21 |
22 | @RenderBody() 23 | 25 |
26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.Mvc/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.WebPages/Index.fshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | FSRazor.WebPages 7 | 8 | 9 |

@("FSRazor" + ".WebPages")

10 |

@( 11 | let even_odd s = 12 | match s % 2 with 13 | | 0 -> sprintf "%i is even!" s 14 | | _ -> sprintf "%i is odd!" s 15 | DateTime.Now.Second |> even_odd 16 | )

17 | 18 | 19 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.WebPages/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/FSRazor.Sample.WebPages/robots.txt: -------------------------------------------------------------------------------- 1 | 2 | # WebMatrix 1.0 3 | -------------------------------------------------------------------------------- /src/FSRazor.WebPages/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor.WebPages 2 | 3 | open System.Reflection 4 | 5 | [] 6 | [] 7 | [] 8 | [] 9 | [] 10 | [] 11 | 12 | [] 13 | [] 14 | [, "Start")>] 15 | () 16 | -------------------------------------------------------------------------------- /src/FSRazor.WebPages/FSRazor.WebPages.fsproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {b2fc3a34-b8bf-4f19-9841-8c2ddb05376b} 9 | Library 10 | FSRazor.WebPages 11 | FSRazor.WebPages 12 | v4.0 13 | FSRazor.WebPages 14 | 15 | 16 | true 17 | full 18 | false 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | 3 23 | bin\Debug\FSRazor.WebPages.XML 24 | 25 | 26 | pdbonly 27 | true 28 | true 29 | bin\Release\ 30 | TRACE 31 | 3 32 | bin\Release\FSRazor.WebPages.XML 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | ..\..\lib\ASP.NET Web Pages\v1.0\System.Web.WebPages.dll 42 | 43 | 44 | ..\..\lib\ASP.NET Web Pages\v1.0\System.Web.WebPages.Deployment.dll 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | FSRazor 54 | {6cc14b81-8e91-48f9-a616-0aa952757a23} 55 | True 56 | 57 | 58 | 59 | 60 | 67 | -------------------------------------------------------------------------------- /src/FSRazor.WebPages/PreApplicationStartCode.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor.WebPages 2 | 3 | open System 4 | open System.ComponentModel 5 | open System.Reflection 6 | open System.Web.WebPages 7 | 8 | [] 9 | type PreApplicationStartCode() = 10 | static let mutable startWasCalled = false 11 | 12 | static member Start() = 13 | if (not startWasCalled) then 14 | startWasCalled <- true 15 | 16 | FSRazor.PreApplicationStartCode.Start() 17 | 18 | WebPageHttpHandler.RegisterExtension("fshtml") 19 | 20 | let pascType = typeof 21 | let lwp = pascType.GetMethod("LoadWebPages", BindingFlags.NonPublic ||| BindingFlags.Static) 22 | lwp.Invoke(null, null) |> ignore 23 | -------------------------------------------------------------------------------- /src/FSRazor.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{204DF63B-C74F-4A2D-9BBF-E190168B5E34}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FSRazor.Sample.Mvc", "FSRazor.Sample.Mvc\FSRazor.Sample.Mvc.csproj", "{184DE8A1-FECC-4176-B617-DE3AD3D7D128}" 7 | EndProject 8 | Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "FSRazor.Sample.WebPages", "FSRazor.Sample.WebPages\", "{6668120F-9656-4802-883A-49A2F04BDCBD}" 9 | ProjectSection(WebsiteProperties) = preProject 10 | TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" 11 | ProjectReferences = "{6CC14B81-8E91-48F9-A616-0AA952757A23}|FSRazor.dll;{B2FC3A34-B8BF-4F19-9841-8C2DDB05376B}|FSRazor.WebPages.dll;" 12 | Debug.AspNetCompiler.VirtualPath = "/FSRazor.Sample.WebPages" 13 | Debug.AspNetCompiler.PhysicalPath = "FSRazor.Sample.WebPages\" 14 | Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\FSRazor.Sample.WebPages\" 15 | Debug.AspNetCompiler.Updateable = "true" 16 | Debug.AspNetCompiler.ForceOverwrite = "true" 17 | Debug.AspNetCompiler.FixedNames = "false" 18 | Debug.AspNetCompiler.Debug = "True" 19 | Release.AspNetCompiler.VirtualPath = "/FSRazor.Sample.WebPages" 20 | Release.AspNetCompiler.PhysicalPath = "FSRazor.Sample.WebPages\" 21 | Release.AspNetCompiler.TargetPath = "PrecompiledWeb\FSRazor.Sample.WebPages\" 22 | Release.AspNetCompiler.Updateable = "true" 23 | Release.AspNetCompiler.ForceOverwrite = "true" 24 | Release.AspNetCompiler.FixedNames = "false" 25 | Release.AspNetCompiler.Debug = "False" 26 | VWDPort = "4071" 27 | EndProjectSection 28 | EndProject 29 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSRazor", "FSRazor\FSRazor.fsproj", "{6CC14B81-8E91-48F9-A616-0AA952757A23}" 30 | EndProject 31 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSRazor.Mvc", "FSRazor.Mvc\FSRazor.Mvc.fsproj", "{8B35B582-DA09-45D0-82BD-85AA1B5266AF}" 32 | EndProject 33 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSRazor.WebPages", "FSRazor.WebPages\FSRazor.WebPages.fsproj", "{B2FC3A34-B8BF-4F19-9841-8C2DDB05376B}" 34 | EndProject 35 | Global 36 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 37 | Debug|Any CPU = Debug|Any CPU 38 | Release|Any CPU = Release|Any CPU 39 | EndGlobalSection 40 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 41 | {184DE8A1-FECC-4176-B617-DE3AD3D7D128}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 42 | {184DE8A1-FECC-4176-B617-DE3AD3D7D128}.Debug|Any CPU.Build.0 = Debug|Any CPU 43 | {184DE8A1-FECC-4176-B617-DE3AD3D7D128}.Release|Any CPU.ActiveCfg = Release|Any CPU 44 | {184DE8A1-FECC-4176-B617-DE3AD3D7D128}.Release|Any CPU.Build.0 = Release|Any CPU 45 | {6668120F-9656-4802-883A-49A2F04BDCBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 46 | {6668120F-9656-4802-883A-49A2F04BDCBD}.Debug|Any CPU.Build.0 = Debug|Any CPU 47 | {6668120F-9656-4802-883A-49A2F04BDCBD}.Release|Any CPU.ActiveCfg = Debug|Any CPU 48 | {6668120F-9656-4802-883A-49A2F04BDCBD}.Release|Any CPU.Build.0 = Debug|Any CPU 49 | {6CC14B81-8E91-48F9-A616-0AA952757A23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 50 | {6CC14B81-8E91-48F9-A616-0AA952757A23}.Debug|Any CPU.Build.0 = Debug|Any CPU 51 | {6CC14B81-8E91-48F9-A616-0AA952757A23}.Release|Any CPU.ActiveCfg = Release|Any CPU 52 | {6CC14B81-8E91-48F9-A616-0AA952757A23}.Release|Any CPU.Build.0 = Release|Any CPU 53 | {8B35B582-DA09-45D0-82BD-85AA1B5266AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 54 | {8B35B582-DA09-45D0-82BD-85AA1B5266AF}.Debug|Any CPU.Build.0 = Debug|Any CPU 55 | {8B35B582-DA09-45D0-82BD-85AA1B5266AF}.Release|Any CPU.ActiveCfg = Release|Any CPU 56 | {8B35B582-DA09-45D0-82BD-85AA1B5266AF}.Release|Any CPU.Build.0 = Release|Any CPU 57 | {B2FC3A34-B8BF-4F19-9841-8C2DDB05376B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 58 | {B2FC3A34-B8BF-4F19-9841-8C2DDB05376B}.Debug|Any CPU.Build.0 = Debug|Any CPU 59 | {B2FC3A34-B8BF-4F19-9841-8C2DDB05376B}.Release|Any CPU.ActiveCfg = Release|Any CPU 60 | {B2FC3A34-B8BF-4F19-9841-8C2DDB05376B}.Release|Any CPU.Build.0 = Release|Any CPU 61 | EndGlobalSection 62 | GlobalSection(SolutionProperties) = preSolution 63 | HideSolutionNode = FALSE 64 | EndGlobalSection 65 | GlobalSection(NestedProjects) = preSolution 66 | {184DE8A1-FECC-4176-B617-DE3AD3D7D128} = {204DF63B-C74F-4A2D-9BBF-E190168B5E34} 67 | {6668120F-9656-4802-883A-49A2F04BDCBD} = {204DF63B-C74F-4A2D-9BBF-E190168B5E34} 68 | EndGlobalSection 69 | EndGlobal 70 | -------------------------------------------------------------------------------- /src/FSRazor/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor.Mvc 2 | 3 | open System.Reflection 4 | 5 | [] 6 | [] 7 | [] 8 | [] 9 | [] 10 | [] 11 | 12 | [] 13 | [] 14 | [, "Start")>] 15 | () 16 | -------------------------------------------------------------------------------- /src/FSRazor/FSRazor.fsproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {6cc14b81-8e91-48f9-a616-0aa952757a23} 9 | Library 10 | FSRazor 11 | FSRazor 12 | v4.0 13 | FSRazor 14 | 15 | 16 | true 17 | full 18 | false 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | 3 23 | bin\Debug\FSRazor.XML 24 | 25 | 26 | pdbonly 27 | true 28 | true 29 | bin\Release\ 30 | TRACE 31 | 3 32 | bin\Release\FSRazor.XML 33 | 34 | 35 | 36 | ..\..\lib\FSharpPowerPack\FSharp.Compiler.CodeDom.dll 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | ..\..\lib\ASP.NET Web Pages\v1.0\System.Web.Razor.dll 45 | 46 | 47 | ..\..\lib\ASP.NET Web Pages\v1.0\System.Web.WebPages.Razor.dll 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 67 | -------------------------------------------------------------------------------- /src/FSRazor/FSharpCodeParser.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor 2 | 3 | open System 4 | open System.Web.Razor.Parser 5 | open System.Web.Razor.Parser.SyntaxTree 6 | 7 | type FSharpCodeParser() = 8 | inherit CodeParser() 9 | 10 | override x.AcceptGenericArgument() = 11 | () 12 | 13 | override x.HandleTransition(s) = 14 | false 15 | 16 | override x.TryAcceptStringOrComment() = 17 | false 18 | 19 | override x.ParseBlock() = 20 | let isStatementBlock, complete = 21 | match x.CurrentCharacter with 22 | | '{' -> x.StartBlock(BlockType.Statement) |> ignore 23 | true, false // x.ParseCodeBlock(new CodeBlockInfo("code", x.CurrentLocation, true), true) 24 | | '(' -> x.StartBlock(BlockType.Expression) |> ignore 25 | false, x.ParseDelimitedBlock(')', new CodeBlockInfo("explicit expression", x.CurrentLocation, true), true, true, null) 26 | | _ -> if (Char.IsWhiteSpace(x.CurrentCharacter)) then 27 | x.OnError(x.CurrentLocation, "Unexpected whitespace after the '@'.") 28 | else if x.EndOfFile then 29 | x.OnError(x.CurrentLocation, "End-of-file was found after the '@'.") 30 | else 31 | x.OnError(x.CurrentLocation, "'{0}' is not valid at the start of a code block.", x.CurrentCharacter) 32 | x.StartBlock(BlockType.Expression) |> ignore 33 | x.End(ImplicitExpressionSpan.Create(context = x.Context, 34 | keywords = null, 35 | acceptTrailingDot = false, 36 | acceptedCharacters = AcceptedCharacters.NonWhiteSpace)) 37 | false, true 38 | 39 | if isStatementBlock && not x.Context.WhiteSpaceIsImportantToAncestorBlock then 40 | use b = x.Context.StartTemporaryBuffer() 41 | x.Context.AcceptWhiteSpace(includeNewLines = false) |> ignore 42 | if Char.IsWhiteSpace(x.CurrentCharacter) then 43 | x.Context.AcceptLine(includeNewLineSequence = true) |> ignore 44 | x.Context.AcceptTemporaryBuffer() 45 | 46 | // End a span if we have any content left and don't have an unterminated block left hanging 47 | let haveGrowableSpan = x.Context.PreviousSpanCanGrow || complete 48 | if (not haveGrowableSpan) || x.HaveContent then 49 | let acceptedCharacters = if complete then AcceptedCharacters.None else AcceptedCharacters.Any 50 | x.End(CodeSpan.Create(context = x.Context, hidden = false, acceptedCharacters = acceptedCharacters)) 51 | 52 | x.EndBlock() 53 | 54 | member private x.ParseDelimitedBlock(terminator, block, allowTransition, useErrorRecovery, autoCompleteString : string) = 55 | x.Context.AcceptWhiteSpace(includeNewLines = true) |> ignore 56 | 57 | let bracket = x.Context.AcceptCurrent() 58 | x.End(MetaCodeSpan.Create(x.Context)) 59 | 60 | let complete = x.BalanceBrackets(bracket = new Nullable(bracket), 61 | appendOuter = false, 62 | allowTransition = allowTransition, 63 | useTemporaryBuffer = useErrorRecovery, 64 | spanFactory = null) 65 | match complete with 66 | | true -> x.End(CodeSpan.Create(x.Context)) 67 | x.Context.AcceptCurrent() |> ignore 68 | x.End(MetaCodeSpan.Create(x.Context)) 69 | | false -> if useErrorRecovery then 70 | () // TryRecover(RecoveryModes.Markup | RecoveryModes.Transition) 71 | x.End(CodeSpan.Create(context = x.Context, autoCompleteString = autoCompleteString)) 72 | x.OnError(block.Start, "The {0} block is missing a closing '{1}' character.", bracket, terminator) 73 | 74 | complete 75 | -------------------------------------------------------------------------------- /src/FSRazor/FSharpCodeWriter.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor 2 | 3 | open System.Web.Razor 4 | open System.Web.Razor.Generator 5 | 6 | type FSharpCodeWriter() = 7 | inherit CodeWriter() 8 | 9 | member private x.Write (s : string) = 10 | base.InnerWriter.Write(s) 11 | 12 | member private x.WriteLine () = 13 | base.InnerWriter.WriteLine() 14 | 15 | override x.EmitStartConstructor(typeName) = 16 | x.Write "new " 17 | x.Write typeName 18 | x.Write "(" 19 | 20 | override x.EmitEndConstructor() = 21 | x.Write ")" 22 | 23 | override x.EmitStartLambdaDelegate(parameterNames) = 24 | x.EmitStartLambdaExpression parameterNames 25 | x.WriteLine() 26 | 27 | override x.EmitEndLambdaDelegate() = 28 | x.WriteLine() 29 | 30 | override x.EmitStartLambdaExpression(parameterNames) = 31 | x.Write "(fun " 32 | match parameterNames.Length with 33 | | 0 -> x.Write "() " 34 | | _ -> parameterNames |> Array.iter (fun n -> x.Write n; x.Write " ") 35 | x.Write "-> " 36 | 37 | override x.EmitEndLambdaExpression() = 38 | x.Write ")" 39 | 40 | override x.EmitStartMethodInvoke(methodName) = 41 | x.Write "this." 42 | x.Write methodName 43 | x.Write "(" 44 | 45 | override x.EmitEndMethodInvoke() = 46 | x.Write ")" 47 | 48 | override x.WriteHelperHeaderPrefix(templateTypeName, isStatic) = 49 | raise <| new System.NotImplementedException() 50 | 51 | override x.WriteLinePragma(lineNumber, fileName) = 52 | if lineNumber.HasValue then 53 | x.WriteLine() 54 | x.Write "# " 55 | x.Write (lineNumber.Value.ToString()) 56 | x.Write " \"" 57 | x.Write fileName 58 | x.Write "\"" 59 | 60 | override x.WriteParameterSeparator() = 61 | x.Write ", " 62 | 63 | override x.WriteReturn() = 64 | x.WriteLine() 65 | 66 | override x.WriteSnippet(snippet) = 67 | x.Write snippet 68 | 69 | override x.WriteStringLiteral(literal) = 70 | x.Write "@\"" 71 | x.Write <| literal.Replace("\"", "\"\"") 72 | x.Write "\"" 73 | -------------------------------------------------------------------------------- /src/FSRazor/FSharpRazorCodeGenerator.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor 2 | 3 | open System.Web.Razor 4 | open System.Web.Razor.Generator 5 | 6 | type FSharpRazorCodeGenerator(className, rootNamespaceName, sourceFileName, host) = 7 | inherit RazorCodeGenerator(className, rootNamespaceName, sourceFileName, host) 8 | 9 | override x.CreateCodeWriter() = 10 | new FSharpCodeWriter() :> CodeWriter 11 | -------------------------------------------------------------------------------- /src/FSRazor/FSharpRazorCodeLanguage.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor 2 | 3 | open System.Web.Razor 4 | open System.Web.Razor.Generator 5 | open System.Web.Razor.Parser 6 | 7 | type FSharpRazorCodeLanguage() = 8 | inherit RazorCodeLanguage() 9 | 10 | static member Install() = 11 | RazorCodeLanguage.Languages.Add("fshtml", new FSharpRazorCodeLanguage()) 12 | 13 | override x.LanguageName 14 | with get() = "fsharp" 15 | 16 | override x.CodeDomProviderType 17 | with get() = typeof 18 | 19 | override x.CreateCodeParser() = 20 | new FSharpCodeParser() :> ParserBase 21 | 22 | override x.CreateCodeGenerator(className, rootNamespaceName, sourceFileName, host) = 23 | new FSharpRazorCodeGenerator(className, rootNamespaceName, sourceFileName, host) :> RazorCodeGenerator 24 | -------------------------------------------------------------------------------- /src/FSRazor/PreApplicationStartCode.fs: -------------------------------------------------------------------------------- 1 | namespace FSRazor 2 | 3 | open FSRazor 4 | open System 5 | open System.Web.Compilation 6 | open System.ComponentModel 7 | open System.Web.WebPages.Razor 8 | 9 | [] 10 | type PreApplicationStartCode() = 11 | static let mutable startWasCalled = false 12 | 13 | static member Start() = 14 | if (not startWasCalled) then 15 | startWasCalled <- true 16 | 17 | BuildProvider.RegisterBuildProvider(".fshtml", typeof) 18 | FSharpRazorCodeLanguage.Install(); 19 | --------------------------------------------------------------------------------